Hi there,
I want to control some WS2812B leds with my spark core.
Because the LEDs can use quite a lot of amps, I don’t want to power them through the core.
I’m afraid I’ll fry it.
I designed a ‘simple’ circuit with a 7805 voltage regulator.
I’m not yet a hero in electronics. So my question: is this the right way to power my spark core (etc.)?
@HappyCookie, what you have looks great. However, the amount of current used by the Spark/LED combo will dictate how much heat is dissipated by the 7805. Roughly, the current draw * voltage drop of the 7805 will be “wasted” power. That is 7v * current used.
If you use a lot of LED’s, you may want to buy a DC-DC switching converter (like this one) on eBay that can supply the power more efficiently. I took this approach for my MessageTorch using a 3A AC-to-DC 5V power cube.
I run 1200 LEDs with a Spark core. The best way to power LEDs such as W2812B is the use of a switching power supply with 5V. I use a 350W supply. The core can then easely powered with that 5V. If you must use 12V then you can use a switching BEC module found on RC accessories suppliers.
The W2812B LEDs draw 1mA for the internal driver and ~60mA for full white. If you use a LED strip, you should power the strip at least every 5m. If you use a couple of single LEDs, dont forget the capacitor for each LED as described in the datasheet.
To control the LEDs you can use a great library I found here
@HappyCookie check out this diagram on how to use a Level shifter... definitely recommended. You MIGHT be able to deal without it, but if you have flickering issues you'll want to add it. I used to play that game in the past, but now I just always level shift so there's no worries.
Here's the power supply I would recommend for your 60 pixel strip:
The 1000uF cap at the first WS2812B was a tip from adafruit. Maybe it is only necessary when want to use many leds? At the moment I am playing with only 10 leds. But in the future I will use (many) more. Therefore I want to do it right the first time - even if I can power those 10 directly form my core.
I use small pcb’s with a WS2812B, 100uF cap and a resistor onboard.
Conclusion: The 7805 is inefficient. Big voltage drop and a lot of heat. Shame that I have like 20 of them… So I will only use when I only need a limited amount of current.
So it’s great to know there is an better alternative for the 7805.
I never heard about a “DC-DC switching converter”. It looks like those things are “plug and play” - so perfect!
A “switching power supply” is also simple to use. But a bit overkill for the few leds I want to power. I will keep it in mind when I want to power a lot of them! @digixx; also thanks for the tip to power them at least every 5m
I’ve never heard of a Level shifter @BDub. So can you tell me if I got it right?
They are like a bridge. It converts a 3.3v signal (which comes from my spark core) to a 5v signal (to de DataIN of the LEDS).
Like a transistor? But why can’t i use a NPN transistor instead?
Thanks for the (simple) picture, that will help me a lot(!) when I want to use them!
If you use 10 LEDs and its for development only the 7805 solution is ok. Use a sufficient heatsink.
Yes, and no. What you do is to move some amount of power loss to the diode, away from the linear regulator. This makes sense in low power applications where only a couple of 100mA flow. Use it only for development.
So many gadgets use power supplies with 5V. Why not use one of these?
You get the concept, it shifts the 0-3.3V output to a 0-5V output. Unfortunately you can't do this with one NPN transistor because they are inverting, and you need it to act as a buffer (HIGH in, HIGH out, LOW in, LOW out). There are also some nice bidirectional level shifters made with mosfets that are good for I2C... unfortunately when you use those with the Neopixels they tend to slow down the edges too much at the 800kHz high speed that the neopixels require, and then they more or less won't work at all. The ones listed at my github repo work great.
I would say if you keep the voltage on VIN between 3.6 and 6V you don't need a diode. If you start to go above 6V, a diode would be helpful to keep the max input voltage below that of the maximum input voltage rating of the LDO.
I've got only a 5v one that supplies only 700mA. 8 x 60ma = 480mA for the neopixels. That leaves 220mA for the core. Is that sufficient? I was told not the push your power supply to its limits....
The other one I have is a 12v power supply (2.3A)
Ah! I got it! With a transistor you would never get a "HIGH in, HIGH out, LOW in, LOW out". It would be something in between (or so)
I’d go for something a bit bigger, like a 5V 1A Apple USB charger or something similar.
The 12V (2.3A) sounds good, but will damage your Spark Core as the VIN pin is rated for 3.6V to 6V max.
An NPN transistor would take a 3.3V input through a resistor to it’s base, and ground on the emitter. With this HIGH input, the collector which is the output would be pulled low with respect to GND. When the input is 0V, the collector would be pulled up through a 1k ohm resistor to 5V and would be HIGH. So it’s inverted… HIGH in, LOW out… and LOW in, HIGH out. not a buffer You COULD swap the logic in the NeoPixel library… but I’m not quite sure most standard NPN transistors would be fast enough. Might be worth a try though. The 74HCT125N buffer is definitely the easiest thing to get up and running quickly.