Simplest and cheapest way to continuously vary intensity of fairy lights - Page 1
Forum section: electronics / beginners

author: anthoven
author_rank: Newbie
timestamp: June 21, 2022, 11:42:10 pm
content: Hi everyone!I have a theatre project coming up in which I have to independently control the intensity of strings of LED fairy lights on enamelled copper wire. Each performed will be holding a jar of these lights, and needs the ability to control their brightness with a knob.My initial solution to this project was to control them through PWM from an off-the-shelf microcontroller board with a potentiometer attached. As there are so many units, this proved to exceed the project's allocated budget.Is there a cheaper way to do this? Is it possible to do with a potentiometer acting as a rheostat, in series with the battery?The known electrical details are:- supply voltage of 3V from 2x AA cells- measured current at full brightness of 200mA- forward voltage of LEDs are unknown, but colour is warm white so would assume somewhere over 3V- 40 LEDs in parallelWhat would the power would the potentiometer need to dissipate at the extreme of its range? Is there a better way to do this?Thanks for your help!

author: ledtester
author_rank: Super Contributor
timestamp: June 22, 2022, 12:55:20 am
content: Quote from: anthoven on June 21, 2022, 11:42:10 pmFrom the way you describe things it seems the LEDs are arranged in parallel - is that correct?And you're thinking of having one control which will control the brightness of all of the LEDs.In that case you only need one transistor to perform the PWM. In fact, there might be a ready-made module you can buy to do this, for instance, something like this:https://www.amazon.com/Onyehn-Voltage-Controller-1803BK-Adjustable/dp/B07NPJ5MQR/

author: pqass
author_rank: Super Contributor
timestamp: June 22, 2022, 01:24:39 am
content: If you're able, try this simple single transistor circuit. You can solder the components to the potentiometer directly; no PCB required.Any general purpose NPN like 2N3904 should do since it'll burn 45mW at most. You may need to change the upper and lower resistors for max. and min. current (222mA or 43mA, as shown).Play with it in the simulator (move the Resistance slider to adjust current through LED):http://www.falstad.com/circuit/circuitjs.html?ctz=CQAgjCAMB0l3BWcMBMcUHYMGZIA4UA2ATmIxAUgoqoQFMBaMMAKABcQUUAWcQqlAkJ8qVCDATZSaDIMJg8xBDijQck7ghTY8OPNgQI8yKgBM6AMwCGAVwA2bFmAy9CvZinBhPYYj5OisJBIAEp0AM4AluFsVgB2AMZ0LABOIG5enhnYnlR4vtCkRcXFLADu6bw5nEIg1ZCplZz4TZi5IPnEhSU9xCzYGAK11XIdYlBQ-YOZIpw8s+KT2LwWZaYpAPYADgA6AI7Y4CBdOYzMEwiwKAp48tcuStztrGCEnqN4Q8Jg3Lyeq+ttvtDotApBWBVRs5hKM2pMKhk4bDZJMAG4gbivTgozHCeoTbhUQ6iVQIcoYrEjYa5cm47HvWpwhpbTh4Yw-P5s8AYb4TBqQrkcmrfX7w1nsnnC7nCBpAA

author: SmallCog
author_rank: Frequent Contributor
timestamp: June 22, 2022, 03:05:09 am
content: Might do the job?https://www.ebay.com.au/itm/373382731379?hash=item56ef585673:g:o1UAAOSwoQZfzxye&frcectupt=trueBeing capacitive might make it easier to hide within the prop

author: Zero999
author_rank: Super Contributor
timestamp: June 22, 2022, 08:38:44 am
content: Quote from: pqass on June 22, 2022, 01:24:39 amThat might work, but bear in mind transistors vary in real life. Just plugging numbers into a simulator only proves it works with those exact models. For example, what happens if the hFE of the transistor, or power supply voltage is changed?Quote from: ledtester on June 22, 2022, 12:55:20 amA Schmitt trigger oscillator can do PWM with a potentiometer. Here's an example with the 74HC2G14. A dual diode can be used for D1 and D2 to save more space.

author: pqass
author_rank: Super Contributor
timestamp: June 22, 2022, 01:30:08 pm
content: Quote from: Zero999 on June 22, 2022, 08:38:44 amSometimes you don't need a sledgehammer....We're probably talking about dollar store fairy lights here where a parallel string of LEDs are directly attached to two 2AA batteries+sliding switch; no current limiting resistor. And they're already limiting themselves to 200mA. He has to source/produce many of them so he's looking for cheap cheap cheap, and easy.Start with fresh batteries when determining the upper and lower resistors. If you have a batch of transistors with high hFE then the lower resistor may need to be lower in ohms to reach darker light output. The pot+knob are the most expensive parts.CONFIRMED:I remembered that I had some fairy lights (20 LEDs, switch, 2AA holder, fresh batteries measuring 3.12V, the LED string pulls 48mA as purchased).I rigged up the circuit with: 3.3K upper resistor, 1K pot, 330R lower resistor, and a PN2222A transistor.It gave me fairly wide range from fully off to fully on. Yours may require tweaking the resistors.

author: Zero999
author_rank: Super Contributor
timestamp: June 22, 2022, 06:12:43 pm
content: Quote from: pqass on June 22, 2022, 01:30:08 pmHow many different lots of BJTs and LEDs did you try? Don't forget there are going to many of these and it could be time consuming if the component values need to be adjusted.I wouldn't call it a sledgehammer. PWM is just the most reliable method or controlling the brightness of an LED.Why bother with a transistor? If a minimalist solution is required, a simple series potentiometer (try 10R) would be just as good, if not even better than relying on the hFEof a BJT.

author: james_s
author_rank: Super Contributor
timestamp: June 22, 2022, 06:22:28 pm
content: Quote from: Zero999 on June 22, 2022, 08:38:44 amThat's a very elegant circuit. I remember building a PWM oscillator out of a dual op-amp but this one is even simpler. I might have to breadboard it just to play around.

author: pqass
author_rank: Super Contributor
timestamp: June 23, 2022, 01:33:27 am
content: Quote from: Zero999 on June 22, 2022, 06:12:43 pmWell, I tried two PN2222A, five 2N3904, and two 2SC945. They all gave the same amount of travel on the pot (light output from off to full-on) with the same upper (3.3K) and lower (470R) resistor values. Maybe I'm just lucky. But it's likely that a bag of transistors should yield many (a majority?) of similar performance.I don't think OP is going into general production (issues with multiple parts vendors, quality over time). Once the upper and lower resistors are experimentally determined on a breadboard, it wouldn't take much effort to test a bag of transistors to weed-out the non-conformists; ie. pop-in a new transistor, wiggle a pot, place in bin A or bin B, next...It's harder to prototype with pots. You'd have to buy a range of them to confirm which gives a wide-enough travel. Maybe they don't make an in-between value. Two cheap resistors and a common transistor (extra 20 cents?) gives you the ability to also purchase a common value (1K) pot (the most expensive part) at a commodity price ($1).Simple and fast enough to "air-wire" on the pot directly; no engineering or populating a PCB, for just a few dozen stage props? It should only take a couple of minutes each if your ducks are in a row.Yes, PWM IS the goto/robust solution. But isn't the effort overkill for the intended application? That is, dollar store fairly lights for a one-of stage prop. The fairy lights themselves aren't exactly a model of engineering; use of LEDs in parallel, no current limiting. Trade-offs are everywhere.Anyways... see attachment for my implementation. I didn't have a panel mount 1K pot; used a trimmer instead. The transistor "socket" is optional.