Lights and Display Board Circuits

Street Lights that Glow on Detecting Vehicle Movement

Typically, street lights are turned on for the entire night and then turned off during the day. However, if there is no traffic at night, street lights are not required. Energy conservation is a critical element these days, as energy resources are depleting at an alarming rate.

Natural resource alternatives are scarce, and our future generations may confront numerous issues as a result of a lack of these resources. In a previous post, we looked at the circuit diagram and how it works for the Auto Intensity Control of Street Lights circuit. This article discusses the circuit that detects vehicle movement and turns off the street lights after a set amount of time.


  • Construction and Output Video
  • Street Lights that Glow on Detecting Vehicle Movement (using AVR Microcontroller)
    • Principle Behind this Circuit
    • Circuit Diagram 
    •  Circuit Components
    • Circuit Design
    • How to Operate this Circuit?
  • Street Light That Glows on Detecting Vehicle Movement Using 8051 and IR sensor
    • Circuit Diagram
    • Components
      • Microcontroller Section
      • IR Transmitter and Receiver Section
      • Load Section
    • Principle of Operation
    • Circuit Design
    • Working
    • Applications
    • Advantages

Construction and Output Video

Street Lights that Glow on Detecting Vehicle Movement (using AVR Microcontroller)

Principle Behind this Circuit

The suggested system includes an Atmega8 microprocessor, an LDR, a PIR sensor, and a real-time clock (RTC). This setup uses a light-dependent resistor and a PIR sensor to regulate the street lights.

On LDR, street lights are turned on based on the intensity of the Sun light. The resistance value of a light dependent resistor is high if the intensity of sunlight on it is low. When it is fully dark, this value rises and reaches a high level. This resistance value determines when the street lights must turn on.

The real time clock comes into play since the resistance value is highest at midnight. The controller determines when there is no traffic during peak hours and turns off the lights. When there is any vehicle on the road, it is detected by the PIR sensor.

Whenever PIR sensor is detected it just indicates the microcontroller to switch on the street lights. Then lights are switched on for 2 to 3 minutes and switched off automatically.

Another way to this approach is, one can maintain minimum intensity without completely switching off the lights by using PWM and switch them on to maximum intensity whenever it detects the vehicle. But in this article the circuit is designed in such a way that lights are completely switched OFF and will be switched ON only when there is any vehicle. 

Circuit Diagram 

 Circuit Components

  • ATmega8 microcontroller
  • DS1307 IC
  • PIR sensor
  • LDR
  • LCD
  • LED array

Circuit Design

The proposed circuit consists of ATmega8 microcontroller, PIR sensor, light dependent resistor and real time clock, Liquid Crystal Display.

Passive Infrared sensor, also called as PIR sensor is connected to the PD0 pin of the microcontroller. PIR sensor senses the motion of the objects.

Internally, the PIR sensor will include an IR detector. IR rays are emitted by every thing in the world. Electronic components can detect these, which are invisible to the naked eye. IR photons of various wavelengths will be emitted by various objects. The PIR sensor picked up on these beams. PIR is originally set to a high level, but over a period of time, it is automatically reduced to a low level. It goes low whenever it detects the motion of any object.

The LDR is linked to the microcontroller’s ADC pin – ADC0 because the LDR produces analogue values that the ADC converts to digital.

Resistors that are light dependent will have low resistance in the light and high resistance in the dark. In the dark, the resistance of a Light dependent resistor is in the ohm range, and in the dark, it is in the mega ohm range. The resistance of LDR is greatly reduced when light strikes on it.

The DS1307 is an I2C-compatible real-time clock IC. There are eight pins on a real-time clock. The crystal oscillator is linked to pins 1 and 2. A battery is connected to the third pin. The RTC’s 6th pin is connected to the microcontroller’s PC5 pin. The fifth pin is connected to the microcontroller’s PC4 pin.

I2C is inter integrated circuit. This is two wire interface protocol in which only two signals were used to transmit the data between two devices.

LCD is used for displaying time. LCD interfacing in 4bit mode is shown in the circuit diagram. Time from RTC is read and displayed on the LCD.

How to Operate this Circuit?

  1. To begin, turn on the circuit.
  2. The time read from the RTC is displayed on the LCD.
  3. Place the LDR in the dark. The street light has now been turned on.
  4. The time is now constantly checked by the microcontroller. Street lights are turned on according to pre-programmed times.
  5. They are turned off automatically after this time.
  6. Place your palm in front of the PIR sensor to turn on the street lights again, illustrating that the street lights are turned on when any item is detected.
  7. The lights are automatically turned off after a 2-3 second delay.

Street Light That Glows on Detecting Vehicle Movement Using 8051 and IR sensor

The above circuit shows the street light that glows on detecting vehicle movement using avr. Here is the circuit that uses 8051 and IR sensors.

Circuit Diagram


