A kind of universal driver for WS2812B LED strips automatically determining the number of LEDs on the strip.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
WSController.schSchematic of the main PCBx-kicad-schematic - 15.23 kB - 11/27/2019 at 19:46 |
|
|
umbrella.m4vshowing an umbrella with LED strips in actionMPEG-4 Video - 10.86 MB - 11/27/2019 at 17:30 |
|
|
lightbelt.m4vshowing a LED strip belt in actionMPEG-4 Video - 10.91 MB - 11/27/2019 at 17:29 |
|
The software makes use of the neopixel library to address individual LEDs at the beginning. Afterwards some of the many effects of the WS2812FX library are used. The mcu checks the battery voltage (via internal reference) and shuts down if it drops below a threshold. If the mode switch is pressed after the last available effect, it will also shut down the device. The code is on github.
There are two switches in the circuit - one as a latching switch (SW 2) to switch it on and the other as a mode switch (SW 1).
The latching switch circuit : that's Q2, Q3 and SW2. Pushing SW2 puts the gate of Q3 high. This connects the overall ground GND to PWRGND which is the battery ground. Thus the mcu gets a supply voltage and will pull the base of Q2 low. This will keep the gate of Q3 high. SW2 can be released and is not used anymore.
At the beginning the gate of Q1 will be low. So all current for the LED strip will flow through R2. The mcu now lights LEDs from the start to a defined maximum number (for the moment 200) - one at a time and measures the voltage drop at R2. From this it's easy to find out the number of connected LEDs. Afterwards the gate of Q1 is set high and R2 is shorted by Q2.
The MOSFETs Q1 and Q3 are obviously over-dimensioned. However, the IRLU024N/IRLR024N is the standard MOSFET which I use in my projects : first it's a logic level MOSFET and second it's reasonably priced. So as long I do not need hundreds of them I see no point in flipping through data sheets for hours just to save a few cents.
I build the device into electrical tubing (25mm diameter) which makes a housing which is stable and can be carried around easily, is just big enough to hold a 18650 cell and is very cheap. I added an off-the-shelf LiPo charging board and some cable with a robust connector. For the prototypes the lid (with the USB connector for charging) was manually cut from acrylic and the other end I just sealed with silicone. The circuit for a latching switch, a mode switch and to determine the length of the LED strip was build on perfboard and connected to an arduino nano clone.
Assembly of the PCB is straight forward. To program the mcu I used a modified AVR-ISP-adapter: I had butt-coupled and soldered pogo-pins to a 6pin pin header together with some additional pin-headers for meachnical stability. The mcu can the programmed e.g. from the Arduino software using an external programmer (don't forget to first burn a bootloader to set the fuses of the mcu - the bootloader will be deleted again when the program itself is flashed).
Create an account to leave a comment. Already have an account? Log In.
Become a member to follow this project and never miss any updates