• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Need circuit help? Post them in the comments! I've answered over 50,000!

Blog | Categories | About | Contact | Calculators-online
You are here: Home / Arduino Projects / Automatic Street Light Dimmer Circuit

Automatic Street Light Dimmer Circuit

Last Updated on December 5, 2024 by Swagatam 3 Comments

In this post I will show how to construct an Arduino automatic street light dimmer circuit, which can reduce its brightness when no vehicle is passing in the road to save power.

Table of Contents
  • Overview
  • Circuit Operation
  • Setup Diagram
  • Program Code:

By 

Overview

We will be exploring the methodology of sensing the vehicle or human being without false detection which may occur due to animals and also the protocol for dimming light without wasting energy.

Street lights help the vehicles to guide along the road, but during late night hours, most of the roads will be empty and still all the street lights illuminate till morning.

Due to the illumination of street lights all night even when the road is empty, it is not worth to light the street lamps and the cost due to energy consumption  directly affect the local government.

To overcome this issue in smart way, we can reduce the brightness of the street lamps to desire level and only illuminate in full brightness when vehicles or human being pass by.

This may help the government to reduce expenditure on power and also save lot of energy which could be used for other energy demanding purposes.

The proposed idea to detect activity on the road, utilizes ultrasonic sensor which can measure the distance between the sensor and the obstacle, in this case the obstacles are vehicles or human beings.

When a vehicle comes into the range of the sensor, it does some mathematical calculations to determine the distance between the vehicles and sensor, if the vehicle is confirmed to be below the pre-determined range; the on-board microcontroller will light the street lamp at maximum brightness.

The street light will illuminate at maximum brightness for a pre-determined amount of time and reduce its brightness if no vehicles or human beings are detected further.

By now the objective of this project would have cleared. Let’s dive into circuitry of the proposed setup.

Circuit Operation

warning message: electricity is dangerous, proceed with caution
Automatic Street Light Dimmer Circuit

The automatic street light dimmer circuit consist of Arduino which is the brain of the project, an ultrasonic sensor for detecting vehicles or human beings. A 9V regulator is provided for powering the arduino microcontroller board and a MOSFET for driving the LEDs which consumes few amperes at peak brightness.

The LED module and power supply for the setup must be selected carefully so that there will be adequate power available for the whole circuit and does not overload the power supply.

The LED module can be homemade one which is shown in schematic or may be purchased for market, but before constructing or getting one form market make sure to calculate the voltage and current requirements for the power supply.

The power supply may be an SMPS or constructed using transformer, rectifier and voltage regulator.

The LED reduces its brightness by using PWM. The PWM is square wave, it turns on and off supply to LED rapidly with well determined on and off width in a single cycle. The width of the on and off time determine the brightness of the LED.

When the street light switches to full brightness the supply to LED will have no pulses and steady DC will be supplied.

The whole setup can be implemented as shown below:

Setup Diagram

ultrasonic sensor is elevated around 3.5ft to 4ft above the ground-

The ultrasonic sensor is elevated around 3.5ft to 4ft above the ground; this is done so that it only detects vehicles and human beings, since their average height is around the same and when dogs or cats or any other animals which usually roam around the city will not trigger the street light to maximum brightness.

The animals which live and roam around the city are below 3.5ft tall.

The sensor height may be adjusted to operate at optimum level as described in the above picture.

The threshold distance can be controlled in the program.

When the Arduino detects the obstacle detected below pre-determined distance the LED lights go peak brightness.

Program Code:

//--------------------Program developed by R.Girish-------------------//
const int trigger = A1;
const int echo = A2;
int vcc = A0;
int gnd = A3;
int LED = 3;
long Time;
float distanceCM;
float distanceM;
float distance = 100; // set threshold distance in cm
int dim = 28; // adjust minimum brightness
int bright = 255; // adjust maximum brightness
float resultCM;
float resultM;
void setup()
{
pinMode(LED,OUTPUT);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
pinMode(vcc,OUTPUT);
pinMode(gnd,OUTPUT);
Serial.begin(9600);
}
void loop()
{
digitalWrite(vcc,HIGH);
digitalWrite(gnd,LOW);
digitalWrite(trigger,LOW);
delay(1);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
Time=pulseIn(echo,HIGH);
distanceCM=Time*0.034;
resultCM=distanceCM/2;
resultM=resultCM/100;
Serial.print("Distance in cm: ");
Serial.println(resultCM);
Serial.print("Distance in meter: ");
Serial.println(resultM);
Serial.println("------------------------------------------");
if(resultCM<=distance)
{
analogWrite(LED, bright);
delay(10000);
}
if(resultCM>=distance)
{
analogWrite(LED,dim);
}
delay(100);
}
//-----------------Program developed by R.Girish-------------------//

NOTE:

• The threshold distance can be adjusted by replacing the Value with your own.

float distance = 100; // set threshold distance in cm

The value must be entered in centimetre; the maximum value can be 400 to 500 cm or 4 to 5 meter.