Microcontroller Section

    • AT89C52 Microcontroller
    • AT89C52 Programmer Board
    • 11.0592 MHz Quartz Crystal
    • 22pF Ceramic Capacitor
    • 2 x 10K Resistor
    • 10uF Electrolytic Capacitor
    • Push Button

IR Transmitter and Receiver Section

    • 8 x IR LED (IR Transmitters)
    • 8 x 470R Resistor
    • 8 x Photo Diode (IR Receivers)
    • 8 x 3.3K Resistor
    • 1K x 8 Resistor Pack

Load Section

    • 8 x 2N2222 NPN Transistors
    • 8 x 100R Resistor
    • 8 x White LEDs

Principle of Operation

The principle behind the working of the project lies in the functioning of IR Sensor. We are going to use a Transmissive type IR Sensor in this project.

In Transmissive IR Sensor, the IR transmitter and receiver are placed facing each other so that IR receiver always detects IR Rays emitted by the IR Transmitter.

If there is an obstacle between the IR Transmitter and Receiver, the IR Rays are blocked by the obstacle and the IR Receiver stops detecting the IR Rays.

This can be configured to turn ON or OFF the LEDs (or street lights) with the help of microcontroller. 

Circuit Design

The AT89C52 Microcontroller, IR Sensor (IR Transmitter and IR Receiver), and LEDs are the essential components of the project.

The 8051 Microcontroller requires three fundamental connections: crystal, reset, and external access.

The 8051 microcontroller requires an external clock to use the on-chip oscillator. A crystal oscillator provides this. Two 22pF ceramic capacitors are linked to an 11.0592MHz quartz crystal coupled to the XTAL1 and XTAL2 pins.

A 10K resistor, a 10uF capacitor, and a push button make up the microcontroller’s reset circuit. The circuit diagram shows all of the connections in the reset circuit.

External access is possible. When connected to ground, pin is utilised to access external memory. In any case, we won’t be using any external RAM. As a result, use a 10K resistor to connect this pin to Vcc.

The IR Receiver is the next piece of hardware we’ll connect. The 8 IR receivers will be connected to the microcontroller’s port 0 pins. External pullup resistors must be connected to the port 0 pins in order to use the PORT0 as an I/O port.

After that, connect the IR receiver’s output, i.e. the photo diode’s anode terminal, to port 0 pins. The photo diodes’ cathode terminals are connected to the power supply. Also connected between the anode terminal and ground is a 3.3k resistor.

The IR transmitter is the next component in the circuit. The IR transmitter is not connected to the microcontroller because its sole purpose is to continuously emit infrared rays.

As a result, connect the 8 IR transmitters to the 8 470 ohm current limiting resistors with a power supply.

Finally, the LEDs must be connected. With the use of transistors, we must connect the LEDs to the microcontroller’s PORT2. The base of the 8 2N2222 transistors is connected to the PORT 2 of the microcontroller while the emitters of the transistors are connected to ground.

An LED along with a series current limiting resistor of 100 ohms is connected to the each of the collector terminal of the transistor.


The goal of this project is to create a street light control system using an 8051 microcontroller that detects vehicle movement and automatically turns on or off the street lights. This page explains how the project works.
The project’s operation is depicted in the GIF below.

Street Lights

The IR transmitter is located in direct line of sight with the IR receiver, ensuring that the IR receiver receives infrared rays at all times. The microcontroller will detect Logic 1 once the IR receiver receives infrared light. The microcontroller will detect logic 0 if the infrared rays are obstructed in some way.

So, the microcontroller software must be designed in such a way that when it detects Logic 0, it will turn on the LEDs, which in this case implies the street lamp, and when it detects Logic 1, it will turn off the LEDs.

Consider the two IR sensors i.e. IR Transmitter and IR Receiver are placed on the either side of the road. As per the circuit diagram, the IR receivers are connected to the PORT0 and the LEDs are connected to the PORT2 of the microcontroller.

The IR receiver continually detects IR light transmitted by the IR Transmitter at first, when there is no impediment. When a car or other object blocks any of the IR sensors, the microcontroller immediately turns on the three LEDs.

If the car blocks the first IR sensor, the microcontroller turns on the first three LEDs. The next three LEDs will turn on as the automobile moves ahead and blocks the second IR sensor, while the first LED of the previous set will be turned off. This procedure is repeated for all IR Sensors and LEDs.


  • The street light control circuit can be used in normal roads, highways, express ways etc.
  • The project can also be used in parking areas of malls, hotels, industrial lighting, etc.


  • If the lighting system implements all LED lights, the cost of the maintenance can be reduced as the life span and durability of LEDs is higher than Neon based lights which are normally used as street lights.
  • As the lights are automatically turned ON or OFF, huge amount of energy can be saved.


Related Articles

Leave a Reply

Your email address will not be published.

Back to top button