-
The software
11/27/2019 at 19:50 • 0 commentsThe 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.
-
How the circuit works
11/27/2019 at 19:45 • 0 commentsThere 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.
-
Prototype
11/25/2019 at 21:27 • 0 commentsI 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.