Stephen
Published © GPL3+

iStreet Light

A street light/lamp that efficiently (saves energy) manages electricity usage.

IntermediateWork in progress12 hours1,027
iStreet Light

Things used in this project

Hardware components

WIZnet W6100 Ethernet Shield
×1
Arduino Mega 2560 & Genuino Mega 2560
Arduino Mega 2560 & Genuino Mega 2560
×1
IR Range Sensor
Digilent IR Range Sensor
×2
5 mm LED: Red
5 mm LED: Red
×2
Ultrasonic Sensor - HC-SR04
SparkFun Ultrasonic Sensor - HC-SR04
×2
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1
Breadboard (generic)
Breadboard (generic)
×2
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LDR, 5 Mohm
LDR, 5 Mohm
×1
Proximity Sensor
Proximity Sensor
×1

Software apps and online services

Arduino IDE
Arduino IDE
Arduino Web Editor
Arduino Web Editor

Story

Read more

Schematics

circuit diagram

uploads2ftmp2ff3c3ff98-c97c-45ca-b0d7-75c819b80d692fistreetlight_QGxp38prtd.PNG

Code

IR module

Arduino
int ir1=2;
int ir2=3;
int ir3=4;
int ir4=5;

int led1=6;
int led2=7;
int led3=8;
int led4=9;
int led5=10;
int led6=11;

int proxy1=0;
int proxy2=0;
int proxy3=0;
int proxy4=0;
void setup() 
{
  pinMode(ir1,INPUT);
  pinMode(ir2,INPUT);
  pinMode(ir3,INPUT);
  pinMode(ir4,INPUT);

  pinMode(led1,OUTPUT);
  pinMode(led2,OUTPUT);
  pinMode(led3,OUTPUT);
  pinMode(led4,OUTPUT);
  pinMode(led5,OUTPUT);
  pinMode(led6,OUTPUT);
}


void loop(){
  proxy1=digitalRead(ir1);
  proxy2=digitalRead(ir2);
  proxy3=digitalRead(ir3);
  proxy4=digitalRead(ir4);

if(proxy1==HIGH)
{
  digitalWrite(led1,HIGH);
  digitalWrite(led2,HIGH);
  digitalWrite(led3,HIGH);
}
else
{
  digitalWrite(led1,LOW);
  digitalWrite(led2,LOW);
  digitalWrite(led3,LOW);
}

if(proxy2==HIGH)
{
  digitalWrite(led2,HIGH);
  digitalWrite(led3,HIGH);
  digitalWrite(led4,HIGH);
}
else
{
  digitalWrite(led2,LOW);
  digitalWrite(led3,LOW);
  digitalWrite(led4,LOW);
}

if(proxy3==HIGH)
{
  digitalWrite(led3,HIGH);
  digitalWrite(led4,HIGH);
  digitalWrite(led5,HIGH);
}
else
{
  digitalWrite(led3,LOW);
  digitalWrite(led4,LOW);
  digitalWrite(led5,LOW);
}

if(proxy4==HIGH)
{
  digitalWrite(led4,HIGH);
  digitalWrite(led5,HIGH);
  digitalWrite(led6,HIGH);
}
else
{
  digitalWrite(led4,LOW);
  digitalWrite(led5,LOW);
  digitalWrite(led6,LOW);
}
}

LDR Module

Arduino
#include<SoftwareSerial.h>
int sensorPin=A0;
int sensorValue = 0;
int led = 3;
void setup() {
 pinMode(led, OUTPUT);
 Serial.begin(9600);
}
void loop() {
 sensorValue = analogRead(sensorPin);
 Serial.println(sensorValue);
 if(sensorValue < 100)
 {
   Serial.println("LED light on");
   digitalWrite(led,HIGH);
   delay(1000);
 }
 digitalWrite(led,LOW);
 delay(sensorValue);
}

Credits

Stephen

Stephen

1 project • 1 follower

Comments

Add projectSign up / Login