Power SparkCore & WS2812B leds

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

Thanks!
-Mark

(full: https://community.spark.io/uploads/particle/3506/69842369fb1974a0.jpg)

The spark core has a 5V LDO on on board and probably don’t need an external one.

However, there’s no harm in doing so. :smiley:

The schematics look fine :wink:

The 1000uF at the WS2812B side is probably an overkill and the startup of the system might be noticeably slow. Something like 1-10uF should work fine.

2 Likes

@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. :smile:

2 Likes

Hi,

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

1 Like

@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:

1 Like

Hi guys, great advice!

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! :slight_smile:
  • 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!

Also an idea: is it smart to put a 1N4001 diode before the vin pin to lower the voltage? (So the LDO on the spark core hasn’t have to work so hard?) The idea came from: https://learn.adafruit.com/battery-power-for-led-pixels-and-strips/diode

Thanks!
Happy Making
-Mark

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?

What is your source voltage?

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.

1 Like

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) :electric_plug:

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) :smile:

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 :wink: 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.

that’s why I put in the 7805

I believe you on your words - won’t even bother to try a NPN :wink: