Tech News

Technology 2: How to Make an Automatic Night Light

10 min read · 14 October 2026
Illustration for the article “Technology 2: How to Make an Automatic Night Light”

You can make an automatic night light by connecting an LED to a light sensor: it will turn on in the dark and off in the light. An LED, a sensor, and a safe power source are all you need.

This kind of night light saves you from searching for a switch at night and helps prevent the light from being left on during the day. This article explains how the circuit works and what to keep in mind when assembling it.

Choosing how to test the night light
Stage What to check Criterion
Assembly on a breadboard Photoresistor placement and connections The sensor is not illuminated by its own LED
Power check Component voltage and polarity The power source is low-voltage and compatible with the circuit
Threshold adjustment Response when the sensor is shaded It switches on under the chosen dark conditions
Cycle test Transitions between light and dark No flickering or false triggering
  • December 11, 2008 date of the W3C WCAG 2.0 recommendations
  • 3 levels WCAG 2.0 conformance levels: A, AA, and AAA

What do you need for an automatic night light?

An automatic night light requires a low-voltage DC power source, an LED, a photoresistor, resistors, and a breadboard with jumper wires. Choose a power source that is compatible with the LED and circuit: check the voltage and polarity against the component markings and documentation.

Components and power

A photoresistor changes its electrical resistance in response to ambient light; together with a standard resistor and an adjustable resistor, it helps set the threshold at which the LED switches on. The adjustable resistor lets you change the sensitivity after assembly—for example, to make it trigger when the room is dark rather than whenever the sensor is shaded.

A CD4060 LED night-light circuit can serve as a reference for arranging the lighting, but its automatic shutoff feature does not replace light-level control. Automatic lighting requires a photoresistor: it is what detects brightness, while the CD4060 in the circuit mentioned is associated with automatic shutoff.

Tools for testing

A breadboard and jumper wires let you check component placement and threshold behavior before soldering. Assemble the circuit on the board, adjust the variable resistor, and check whether the LED switches on when you darken the photoresistor.

  • Power: a low-voltage DC power source compatible with the LED and circuit.
  • Sensor and adjustment: a photoresistor, a resistor, and an adjustable resistor.
  • Testing: a breadboard and jumper wires; the CD4060 is a reference for a night light, not a replacement for a light sensor.

How do you assemble a low-voltage photoresistor circuit?

Assemble the low-voltage night-light circuit on a breadboard and power it from an isolated DC source: the photoresistor and a resistor form a voltage divider, whose output controls the LED. Never connect a breadboard to 230 V mains—use low-voltage power only.

Start with the voltage divider

Connect the photoresistor and resistor in series, and take the voltage from the point between them: as the light level changes, the photoresistor’s resistance changes, which in turn changes the voltage at that point. Connect it to the control element in your chosen circuit; the specific pinout depends on the component and the connections.

Then add the LED

The control element should switch on the LED at the desired light level. Put a current-limiting resistor in series with the LED, choosing its value based on the LED’s specifications and the supply voltage; without one, the current may be excessive.

  • Power source: isolated low-voltage DC power only, not 230 V mains.
  • Control: the voltage from the divider goes to a control element; its connections depend on the components you choose.
  • LED protection: select a series resistor based on the LED’s specifications and the source voltage.

How do you set the dusk activation threshold?

Set the night light’s activation threshold with the adjustable resistor: point the photoresistor toward the ambient light, switch on the power, and turn the control until the lamp comes on at the desired level of darkness. Position the sensor so it is not exposed to light from the night light itself; otherwise, the lamp may affect the photoresistor’s readings after switching on.

  1. Check the threshold gradually: shade the photoresistor and note when the night light switches on. Then expose the sensor to light and make sure the lamp switches off.

  2. If the night light repeatedly switches on and off when the ambient light is near the threshold, first move the photoresistor somewhere the lamp’s light cannot affect it. If that is not enough, add hysteresis to the circuit—the difference between the light level that switches the lamp on and the level that switches it off.

A circuit with a light sensor and adjustable resistor lets you tailor the activation point to the installation location, but you will need to test it there to find the right setting. There is no fixed threshold value: adjust it for the desired activation point, then test both states again—darkness and the return of light.

