This is only a preview of the February 2026 issue of Silicon Chip. You can view 35 of the 104 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "Mains LED Indicator":
Articles in this series:
Items relevant to "The Internet Radio, Part 1":
Items relevant to "Mains Hum Notch Filter":
Items relevant to "DCC Remote Controller":
Articles in this series:
Items relevant to "Tiny QR Code Reader":
Purchase a printed copy of this issue for $14.00. |
Mains Power
LED Indicator
Neon lamps can run from 230V AC with a simple series resistor but they’re pretty dim and
flickery. LEDs are much better, but you need this extra circuitry to run them directly from a
mains supply.
By Julian Edgar & John Clarke
T
here are many applications where
you want to run LEDs from mains
power; a pilot light near a switch
is the most common. There are numerous simple circuits available to do
this – typically they use just a resistor, diode and capacitor. However,
these circuits all have a major safety
problem: the LED is floating at mains
potential above Earth.
If it’s being run by one of those common circuits, a person touching the
outside of the LED’s plastic envelope
is relying on the dielectric strength
(insulation) of the plastic LED envelope to avoid getting a shock. That’s
why many commercial mains switches
have the LEDs mounted in bezels or
even hidden within the switch and
not accessible.
But what if you want the LED to
project through the faceplate of a
wall switch? No LED manufacturer
specifies the dielectric strength of the
LED’s plastic envelope, so there’s no
guarantee of safety.
Our simple and cheap circuit overcomes that problem. It allows the LED
to be operated from the mains, but the
LED is not floating at high and dangerous voltages. The LED’s current can
also be easily set. Also, unlike many
approaches that run LEDs off mains
power, this circuit protects against
surge over-current at switch-on, providing a long life.
This project is designed for use
with mains house wiring, so it must
be installed by an electrician.
How it came about
This circuit came about because, in
the house I am building, I am using
a 12V system to operate ventilation
hatches. These hatches are operated
by a DPDT switch triggering a linear actuator. There is a 10mm high-
intensity green LED on the wall switch
plate to indicate when the ventilation
hatch is open.
Testing showed this approach to be
very effective. The LED is visible from
many metres away, and because it projects through the switch plate, it can be
seen at quite acute angles.
To operate different systems, I am
also using mains power switches that
need pilot lights. In those cases, I was
originally using green neons, and the
contrast with the 10mm LEDs was
profound. To see if the neon was lit in
bright light, you needed to peer closely
at the bezel.
Even in dull conditions, the neon’s
brightness was borderline – only when
it was quite dark was the neon brightness adequate. Furthermore, it was
impossible to see the neon indicator at
any angle other than with the viewer
directly in front of the indicator.
What was needed was a way of running the same 10mm high-intensity
green LEDs as the 12V power indicators, but on mains power.
How it works
In the circuit diagram (Fig.1), capacitor C1 is the main voltage dropping
This shows a 10mm LED being driven
by the Mains Power LED Indicator. Unlike a
neon indicator, it is visible at acute angles and in
bright light.
28
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
The PCB needs to be mounted in an
IP65 enclosure with cable glands
used on the mains power and LED
connections. The length of the LED
leads depends on the application.
Table 1 – selecting capacitor C1
component that also limits current
through the LED.
Its capacitance provides an impedance at the mains frequency of 50Hz
that is 1 ÷ 2πfC, where f is the frequency and C is capacitance in farads. For a 100nF capacitor, this works
out to 31.8kW.
Ignoring the effect of the relatively
small series 1kW resistor, this limits
the mains current for a 230V AC supply to around 7mA. More LED current
is available with a larger capacitance
– refer to Table 1. The parallel 1MW
resistor discharges the capacitor when
the circuit is switched off.
The supply after the series capacitor
and 1kW resistor is full-wave rectified
by bridge rectifier BR1 and filtered to
a smooth voltage by the 470μF capacitor. Zener diode ZD1 limits the voltage
across the capacitor to 4.7V.
The 1kW 1W resistor is included
since, when power is initially connected to the circuit, the mains voltage could be anywhere in the voltage
swing of the 230V AC waveform (up
to ±325V DC). At initial power-on, the
discharged capacitor will briefly present a short circuit.
So, if the voltage is high at power
on, the capacitor charging current is
limited via the 1kW resistor. The zener
diode then conducts and prevents the
voltage rising much above its clamping voltage of 4.7V.
The initial surge current through
the zener diode could be as high as
325mA (325V ÷ 1kW). However, this
is only an instantaneous current for
the zener, and it can easily withstand
that briefly even though its rated maximum continuous current is 212mA
for its 1W rating.
The LED is protected against surge
over-current by being driven via the
150W resistor across the DC supply,
that in turn is limited in voltage by
the zener diode.
Under normal conditions, ZD1 does
not conduct. This is because, even
when using the largest capacitor value
LED current
Capacitor C1 value
1.4mA
22nF
3mA
47nF
6.4mA
100nF
9.5mA
150nF
13.7mA
220nF
for C1 at 220nF, the current through the
LED is 13.7mA and voltage across the
150W resistance is 2V. Adding this to
the voltage across the LED (typically
1.8V) gives a value less than the zener
voltage.
Therefore, the zener conducts only
when there is the potentially higher
current flow at power-up. Without the
zener diode and 150W resistor, the LED
surge current would be up to 325mA.
Assuming 1.8V across the LED, with
this circuit, the maximum LED current
is limited to 19.3mA when the zener
voltage is at 4.7V.
Taking this approach gives a long
LED life – something simpler circuits
often don’t provide.
We minimise the risk of electrocution by ensuring that the LED itself
is, at most, only a few volts above
mains Neutral. Mains Neutral is tied
to Earth on the household property,
so typically, it is within a few volts
of Earth.
1W resistors are used to achieve the
WARNING: MAINS VOLTAGE
Fig.1: capacitor C1 is the primary component that drops the mains voltage to the
1.8-3.6V needed to drive LED1. The AC is then rectified, with the surge current
at switch-on limited by the 1kW resistor and zener diode ZD1. Importantly, the
LED cathode is tied to mains Neutral via BR1 for safety. The small PCB (shown
adjacent) uses only a handful of components and is quickly assembled.
siliconchip.com.au
Australia's electronics magazine
This circuit operates at mains live
voltages. Do not build it unless
you are confident working with
mains-powered circuitry. Don’t
touch any part of the circuit when
it is connected to mains power.
Fixed wiring installation must be
performed by an electrician.
Fig.2: we have simulated the circuit using LTspice, and the simulation file is
available to download from siliconchip.au/Shop/6/3314
required mains voltage rating, since
¼W types may have a lower voltage
rating (eg, 150V).
An LTspice circuit simulation for
this project is available to download
from siliconchip.au/Shop/6/3314 in
case you want to see how it behaves
and check the LED current with different capacitor values (see Fig.2).
Construction
We have created a small PCB, coded
10111251, that measures 38 x 56mm
for this circuit. Its overlay diagram is
shown in Fig.3. Building it will take
just a few minutes. Fit the low-profile
components first (the resistors and the
zener diode), ensuring that the diode’s
cathode stripe faces as shown in Fig.3.
Next, install the electrolytic capacitor
and bridge rectifier, with both components inserted in the correct orientation as shown.
The terminal blocks can be installed
next, with the wire entries facing
towards the nearest edge of the PCB.
Finally, mount the large X2 capacitor.
The LED leads need to be connected
to CON2 using mains-rated wire.
Each lead needs to be insulated using
Parts List – Mains LED Indicator
1 double-sided PCB coded 10111251, 38 × 56mm
1 64 × 58 × 35mm IP65 polycarbonate enclosure
[Jaycar HB6120 or HB6121 (with mounting flanges)]
2 3-6.5mm cable diameter cable glands [Jaycar HP0720 (pack of 2)]
1 3-way 5.08mm spacing screw terminals (CON1) [Jaycar HM3132]
1 2-way 5.08mm spacing screw terminals (CON2) [Jaycar HM3130]
2 M3 × 5mm panhead machine screws
1 length of 7.5A mains-rated wire (for the LED wiring)
Heatshrink tubing (to insulate the LED connections)
Semiconductors
1 5mm or 10mm LED (LED1)
1 W04(M) 1A 400V bridge rectifier (BR1)
1 4.7V 1W zener diode (1N4732) (ZD1) [Jaycar ZR1402]
Capacitors
1 470μF 16V PC (radial) electrolytic
1 X2 mains-rated capacitor (see Table 1 for suitable value)
Resistors (all axial, ±5%)
1 1MW 1W
1 1kW 1W
1 150W ½W
30
Silicon Chip
Australia's electronics magazine
Fig.3: before starting, work out
the value you need for capacitor
C1. Make sure the terminal blocks
and zener diodes are orientated
correctly and don’t forget that the
wiring for Active and Neutral at
CON1 is critical.
heatshrink tubing. After that, cover
both LED leads with a larger diameter
heatshrink tube and shrink it down.
The mains connection is made to the
two outer terminals of CON1. It is very
important that the Neutral and Active
connections to mains power are made
as shown on the PCB (electricians will
be used to such requirements).
As it is not used, the centre contact
of CON1 can be removed if you wish.
A three-way terminal is used so that
the Active and Neutral connections
are sufficiently separated.
Installation
As well as being connected correctly, the incoming mains wires need
to be clamped to the enclosure using
a cable gland mounted on the side
directly opposite CON1. The LED
leads are also secured to the enclosure
using a cable gland that’s mounted
directly opposite CON2.
The PCB is secured to the base of
the enclosure using two M3 screws
into the two mounting posts located
down the centre line of the enclosure.
If you use the corner mounting holes
and standoffs instead, use nylon or
polycarbonate screws to provide insulation to the outside of the box should
a wire come adrift and contact one of
the screws.
Do not use metal screws that could
conceivably become live if a mains
wire comes adrift. This project is
designed for use with mains house
wiring, so it must be installed by an
SC
electrician.
siliconchip.com.au
|