IOT (2)
IOT (2)
EXP: 1B. Write Program Using Arduino IDE For Blink LED.
NAME: c.poojitha DATE:06-12-2024
H.NO: 22EG106B34 P.NO: 1
HARDWARE REQUIREMENTS:
● LED Module
● Jumper Wires
SOFTWARE REQUIREMENTS:
● Arduino IDE
PROCEDURE:
● Connect the common (cathode-) pin of the LED module to GND (0V) on the
AConnect the common (anode+) pin of the LED module to 5V on the Arduino.
●Connect the pin of LED bulb to 3 of Digital PWM on the Arduino since we given 3 in
Program for output.
●Using USB wire connect the system and Arduino. Enter the program in Arduino IDE
software followed by compile and upload it to Arduino. Note that the selected board
is Arduino UNO and port is connected.
PROGRAM:
void setup() {
pinMode(3, OUTPUT);
RESULT:
CONCLUSION:
Blink LED using Arduino has been implemented.
HARDWARE REQUIREMENTS:
● Buzzer
● Jumper Wires
SOFTWARE REQUIREMENTS:
● Connect the common (cathode-) pin of the Buzzer to GND (0V) on the Arduino.
● Connect the common (anode+) pin of the Buzzer 3 of Digital PWM on the Arduino
since we given 3 in program for output.
●Using USB wire connect the system and Arduino. Enter the program in Arduino IDE
software followed by compile and upload it to Arduino. Note that the selected board
is Arduino UNO and port is connected.
●We can listen sound of buzzer for 10 seconds continuously with 5 seconds gap.
PROGRAM:
digitalWrite(buzz,LOW);
RESULT:
CONCLUSION:
Buzzer using Arduino has been implemented.
HARDWARE REQUIREMENTS:
● LDR
●LED Module
● Jumper Wires
SOFTWARE REQUIREMENTS:
● Arduino IDE
PROCEDURE:
● Connect the common (cathode-) pin of the LED module to GND (0V) on the Arduino.
● Connect the common (anode+) pin of the LED module to 2 of Digital PWM on the
Arduino since we given 2 in program for output.
●Connect the A0 of LDR to A0 of ‘Analog in’ on the Arduino.
●Using USB wire connect the system and Arduino. Enter the program in Arduino IDE
software followed by compile and upload it to Arduino. Note that the selected board
is Arduino UNO and port is connected.
●Whenever there is darkness the bulb glows brightly and whenever there is lighting
bulb does not glow. It is used in smart homes.
PROGRAM:
int LDRInput=A0;
int LED=2;
void setup() {
Serial.begin(9600);
pinMode(LDRInput,INPUT);
pinMode(LED,OUTPUT);
}
value=analogRead(LDRInput);
else
}
}
RESULT:
CONCLUSION:
LDR using Arduino has been implemented.
HARDWARE REQUIREMENTS:
● IR Sensor
●LED Module
● Jumper Wires
SOFTWARE REQUIREMENTS:
● Arduino IDE
PROCEDURE:
● Connect the common (cathode-) pin of the LED module to GND (0V) on the Arduino.
● Connect the common (anode+) pin of the LED module to 13 of Digital PWM on the
Arduino since we given 13 in program for output.
●Connect the OUT of IR Sensor to 9 of Digital PWM on the Arduino.
●Using USB wire connect the system and Arduino. Enter the program in Arduino IDE
software followed by compile and upload it to Arduino. Note that the selected board
is Arduino UNO and port is connected.
●Whenever an object/hand comes near in front of the sensor, bulb glows brightly else
the bulb does not glow. It is used in detecting objects.
PROGRAM:
int IRSensor=9;
int LED=13;
void setup() {
Serial.begin(115200);
Serial.println("Serial working");
pinMode(IRSensor,INPUT);
pinMode(LED,OUTPUT);
}
sensorStatus=digitalRead(IRSensor);
if(sensorStatus==1)
{
digitalWrite(LED,LOW);
Serial.println("Motion detected");
}
else
digitalWrite(LED,HIGH);
Serial.println("Motion Ended!");
CONCLUSION:
IR Sensor using Arduino has been implemented.