I have some outdoor led christmas string lights. When I start to power them at the evening their blinking drive me crazy. I have to switch each individually to a smarter dimming or steady light. Last year two of the 31V power adapter have failed. Here in France, each AC adapter replacement costs roughly the price of the full string light!
So I thought of making a power supply myself. The soft variation from one color tothe other and the possibility of supplying several (all) LED strings were my guiding ideas.
An oscilloscope, a little reverse enginering, and here is how the LED string lights work:
The LEDs are arranged so as one polarity lights up green and blue LEDs and reverse polarity lights up red and yellow LEDs. Blinking, dimming and color change are achieved by a pulse width modulation and polarity change. The frequency of the pulses is near to 150Hz. Easy to do with the ATmega328P from the Arduino ! As a power driver I went to the easy way. A Dual H Bridge L298N Motor Driver Module laying around will do the job. It is also necessary to add a 32V power supply for the LEDs and 5V for the Arduino. A transformer with a 30V-0.6A and a 8V-0.35A winding taken out of the recycling box will do the trick.
As I had a Chinese voltmeter-ammeter lying in a drawer, I added it, as well as two two-color LEDs. Mainly to have a more "professional" design...
The software itself is pretty straightforward. the only trick is that I didn't use "delay ()" for timing, but I am relying on the "millis ()" and "micros ()" functions because they are non blocking.
The LEDs of the christmas strings slowly dim from red / yellow to blue / green and vice versa. With the software settings below, the cycle time is a little less than one minute. If you want it to be faster or slower, you just need to change the "defaultInterval" parameter.
Comments
Please log in or sign up to comment.