Smart Street Lighting

Introduction: Smart Street Lighting

The concept is simple, whenever a vehicle passes the light above it and the in front of it starts to glow. As the vehicle moves forward the previous lights switches off. Hence saving power.

The IR sensor detects the vehicle and switches on the LED. I have used Arduino uno for controlling LED's.

*Do not use a black vehicle, the IR sensor won't work.

*I have make the model with 3 sensor and 4 LED. Larger model can be made using same method and few modification in code.

Step 1: Material Required

1. Cardboard, wood etc for road.

2. Arduino

3. breadboard

4. 3x IR sensor (with digital output)

5. 4x High light LED

6. connecting wires

7. straws (to elevate LED's)

Step 2: Design

Make a elevated road so you can make connections easily. See the images as an example.

Attach the 3 IR sensor on the road. Set the IR sonsors so that they cover the whole road. maintain the distance between the sensor as required.

With the IR sensor stick a straw and insert the LED at one end and wires coming from the other end.

Step 3: Connections

The LED have two ends. Connect all the LED's negative ends to ground. and the positive ends to arduino pins 4,5,6,7 resp.

For the IR sensor we have three ends. Connect all the power pin of sensor (Vcc) to arduino power and gnd to arduino Gnd. Connect the output pin of IR sensor to pin 0,1,2 resp.

*the given circuit diagram is for a single set of LED and sensor. Others are to be connected in same manner.

*make a common GND for LED and IR sensor.

Step 4: Coding

If you are using more than 3 sensor and 4 LED than you need to slightly change the code.

Download the code and upload it to your Arduino.

Step 5: Testing

I recommend to watch the video given first to understand the working.

Now everything is ready. Check the following :

--> Sensor 1 - LED 1 & 2 is on

--> When sensor 2 is activated - LED 1 turns off, 2 & 3 turns on.

--> When sensor 3 is activated - LED 2 turns off, 3 & 4 turns on for 2 second.

You can hold the last led if you add a 4th sensor. Also you can increase the delay time as required.

First Time Author Contest

Participated in the
First Time Author Contest

Be the First to Share

    Recommendations

    • Puzzles Speed Challenge

      Puzzles Speed Challenge
    • "Can't Touch This" Family Contest

      "Can't Touch This" Family Contest
    • CNC Contest 2020

      CNC Contest 2020

    23 Discussions

    0
    AclaroP
    AclaroP

    2 years ago

    Can I subtitute the LED to a relay ??

    0
    NarendraJ5
    NarendraJ5

    2 years ago

    I have also made it but my 1 and 2 led glow as I power the arduino and always after the forth led turn off both less glow what should I do to stop this

    0
    Sankalp Mahajan
    Sankalp Mahajan

    Reply 2 years ago

    In the code change the first if statement to - t1==1

    0
    tejaswip
    tejaswip

    2 years ago

    Nice ............very useful for us

    0
    Mudit5246
    Mudit5246

    3 years ago

    There no arduni code from where i have to download it

    0
    Hutch Fix It
    Hutch Fix It

    4 years ago

    Neat idea but what happens if the car turns off before it gets to the next light switch? Is there a timer to turn off the light?

    0
    Sankalp Mahajan
    Sankalp Mahajan

    Reply 4 years ago on Introduction

    The lights turn off only when the next sensor is activated. if a car turns off, then the light will stay on till next sensor is hit.

    I have added a timer for light to last sensor only. this can we removed if we add a 4th sensor.

    This model is for a single car only. For high traffic we will need to use an array of IR sensor along the road.

    0
    Mudit5246
    Mudit5246

    Reply 3 years ago

    Bro please give me the code

    0
    Sankalp Mahajan
    Sankalp Mahajan

    Reply 3 years ago

    The code is given in step 4 above.

    0
    DionT2
    DionT2

    Reply 4 years ago

    How is array possible with high volume traffic ? I can't think of any other way for high volume traffic besides using multi thread, but it's kinda complicated. May you explain the array method ?

    0
    Sankalp Mahajan
    Sankalp Mahajan

    Reply 4 years ago

    Store the values of IR sensors output in an array. Like 1001010.....
    Then according to that you can define the output of leds.

    For example take the above circuit.. 3 IR and 4 leds..
    When IR output is :


    000 - no led

    101 - all 4 led on

    110 - first 3 led on

    And so on..

    You have to define each value so that there is margin of error. When you increase the number of sensors ie here for 3 led you use 8 IR then error would be reduced. More sensors = less error

    0
    DionT2
    DionT2

    Reply 4 years ago

    The problem with array i'm facing is that from your 'single car traffic code', you controlled the on off street lights by using ir sensors. Eg. 2nd and 3rd street light will turn on while 1st street light will turn off when ir sensor 2 activated. But the case with more than 1 car is different. Imagine if there are 2 cars in region 1, the 1st and 2nd led will turn on, but if one of the cars drive faster and passes through ir sensor 2, the 1st street light is off, regardless of there are still cars there.

    0
    Sankalp Mahajan
    Sankalp Mahajan

    Reply 4 years ago

    car at sensor 1, IR output will be 100. led 1 and 2 will be on.

    now a second car passes at sensor 2, IR output will be 110. led 1,2 and 3 will glow.

    You will have to change the code completely.

    0
    DionT2
    DionT2

    Reply 4 years ago

    I'm doing the same project, but when 2 cars pass by the different ir sensors AT THE SAME TIME, the whole program and circuit is not working.

    0
    PralhadK3
    PralhadK3

    3 years ago

    What is the power of LED that you have used?

    0
    Sankalp Mahajan
    Sankalp Mahajan

    Reply 3 years ago

    I don't know the power of the led, but they are directly connected to 5v of the arduino.

    0
    AbhigyanR1
    AbhigyanR1

    3 years ago

    Pls. Apload the picture of arduino in complete connections. I can not understand by the written part as I am a middle school boy. Pls. help me.

    0
    rishi1794
    rishi1794

    4 years ago

    when a car will be coming at a speed of 80 kmph , it will pass the street in a blink of ab eye before even sensors can respond.

    0
    AshAlexsius
    AshAlexsius

    4 years ago

    how to power up all 3 IR sensors. Only one Sensor gets activated and the remaining 2 dont function.