Project admin

This project is private.

Created January 16, 2023 © GPL3+

Advanced Street Lights

This Project is the advanced version of Smart Street lights which can differentiate between moving or immobile object, with IoT control.

IntermediateWork in progress2 hours19
Advanced Street Lights

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
PIR Motion Sensor (generic)
PIR Motion Sensor (generic)
×1
LED Light Bulb, Frosted GLS
LED Light Bulb, Frosted GLS
×1
Grove - 2-Channel SPDT Relay
Seeed Studio Grove - 2-Channel SPDT Relay
Channel can be decided according to output lights.
×1
9V battery (generic)
9V battery (generic)
Ac source can also be used.
×1
LDR, 5 Mohm
LDR, 5 Mohm
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Slide Switch
Slide Switch
For Ac supply choose switch accordingly.
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

10 Pc. Jumper Wire Kit, 5 cm Long
10 Pc. Jumper Wire Kit, 5 cm Long
For Ac supply choose proper wires.
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
For Ac supply mainly used.

Story

Read more

Schematics

Schematic

Diagram

Code

Arduino Code

C/C++
Micro-controller code without using IoT, IoT version will be given if asked.
void setup()
{
  pinMode(A0, INPUT);
  pinMode(13, INPUT);
  pinMode(12, INPUT);
  pinMode(11, INPUT);
  
  Serial.begin(9600);
  
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  
}

void loop()
{
  Serial.println(analogRead(A0));
  if(analogRead(A0)>500){
    if(digitalRead(13)==1) {
      digitalWrite(4, HIGH);
    }
    else{
      digitalWrite(4, LOW);
    }
    if(digitalRead(12)==1)
    {
      digitalWrite(3, HIGH);
    } 
    else{
      digitalWrite(3, LOW);
    }
    
    if(digitalRead(11)==1) {
      digitalWrite(2, HIGH);
    }
    else {
      digitalWrite(2, LOW);
    }
  }
  else{
    digitalWrite(2, LOW);
    digitalWrite(3, LOW);
    digitalWrite(4, LOW);
  }
  
  delay(10);
}
    

Credits

Comments