• Skip to main content
  • Skip to primary sidebar

Homemade Circuit Projects

Get free circuit help 24/7

New Projects | Privacy Policy | About us | Contact | Disclaimer | Copyright | Videos | Circuits for Beginners | Basic Circuits | Hobby Projects | Transistor Circuits | LED Drivers 

You are here: Home / Arduino Engineering Projects / Automatic Street Light Dimmer Circuit

Automatic Street Light Dimmer Circuit

Last Updated on March 18, 2019 by Swagatam

caution electricity can be dangerous

In this post we are going 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.

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

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.  Car Reverse Parking Sensor Circuit with Alarm
  • 2.  Monitoring State of a Switch (Digital Read Serial) – Arduino Basics
  • 3.  Arduino Pure Sine Wave Inverter Circuit with Full Program Code
  • 4.  SMS Based Pump Controller with Automatic Dry Run Shut Off
  • 5.  Digital Capacitance Meter Circuit Using Arduino
  • 6.  Ultrasonic Fuel Level Indicator Circuit

About Swagatam

I am an electronic engineer (dipIETE ), hobbyist, inventor, schematic/PCB designer, manufacturer. I am also the founder of the website: https://www.homemade-circuits.com/, where I love sharing my innovative circuit ideas and tutorials.
If you have any circuit related query, you may interact through comments, I'll be most happy to help!

Reader Interactions

Comments

  1. Shubham singh says

    September 16, 2018

    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

    • Swagatam says

      September 16, 2018

      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.

  2. NATARAJ ADITHYA says

    August 23, 2018

    shall we do it in proteus simulation for this arduino code

Primary Sidebar

Calculators

  • 3-Phase Power (15)
  • 324 IC Circuits (19)
  • 4017 IC Circuits (52)
  • 4060 IC Circuits (25)
  • 555 IC Circuits (98)
  • 741 IC Circuits (19)
  • Arduino Engineering Projects (83)
  • Audio and Amplifier Projects (114)
  • Battery Chargers (82)
  • Car and Motorcycle (94)
  • Datasheets (46)
  • Decorative Lighting (Diwali, Christmas) (33)
  • Electronic Components (100)
  • Electronic Devices and Circuit Theory (36)
  • Electronics Tutorial (116)
  • Fish Aquarium (5)
  • Free Energy (34)
  • Fun Projects (13)
  • GSM Projects (9)
  • Health Related (20)
  • Heater Controllers (29)
  • Home Electrical Circuits (102)
  • How to Articles (20)
  • Incubator Related (6)
  • Industrial Electronics (28)
  • Infrared (IR) (40)
  • Inverter Circuits (98)
  • Laser Projects (12)
  • LED and Light Effect (93)
  • LM317/LM338 (21)
  • LM3915 IC (25)
  • Meters and Testers (65)
  • Mini Projects (148)
  • Motor Controller (67)
  • MPPT (7)
  • Oscillator Circuits (26)
  • PIR (Passive Infrared) (8)
  • Power Electronics (34)
  • Power Supply Circuits (77)
  • Radio Circuits (10)
  • Remote Control (48)
  • Security and Alarm (61)
  • Sensors and Detectors (120)
  • SG3525 IC (5)
  • Simple Circuits (75)
  • SMPS (29)
  • Solar Controllers (60)
  • Timer and Delay Relay (53)
  • TL494 IC (5)
  • Transformerless Power Supply (8)
  • Transmitter Circuits (40)
  • Ultrasonic Projects (16)
  • Water Level Controller (45)

Calculators

  • AWG to Millimeter Converter
  • 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
  • Small Signal Transistor(BJT) and Diode Quick Datasheet
  • Transistor Astable Calculator
  • Transistor base Resistor Calculator
  • Voltage Divider Calculator
  • Wire Current Calculator
  • Zener Diode Calculator

© 2023 · Swagatam Innovations