LDR AND RELAY USING ARDUINO

by HAMZA681 in Circuits > Arduino

523 Views, 0 Favorites, 0 Comments

LDR AND RELAY USING ARDUINO

WhatsApp Image 2023-12-07 at 12.34.30 AM (2).jpeg
WhatsApp Image 2023-12-07 at 12.34.29 AM.jpeg

Today I Will Be Showing You How To Invent A Circuit That Uses An LDR Sensor And A Relay Module To Detect Light And Open A 220V AC Light Bulb

Supplies

WhatsApp Image 2023-12-07 at 12.34.30 AM.jpeg

1- LDR (1) (BUY NOW)

2- Relay Module (1) (BUY NOW)

3- Arduino Uno (1) (BUY NOW)

4- 1K Resistor (1) (BUY NOW)

5- Breadboard (1) (BUY NOW)

6- 220V AC Light Bulb (1)

7- 220V AC Cable

8- Light Bulb Holder (1)

9- Male/Male Jumper Wires (5) (BUY NOW)

10- Male/Female Jumper Wires (3) (BUY NOW)

Schematic

WhatsApp Image 2023-12-07 at 12.34.30 AM (1).jpeg

For Arduino Wiring

1-GND ON RELAY TO GND ON ARDUINO

2-VCC ON RELAY TO 5V ON ARDUINO

3-SIGNAL ON RELAY TO PIN 8 ON ARDUINO

4-LDR POSITIVE LEG (Any Leg) TO 5V ON ARDUINO

5-LDR NEGATIVE LEG (Opposite Leg Of Step 4) TO A0 On Arduino

6-LDR NEGATIVE LEG (Same Leg As Step 5) To GND On Arduino Connected By A 1Kohm Resistor

----------------------------------------------------------------------------------------------------------------------------------

** Take Care While Wiring Because Your Dealing With High Voltage

Code

Screenshot 2023-12-07 003905.png