Smart Street Light Ir Proximity With Ldr
by bichagalpradyun in Circuits > Arduino
204 Views, 2 Favorites, 0 Comments
Smart Street Light Ir Proximity With Ldr
*I made this project because I saw overnight the lights are not off so if we use ldr overnight the sensor will on the lights
overnight so we lose a lot of electricity.
*if we use ir proximity we lode a lot of energy because the sensor will detect the car morning also so again a lot of
electricity waste.
so keeping these two problems in mind I made a project that if it is night and the ir proximity detects a veichle
it will on the lights or if else it will not on the light
Supplies
you need ;
ARDUINO
LDR SENSOR DIGITAL
ARDUINO IDE
PROGRAMMING CABLE
IR PROXIMITY
JUMPER WIRES
LED (ANY COLOR )
RESISTOR 1K
DO THE CONNECTIONS ACCORDING TO THE DIAGRAM
AND HERE IS THE CODE
int ldr = 0;
int readete = 0;
void setup()
{
pinMode(10, INPUT);
pinMode(11, INPUT);
Serial.begin(9600);
pinMode(12, OUTPUT);
}
void loop()
{
readete = digitalRead(10);
ldr = digitalRead(11);
Serial.println(readete);
if (ldr == 1) {
if (readete == 0) {
digitalWrite(12, HIGH);
} else {
digitalWrite(12, LOW);
}
} else {
digitalWrite(12, LOW);
}
delay(10); // Delay a little bit to improve simulation performance
}
THANK YO U PLEASE LIKE