Simple 2-Wire LED Christmas Lights Controller for “always on” operation

You don’t necessarily need a heatsink. I have 5000 LEDs hooked up to mine 😀

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.

Power

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.

Control

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.

For solid “on” operation 2-Wire LED Christmas lights need to be driven with an AC square wave at around 500 Hz.
The yellow trace is the output of the 555 timer. The blue and pink traces are the inputs to the L298N full bridge.

Optional MCU Control

This year (2022) my lights feature custom microcontroller driven sequences using this setup:

In the above scenario the DC-DC converter is bypassed as I feed the board directly with the 36 volts needed for the lights. There’s an ugly string of diodes on the 7805 to shave a little bit of the input voltage off as they’re typically limited to 35 volts max.

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).

Downloads

10 thoughts on “Simple 2-Wire LED Christmas Lights Controller for “always on” operation

  1. 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!

    1. 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

      1. 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. 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.

          1. 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:
            https://www.eevblog.com/forum/projects/l298-made-with-general-parts/

          2. 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.

  2. “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.

    1. 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.

      1. 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?

        1. 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!

Leave a Reply

Your email address will not be published. Required fields are marked *