0% found this document useful (0 votes)
13 views

iot 4_rahul mehta (1)

Uploaded by

Sidharth Thakur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

iot 4_rahul mehta (1)

Uploaded by

Sidharth Thakur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DEPARTMENTOF

COMPUTERSCIENCE
&ENGINEERING
Experiment 1.4
Student Name: Sidharth Kumar UID: 20BCS1997
Branch: CSE Section/Group: 20BCS_DM-602
Semester: 6th Date of Performance: 2nd Mar,’23
Subject Name: IOT LAB Subject Code:20CSP358

Aim: Program to interface the Arduino/Raspberry Pi with LED and blinking application.

Objectives:
1. Learn about interfacing.
2. Learn about IoT programming.

Components Required:
You will need the following components –
 1 × Breadboard
 1 × Arduino Uno R3
 1 × LED
 1 × 330Ω Resistor
 2 × Jumper

Procedure: LEDs are small, powerful lights that are used in many different applications. To start, we will work
on blinking an LED, the Hello World of micro controllers. It is as simple as turning a light on and off.
Establishing this important baseline will give you a solid foundation as we work towards experiments that are
more complex.

 Step 1: Take your Arduino board and connect 2 separate jumper wires on pin 2 and pin 13 respectively.
 Step 2: Take your led and connect your positive end of led to the jumper wire connected to pin 2.
 Step 3: Similarly, connect the other end of the led to pin 13’s jumper wire.
 Step 4: Now write a code in your Arduino IDE for blinking of light.

Fig 1 down below demonstrates the code in the IDE.

Fig.1
DEPARTMENTOF
COMPUTERSCIENCE
&ENGINEERING
 Step 5: Now connect your Arduino board to your pc via USB jack and in your Arduino IDE, select
your board and click on upload.
 Step 6: Note the observations and output

Follow the circuit diagram and hook up the components on the breadboard as shown in the image given
below.

Note − To find out the polarity of an LED, look at it closely. The shorter of the two legs, towards the flat
edge of the bulb indicates the negative terminal.

Components like resistors need to have their terminals bent into 90° angles in order to fit the breadboard
sockets properly. You can also cut the terminals shorter.
DEPARTMENTOF
COMPUTERSCIENCE
&ENGINEERING

Code to Note
pinMode(2, OUTPUT) − Before you can use one of Arduino’s pins, you need to tell Arduino Uno R3 whether it
is an INPUT or OUTPUT. We use a built-in “function” called pinMode() to do this.
digitalWrite(2, HIGH) − When you are using a pin as an OUTPUT, you can command it to be HIGH (output 5
volts), or LOW (output 0 volts).

Result/Output obtained

Fig.2 Fig.3

You might also like