Get a quote

Automatic Street Light Using LDR: How the Circuit Works and How Real Ones Do It

How an automatic street light project works: LDR, transistor and relay circuit, threshold and hysteresis, motion sensing, and how real street lights use photocells and smart controllers.

Key points

  • An automatic street light switches on when it gets dark, using a light sensor such as an LDR (light dependent resistor).
  • The classic project circuit uses an LDR in a voltage divider, a transistor or comparator, and a relay or MOSFET to switch the lamp.
  • Real street lights add hysteresis and a delay so headlights and lightning do not switch them, and often add dimming schedules.
  • Solar street lights detect dusk from the panel voltage, so they need no separate light sensor.

“Automatic street light using LDR” is one of the most popular electronics projects for students. It is also a simple model of something every city depends on: lights that switch themselves on at dusk and off at dawn. This guide explains the project circuit and then how real street lights do the same job reliably for years.

The idea

  1. A sensor measures how bright it is
  2. A circuit compares that with a set level
  3. When it is darker than the set level, a switch turns the lamp on
  4. When it is brighter, the switch turns it off

The project circuit

Part Role
LDR (light dependent resistor) Resistance falls in light, rises in darkness
Fixed resistor or potentiometer Forms a voltage divider with the LDR; the pot sets the threshold
Transistor (e.g. BC547) or comparator (LM358 / LM393) Turns on when the divider voltage crosses the threshold
Relay or MOSFET Switches the lamp or LED strip
Diode across the relay coil Protects the transistor from voltage spikes
LED lamp and power supply The “street light”

How it works: in daylight the LDR’s resistance is low, so the divider voltage keeps the transistor off. At dusk the resistance rises, the voltage at the transistor base or comparator input crosses the threshold, and the transistor switches on the relay, which lights the lamp.

Making it behave like a real light

A bare LDR circuit has problems:

  • Flicker at dusk: light level hovers around the threshold, so the lamp switches on and off
  • Headlights and lightning: a flash at night turns the lamp off for a moment
  • Own light: the lamp lights the sensor and switches itself off

Fixes used in real products:

Problem Fix
Flicker at threshold Hysteresis: switch on at a lower light level than switch off (a Schmitt trigger or comparator with feedback)
Flashes Time delay of a few seconds to a minute
Own light Sensor facing the sky, shielded from the lamp

Adding motion sensing

Many projects add a PIR sensor so the light dims when no one is around and brightens when someone passes. In real street lights this is called adaptive or motion dimming, widely used on solar street lights to save battery. See our motion sensor guide for the energy savings.

Using a microcontroller

With an Arduino or similar board, the LDR feeds an analogue input. The program can:

  • Average readings to ignore flashes
  • Apply different on and off thresholds
  • Dim the lamp with PWM after a set time
  • Log light levels and switching times

This is close to how modern street light controllers work, with a clock and dimming schedule added.

How real street lights switch

Method How it works Where used
Photocell on each light Photodiode, delay and relay in a twist-lock unit on top Most street lights
Photocell on a circuit One sensor switches a contactor for a whole street Older networks
Astronomical timer Calculates sunset and sunrise for the location Cabinets, controllers
Smart controller Photocell plus clock, dimming and remote control Smart city systems
Solar controller Panel voltage tells when it is dark Solar street lights

Real photocells plug into a NEMA socket on top of the luminaire. Smart controllers use the same 7-pin socket and add dimming, fault reporting and scheduling; see LED street light dimming controls and smart streetlights.

How solar street lights detect dusk

A solar street light needs no separate sensor: when the panel voltage falls below a threshold at dusk, the controller turns the LED on; when it rises in the morning, it turns off. That is why a solar light placed under a bright street light may stay off. Our all-in-one solar street lights use this light control with motion sensing.

Safety for student projects

  • Use low-voltage LED lamps and power supplies for projects
  • Do not switch mains voltage without proper training, enclosures and fuses
  • Use a relay rated for the load
  • Add a diode across relay coils

Extending the project

  • Add a real-time clock to dim at midnight
  • Measure energy with a current sensor
  • Send status over Wi-Fi or LoRa to a dashboard
  • Power it from a small solar panel and battery with a charge controller

These steps turn a classroom circuit into a small model of a smart solar street light.

From project to product

Real street lights must survive 10–20 years outdoors, so the control circuit is only a small part. Drivers, surge protection, sealing and optics matter more for reliability. For what is inside a real luminaire, see our modular LED street lights and their specification.

Choosing the switching level

Real photocells switch on at around 10–50 lux and off at a higher level, often about twice the on level. Lower switch-on levels save energy but leave streets darker at dusk; utilities choose a level to balance safety and cost. In a project, the potentiometer in the divider sets this level: adjust it at dusk until the lamp switches on at the light level you want.

For educators and municipalities

We are happy to share sample specifications and photos of real controllers and photocells for teaching. Municipalities planning automatic or smart switching can send us their network details, and we will suggest compatible luminaires and controllers.

Sources

  1. ANSI C136.10 — Locking-type photocontrol devices (NEMA)
  2. BlueGreen OE — LED street light dimming controls

Frequently asked questions

How does an automatic street light work?

A light sensor measures daylight. When the light level falls below a threshold at dusk, a switch turns the lamp on; when daylight rises above a higher threshold at dawn, it turns the lamp off. Real systems add a delay so passing car lights do not trigger it.

What is an LDR in a street light circuit?

A light dependent resistor, whose resistance falls as light increases. In a voltage divider with a fixed resistor, it produces a voltage that changes with light level, which a transistor or comparator uses to switch the lamp.

Do real street lights use LDRs?

Older photocells used cadmium sulphide LDRs; modern ones mostly use photodiodes or phototransistors. Many street lights now use smart controllers or astronomical timers that switch at calculated sunset and sunrise times.

Have a project?

Ask our engineers

Send us your site details and we will size the system and quote it.

We reply by email within one working day (China time, GMT+8). Your details are only used to answer this inquiry. Prefer chat? Message us on WhatsApp. Have more detail to give? Use the full form.

Related guides