• The dimming of the light can be adjusted by using

int dim = 28; // adjust minimum brightness

255 is maximum brightness 0 is lights off.

We can also witness the distance between the sensor and the obstacle in serial monitor.

distance between the sensor and the obstacle in serial monitor

If you have any further questions regarding this Arduino based automatic street light dimmer circuit feel free to ask in comment section.

You'll also like:

  • 1.  Wireless Servo Motor Control Using 2.4 GHz communication link
  • 2.  Types of Arduino Boards with Specifications
  • 3.  Buck Converter Circuit Using Arduino
  • 4.  Line Follower Robot Circuit without Microcontroller or Arduino
  • 5.  Arduino Frequency Meter Using 16×2 Display
  • 6.  Transformerless AC Voltmeter Circuit Using Arduino

About Swagatam

I am an electronics engineer with over 15 years of hands-on experience. I am passionate about inventing, designing electronic circuits and PCBs, and helping hobbyists bring their projects to life. That is why I founded homemade-circuits.com, a website where I share innovative circuit ideas and tutorials. Have a circuit related question? Leave a comment.... I guarantee a reply!

Previous Post: « Induction Heater for Labs and Shops
Next Post: Timer Controlled Fitness Gym Application Circuit »

Reader Interactions

Comments

  1. Shubham singh says

    September 16, 2018 at 7:28 pm

    Hello my name is Shubham singh and i am also making the same project in my school.
    But we are using LDR andLASER in the place of ultrasonic sensor that you have used. So,might you provide me Arduino codind for that. I am not good at coding. So your help let us to make the project.
    Please reply soon. Thak you

    Reply
    • Swagatam says

      September 16, 2018 at 8:24 pm

      Hello Shubham, sorry I am also not good with Arduino programming so I won’t be able to suggest, however if you want I can design your required circuit without Arduino more effectively.

      Reply
  2. NATARAJ ADITHYA says

    August 23, 2018 at 4:13 pm

    shall we do it in proteus simulation for this arduino code

    Reply

Need Help? Please Leave a Comment! We value your input—Kindly keep it relevant to the above topic! Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Subscribe to New Circuit Ideas

Categories

  • Arduino Projects (87)
  • Audio and Amplifier Projects (132)
  • Automation Projects (17)
  • Automobile Electronics (101)
  • Battery Charger Circuits (83)
  • Datasheets and Components (104)
  • Electronics Theory (143)
  • Free Energy (37)
  • Games and Sports Projects (11)
  • Grid and 3-Phase (19)
  • Health related Projects (25)
  • Home Electrical Circuits (12)
  • Indicator Circuits (14)
  • Inverter Circuits (87)
  • Lamps and Lights (142)
  • Meters and Testers (69)
  • Mini Projects (46)
  • Motor Controller (64)
  • Oscillator Circuits (27)
  • Pets and Pests (15)
  • Power Supply Circuits (108)
  • Remote Control Circuits (50)
  • Security and Alarm (64)
  • Sensors and Detectors (101)
  • Solar Controller Circuits (59)
  • Temperature Controllers (42)
  • Timer and Delay Relay (49)
  • Transmitter Circuits (29)
  • Voltage Control and Protection (37)
  • Water Controller (36)

Calculators

  • Battery Back up Time Calculator
  • Capacitance Reactance Calculator
  • IC 555 Astable Calculator
  • IC 555 Monostable Calculator
  • Inductance Calculator
  • LC Resonance Calculator
  • LM317, LM338, LM396 Calculator
  • Ohm’s Law Calculator
  • Phase Angle Phase Shift Calculator
  • Power Factor (PF) Calculator
  • Reactance Calculator
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator
  • Filter Capacitor Calculator
  • Buck Converter Calculator
  • Boost Converter Calculator
  • Solar Panel, Inverter, Battery Calculator
  • Wire Current Calculator
  • SMPS Transformer Calculator
  • IC SG3525, SG3524 Calculator
  • Inverter LC Filter Calculator

People Also Search

555 Circuits | 741 Circuits | LM324 Circuits | LM338 Circuits | 4017 Circuits | Ultrasonic Projects | SMPS Projects | Christmas Projects | MOSFETs | Radio Circuits | Laser Circuits | PIR Projects |

Recent Comments

  • Swagatam on Adjustable 0-100V 50 Amp SMPS Circuit
  • ibrahim on Adjustable 0-100V 50 Amp SMPS Circuit
  • Swagatam on Contact
  • KRAB Babu on Contact
  • Swagatam on How Shunt Regulator TL431 Works, Datasheet, Application

Company

  • Privacy Policy
  • Cookie Policy
  • About Me
  • Contact
  • Disclaimer
  • Copyright
  • Videos
  • Sitemap

Social Profiles

  • Twitter
  • YouTube
  • Instagram
  • Pinterest
  • My Facebook-Page
  • Quora
  • Stack Exchange
  • Linkedin
  • © 2025 · Swagatam Innovations