Automatic Street Light

Automatic Street light system is designed which gets turned on under bad lighting conditions thereby providing energy saving

BeginnerShowcase (no instructions)24 hours723
Automatic Street Light

Things used in this project

Story

Read more

Schematics

street light control

hand drawn schematic used during design phase

Code

street light control

Arduino
used for switching on the street light
void setup() {
Serial.begin(9600);
pinMode(P5_5,INPUT);
pinMode(P2_7,OUTPUT);// put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly: 
  if (digitalRead(P5_5)== 1)
  {
    delay(1000);
    digitalWrite(P2_7,HIGH);
    Serial.print(digitalRead(P5_5));
    Serial.println("RELAY");
   
    delay(1000);
  }
  if (digitalRead(P5_5)== 0)
  {
    digitalWrite(P2_7,LOW);
    Serial.print(digitalRead(P5_5));
    Serial.println("RELAY oFF");
    delay(1000);
  }
}

Credits

Vaibhav Bhatia
1 project • 1 follower
Dr. Umesh Dutta
42 projects • 62 followers
Working as Director of Innovation Centre at Manav Rachna, India. I am into development for the last 12 years.
Energia
34 projects • 26 followers
Founder of @energiaproject
Texas Instruments University Program
91 projects • 120 followers
TI helps students discover what's possible to engineer their future.

Comments