Maker Pro
Maker Pro

Mains LED fairy light - PWM dimmer

luke.w.pc

Apr 3, 2012
8
Joined
Apr 3, 2012
Messages
8
Hi All,

I have fairy lights like these: https://www.ebay.co.uk/itm/254856779675

They have 200 LEDs alternating through 3 series circuits of ~67 LEDs, each mains DC (~ 3.2v per LED). Each LED also has a small resistor.
The cable has a box with a full wave rectifier and a chip which provides flashing modes.

I'd like to make them dimmable and control brightness via a micro-controller.

What circuit or module would be suitable for switching this load using a pwm signal from the controller?

Thanks for your advice,
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,513
Joined
Nov 17, 2011
Messages
12,513
Any microcontroller can do this. Do you have a specific one in mind?
For the power side 3 MOSFETs suffice, one for each string of LEDs.
You need to determine whether the strins of LEds have common GND ('-') or common Vcc ('+').
Assuming GND is switched and Vcc (31 V from the power adaptor as per the Amazon link) is common (which is a fairly typical configuration), e.g. IRLZ44N MOSFETs are suitable. A circuit for this is given e.g. here. Note that the example shows a discrete LED and resistr, these are to be replaced by one of the strings in your fairy lights. Also Vcc is obviously 31 V from the power adapter, not 5 V as in the example.
R1 should be 1 kΩ or less (not 10 kΩ as used in the example).
R2 is o.k. at 100 kΩ. Its purpose is mainly to turn the MOSFET completely off.

If your microcontroller is a 5 V type (e.g. Arduino uno), this kind of driver module can be used.
Note that most LED driver modules are for either 5 V or 12 V LEds and are therefore not suitable for your 31 Vapplication.
 

luke.w.pc

Apr 3, 2012
8
Joined
Apr 3, 2012
Messages
8
Hi Harald,
Thanks for you response.

I measure 210v across each circuit and belive it's just rectified mains?

Would a MOSFET like this be suitable? https://uk.rs-online.com/web/p/mosfets/1780828
I intend to put the 3 circuits in parallel as I don't need the alternating twinkle modes.

I'll be using a gpio pin on a pi zero (not a microcontroller I know), is it reccomended to isolate this from the mosfet gate?
 

bertus

Moderator
Nov 8, 2019
2,568
Joined
Nov 8, 2019
Messages
2,568
Hello,

The leds seem to work on 31 Volts AC.
From the given page in post #1 :

Output Voltage: 31 V Light
Lighting Technology: LED
Occasion: Christmas, Multipurpose, Party, Wedding Installation
Voltage: AC 31V/220V(UK Plug)

Bertus
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
12,513
Joined
Nov 17, 2011
Messages
12,513
Your measurements do not match the description on the Amazon website: 31 V vs. 210 V. Something is amiss here.
is it recommended to isolate this from the mosfet gate?
That depends on a few factors:
- are the LEDs really at 210 V? If so, is it possible that the circuit can be touched -> isolate. If the complete circuit is isolated and cannot be touched, isolation of the gate is not required.
- are the LEDs at 31 V? If so, is the 31 V circuit isolated from mains -> no isolation of the gate required. If the 31 V circuit is connected to mains, see above.

I measure 210v across each circuit and belive it's just rectified mains?
210 V matches 67 LEds × 3.2 V. Mains in the UK is 240 V, rectified mains would be 340 V. Therefore the supply of the LEDs cannot be simply rectified mains, there is obviously some circuitry to reduce the voltage.
I recommend that you do not tinker with these lights. The voltages are dangerous and possibly lethal.
Better use lights that operate on a safe low voltage, as e.g. the ones in the Amazon ad you linked to.

Apart from that: where would you take the 5 V for the Pi zero from? A separate power supply or regulated down from the fairy lights' power adapter?
 
Last edited:
Top