Have you ever thought that if all the street lights turn ON and OFF automatically according to the intensity of light in the sky? This project is same as above!
When sun sets and as the intensity decreases the street light intensity increases and vice versa in the morning.
HARDWARE CONNECTIONSA.CONNECTING LED
1. Connect -ve terminal of LED to GND pin of WiFi Module.
2. Take a 330 kohm resister and wrap any terminal of resistor around +ve terminal of LED(long).
3. Connect the other terminal of LED to GPIO pin 1 of WiFi Module.
B.CONNECTING LDR
1. Connect any terminal of LDR to 3v3 pin of WiFi Module.
2. Connect other terminal of LDR to A0 pin of WiFi Module.
3. Take a 10 kohm resister and connect any terminal to GND pin.
4. Connect other terminal of resister to A0 pin.
NOTE: Do all the connections on a breadboard without connecting to the Power Supply and cross-verify connection atleast once.
Working:
1) When you run the code, input of the LDR is considered.
2) Then this input is calculated according to the formulae used in the code.
3) Then the answer is your intensity of the light required at that time. So light glows accordingly.
Comments