Professional Documents
Culture Documents
Esiot 2
Esiot 2
Aim : To Interface Push button/Dgital sensor(IR/LDR) with Arduino Raspberry pi and write a program to
t turn ON LED when push button is pressed or at sensor detection.
1 Connect the Raspberry pi 4 to the Monitor display along with the keyboard, mouse and the ethernet
cable.
2. For the function of the switch connect the 3v3 power supply (pin 1) of the Raspberry pi to the positive
terminal of the LED display board and the negative terminal of the display board to the ground (pin 9)
and connect one of the switch pins to GPIO 17 (pin 11) and from GPIO 18 (pin 12) connect a jumper
cable to one of the LED pin and run the program.
4. For LDR and IR sensor connect the VCC(pin 1) to 3v3 power supply (pin1) of the Raspberry pi then
connect the ground terminal of the sensor to ground terminal (pin 6) of the Raspberry Pi and the output
terminal to GPIO 17 (pin 11) and from GPIO 18 (pin 12) connect a jumper cable to one of the LED pin
and run the program.
Program :
FLOW CHART
ANURAG UNIVERSITY EMBEDDED SYSTEMS & IOT LAB ECE DEPARTMENT
NAME: K.SAI PRARDHANA DATE : 07-12-23
ROLL NO : 21EG104A45 PAGE NO :
else:
GPIO.output(18,GPIO.LOW) // Output is low //
time.sleep(2) // Output is low for 2 seconds //
Result
INTERFACING DIAGRAM
Conclusion:
We have performed the experiment to interface Push button/Digital sensor (IR/LDR) with Arduino/Raspberry
Pi and write a program to turn ON LED when push button is pressed or at sensordetection.