Back in this post I vented of the frustration that many common varieties of 2-wire LED Christmas light default to an annoying blinky sequence, rather than just turning “on” as you’d like them to. Sadly there are no easy solutions to this problem.
Instead I threw together my own controller. A 12V power supply is plugged in one end, lights are connected to the other. They turn “on”. No pressing buttons. Simple.
The controller is designed for a few different control and power supply arrangements.
Input voltage is typically 12V. The board will step up the drive voltage to between 24-36V which is adequate for most 2-Wire LED Christmas light strings. The “DC OUT” Header can also be used as an input, for example if you have a DC supply available which already outputs the appropriate voltage for your lights.
A heatsink is required for driving larger light sets.
By default a 555 timer is used to generate a clock signal which drives a latch which in-turn drives an L298N full bridge generating the output required for “on” output.
Optional MCU Control
This year (2022) my lights feature custom microcontroller driven sequences using this setup:
An optional control header is provided to connect the board (for example) to an Arduino for more complex sequences. In this case U1 must not be fitted. I would recommend socketing U1 to allow for this option. The Arduino can be powered from this header.
Personally I don’t use Arduinos. The source code for the above setup is here. I’ll probably document it and design a proper PCB for next Christmas (2023).
15 thoughts on “Simple 2-Wire LED Christmas Lights Controller for “always on” operation”
I just commented on your other post about this project, but I just saw that you have uploaded the Gerbers and schematic…. Sorry for that… However, I have another question regarding this iteration of the circuit.
You say you can control this with an Arduino for more complex sequences. Do you have any code examples for that? Or how do you connect the cables?
The Arduino is supposed to provide the PWM? If yes, then shouldn’t the 555 IC be removed. Because the U1 that you remove is the Flip-Flop IC.
Finally, could you replace the 555 timer IC altogether?
Thank you so much for this amazing project!
Removing the flip-flop is enough and it means you can plug it back in if you want to use the on-board 555. You could also remove the 555 and related components although it’s then harder to switch back to that mode of operation.
Regarding the Arduino. As you said it has to provide the PWM. I’ve not yet written an example. I will start work on one shortly but it won’t be an Arduino sketch as I don’t use the Arduino ecosystem.
I expect that patterning with An Arduino/MCU will be quite complicated as it will have to employ both PWM and slower cyclical control simultaneously.
It’s worth looking at Arduino stepper motor shield based sketches for inspiration as these also use the L298N. Last year my lights were actually controlled by a hacked version of my stepper motor controller project on GitHub: https://github.com/inaxeon/steppercontroller
Thank you for your reply! I still have a couple of questions.
Questions 3 and 4 are really quick to answer. Question 1 and 2 has to do more with the architecture of the circuit.
1. Why do you need a positive and a negative square pulse (with 180 degrees difference) as an input to the H-Bridge? Wouldn’t the H-Bridge work with signal (positive voltage) to the one gate and zero signal to the other? So you would need just one PWM pulse for that.
2. The second question is about the creation of the square pulses with the 555-flip-flop combination. First of all, the 555 timer output has a PWM pulse where the Duty Cycle is not 50% positive and 50% zero. Do you use the flip-flop in order to “clean” that signal and create a perfect square (as well as produce the negative square)? Once again, if you could get away with only one pulse – as I mentioned previously – you could only create one pulse with the 555… I look forward to hear about your implementation…
3. Is the heatsink necessary from your experience? Could you get away without a heat sink? I have the original circuit as well, and it does not contain any heatsink. Does the H-Bridge get really warm?
4. Finally, could you get away with 5V input instead of 12?
Thank you very much for this amazing project. I wish you an (early) happy holidays!
1) If you didn’t have both halves of the square wave, only one polarity would be present at the output and only half of your lights would illuminate. This would be a part of custom control patterns if you were to implement such a thing.
2) It is mathematically impossible for the 555 to produce a 50% output. It can get very very close but not quite. This is exactly what the flip-flop is for.
3) Yes you will need some kind of heatsink. None of the components used there are particularly efficient. That’s just the deal unfortunately. I generally build all of my “pre-cooked” projects using through-hole components because most people don’t want to do SMD. There are no modern and efficient H-Bridges in a through-hole package which can handle 36V. Same deal with the step-up regulator.
4) The LM2577 datasheet says minimum input is 3.5V. Of course the input current is going to be a lot higher, there’s going to be more switching loss. It’s going to get damned hot with a 5V input but it’ll probably work.
Thank you for your quick reply! Some comments:
1. Since you need the negative rail of the PWM as well.. When you provide the PWM through the microcontroller, you can only have a positive rail. You could inverse the PWM with the Flip-Flop, but in your circuit, you completely circumvent it on the microcontroller mode. Instead, where the negative PWM would be, you have another trace to the micro. So how do you create the negative rail of the PWM signal only with the microcontroller, when the Flip-Flop is circumvented?
2. Maybe there are other ICs that are H-Bridges that are more efficient… And plus, easier to source that this H-Bridge. I will look them up and I will report if I find another. Do you happen to know of any other H-Bridge IC – even SMD that will do the job? Another option is to build the bridge by its components. I found this if it is of any interest to you:
1) Just allocate a second pin on the micro and drive it to the logic compliment
2) BTS7960 is a common one on the hobbyist circuit (excuse the pun) – extremely efficient but it’s only a half-bridge and limited to 27.5V.
“Just allocate a second pin on the micro and drive it to the logic compliment”.
I am not sure how you could do that. First, the AVR cannot produce negative voltage at its outputs. Secondly, since we are talking about a different pin, there is no way to keep track of the state of another pin, so you could create its logic compliment. The only thing I can think of are hardware approaches. Reverse the voltage of the PWM pin.
Whoa there I think we’re getting our wires crossed. The L298N does not have negative logic inputs. It’s all TTL. What I am saying is that one input is at 0V and the other is at 5V.
But that’s exactly what i said at comment 19/10 1:31
“Why do you need a positive and a negative square pulse (with 180 degrees difference) as an input to the H-Bridge? Wouldn’t the H-Bridge work with signal (positive voltage) to the one gate and zero signal to the other?”
But in your pic with the pulses, you say that “The blue and pink traces are the inputs to the L298N full bridge.”
So what exactly is going on? What does the H-Bridge take as input? Isn’t the negative pulse created by the second Flip-Flop?
I understand that the both halves of the 36V pulse is needed to actually drive the leds.
I also understand that this AC72V peak-to-peak is produced by the H-Bridge.
I am not sure what are the inputs to the H-Bridge. In your previous comment you said that one is the PWM pulse and the other is 0V (when the PWM signal is not zero).
But this contradicts your second graph in this picture (where the PWM is negative). I am not sure what the second flip-flop outputs.
Is it zero when the PWM exists, or negative voltage of the PWM pulse? I commented before that “Why do you need a positive and a negative square pulse (with 180 degrees difference) as an input to the H-Bridge? Wouldn’t the H-Bridge work with signal (positive voltage) to the one gate and zero signal to the other?”
However, from your response, i got the idea that the input to the H-Bridge is the positive PWM and the negative PWM. Now, i am back to the same question… Could you please answer this? It is the last question i have. Thank you very much!
Nice project! I wanted the always-on functionality myself, so i built your circuit.
I didn’t have the 555 chip and the Flip-Flop, so i tried with an arduino.
Unfortunately, it didn’t work. I sent 5V to IN1 (pin 4 from the connector).
I kept LOW voltage to the the IN2 (pin 5 from connector).
I didn’t feed anything to the EnA pin, since it already receives voltage (from your schematic).
Since the H-Bridge receives 1 on one control pin, and 0 on the other control pin, i expected that one LED strip will be always ON and the other always OFF.
But nothing lit up.
Do you know why my configuration did not work?
Thanks a lot!
To turn on one light string:
And the other:
If that isn’t working you have a different problem. Check the input voltage to the L298N
Can’t believe no one has made an off the shelf simple product to drive Xmas leds but thank you, you’ve come to the rescue!
In my scenario, will be controlling it via home assistant and interfacing your board to a shelley RGBW controller. Thinking the white LED output from the shelley usign a resistor voltage devider will connect to the input on the U18. If anyone is interested in how to do this….sing out.
Thank you, thank you, thank you! I have been scouring the web for exactly this!
I haven’t got the knowledge to have designed something myself but am hoping to build yours. Can you tell me, would it be simple to adjust the brightness of the lights with your controller? I did find that my lights were a tad too bright.
Of course. Just adjust the output voltage