How do you test the circuit before installing it in an enclosure?

Before installing the automatic night light in an enclosure, check the polarity of the LED and electrolytic capacitors, make sure there are no short circuits, and confirm that the supply voltage is within the components’ ratings. Assemble the circuit on a breadboard for testing: it is easier to inspect the leads and fix connections while they are accessible.

Check the LED’s polarity against the markings on its body or the documentation for that component; on an electrolytic capacitor, locate the marking for the negative lead. Then check that sections of the circuit that should be separate are not connected directly, and compare the power supply’s output voltage with the permitted values for the installed components.

Test the photoresistor separately from the LED: cover the sensor without shading the lamp, and see whether the night light’s behavior changes. If the LED illuminates the photoresistor, the circuit may react to its own light rather than just the room lighting. Run the “light–dark” cycle several times and make sure the night light switches as expected and that the wires and components on the breadboard stay in place. Install the circuit in an enclosure only after these checks.

When might this kind of night light work poorly or be unsafe?

An automatic night light works poorly if its photoresistor reacts to its own LED: the circuit may switch off, turn back on, and repeat the cycle. Two other common causes of problems are an incorrectly set activation threshold and an LED without a current-limiting resistor.

Common mistakes

A photoresistor pointed at the night light’s LED reads its light as a signal that the room has become bright. Once the light switches off, the sensor detects darkness again and turns the LED back on. Reposition or shield the sensor so it measures ambient light rather than light from the night light itself.

The threshold depends on the specific photoresistor, the resistors in the circuit, and the component placement. As a result, the same circuit may switch on at different light levels in different rooms; test it at the installation location and allow for threshold adjustment. A resistor connected in series with the LED limits the current: without one, the LED may fail.

Safe assembly limits

Use low-voltage power for a homemade night light; do not connect the circuit directly to 230 V mains. Check the following before switching it on:

  • Power: a low-voltage source, with no direct connection to 230 V mains.
  • LED: a current-limiting resistor connected in series.
  • Photoresistor: not pointed at the LED; threshold tested in the room where it will be installed.

How can you make a night light comfortable for people with different vision needs?

An automatic night light can work well for people with different vision needs if it helps them find their way without glaring or lighting up the whole room. Choose a diffuser and place the light source below eye level so the LED does not shine directly into the eyes.

Adjust the brightness so you can make out the way and nearby objects in the dark, but the night light does not replace the main light. Test it in the usual setting: it should help with orientation without making it harder for your eyes to adjust to the dark.

WCAG is a point of reference, not a standard for night lights

The W3C WCAG 2.0 recommendations are dated December 11, 2008, and concern web content accessibility, not electrical engineering or night-light design. W3C defines three WCAG 2.0 conformance levels: A, AA, and AAA. For a night light, this is only a general reminder to consider different needs, not a product certification.

Frequently asked questions

Can I power a night light from USB?
Yes, if the USB voltage is compatible with the components you have chosen and the circuit is designed for it. Check the LED and control element specifications before connecting them.
Why does the night light flicker at dusk?
The photoresistor may be exposed to light from the LED itself, or the threshold may be set too close to the current light level. Point the sensor away from the lamp and readjust the variable resistor.
Will a CD4060 circuit work?
The circuit title “LED Night Light with Automatic Shutoff (CD4060)” indicates an automatic shutoff feature, but that alone does not confirm photoresistor-based control. To switch on in the dark, you need a circuit in which a light sensor controls the LED.
Can I assemble a night light without soldering?
For initial testing, use a breadboard and wires, observing the LED’s polarity and using low-voltage power. For permanent use, connections must be securely fastened and insulated.

Sources

  • radiostorage.net — “LED Night Light with Automatic Shutoff (CD4060)”
  • wsem.ru — “Automatic Gates with Integrated Light Switching”
  • 7ft.ru — “Feton 2 Emergency Lighting Fixtures with Automatic Switching and автономous Power, 13.851.07 7ft.ru”
  • pozhtehprom.com — “Fire Suppression Systems with Automatic Activation: How They Work”
  • sagent.ru — “Compact Mini Voice Recorders with Automatic Activation [by Sound Sensor]”