Portable power for Photon + WS2812 LED Strip

I’m working on a project using the Particle Photon to drive a WS2812 LED strip - basically the same as in this tutorial

I’m a total electronics newbie and am trying to work out what I need in order to supply the required 5v power from a battery or USB.

Any help or advice would be much appreciated.

Hi Barnaby,

LEDs can draw a a lot of power sometimes, so batteries will work but your life may be short depending on the lights displayed and the length of the strip. If you can plug it in and wire it like in the guide, I would use a 5v wall power supply.

These would be best, you dont need to worry about too many amps from the power supply, the lights will only take what they need. You just need to be sure the voltage is the same:


If you are only powering a meter or two:

hi Stephen, thanks for the advice.

Our project is intended to be wearable, so a wall supply is out of the question unfortunately. We want to drive about 100 LEDs, which I guess is a low of potential power. If we do hit the limits of our supply, is there any way to prioritise the Photon’s power supply so that it can keep running?

We’ve managed to get a basic prototype based on this tutorial:

The LEDs are powered off 4xAA batteries, but we are still powering the Photon from its USB input. The next step is to get it all powered from a single supply, which I guess could be either:

The Photon will power up with the 4xAAs connected directly to the VIN, although I understand this could be dangerous as this could exceed the maximum 5.5v that the Photon can take. Is there any way to protect it? If this is feasible it seems to me we should also be able to continue to run the LEDs off this.

Alternatively, could we use the USB socket on the Photon, and somehow power the LEDs off that? Perhaps using the 3.3v pin with a logic level converter to bump it up to 5v? Does that sound feasible?

Thanks again for any help and advice.

Its never a good idea to power your LEDs through your controller. Too much power drawn through the board can fry it. Its best to power your LEDs directly from the power source (which can be shared). Be sure to have a common ground between your Particle and your LEDs or you might get timing errors.

As for power, I would use a LiPo battery and breakout like this one:


Its not made for the particle but you can make it work. Plus it can charge when you are connected via USB. If you use alkaline batteries make sure your breakout does not have a charge option.

Here is a simpler one:

The photon can only take 3.3v at Vin. So be careful powering. The safest way would be to use a step down converter to power the photon and power the lights directly off the battery pack.

If you want to prioritize power, Id power them from separate sources. The photon will use next to nothing compared to the LEDs.

Thanks Stephen

So the liPo battery would be just 3.7v? Would this be enough for the LEDs?
And with either of these you could charge the battery via the Photon’s USB socket?
And are there any resources that would explain how to connect with the Photon?

Sorry, the backpack module is not directly compatible with the photon, but you should be able to wire it together with a little bit of Maker tinkering. I’m not aware of anything that can confirm that they will work together, but from reading the product descriptions it should be possible. For more info on powering NeoPixels I reccommend you checkout this guide:

I hope that helps! Let us know how your project gets on!

Thanks Stephen,

The link is interesting but doesn’t really deal with how both the Photon and LED strip might be powered from a single source.

I’m wondering if it would be possible to use 4xAA batteries as the power source, using the 5v to power the LEDs, then using something like this:

to convert the 5v to 3.3v for the Photon. Could this work?

That would work just fine! I suggested it two posts up!

Good luck and happy tinkering!

1 Like

Hi Stephen

Finally got round to trying this out.

I’ve connected the voltage regulator to my battery pack and my multimeter tells me I’m getting about 3.3v from the VOUT.

However, when I connect to the Photon’s VIN and GND, the Photon’s LED lights up white (with a little red around the edge):

I’ve not been able to find out what this means - can you advise?

Hi Barnaby,

Does the Particle have the white light when powered from the USB? The white light usually is indicative of a firmware issue, and probably unrelated to your power. Try starting it up in safe mode:
https://docs.particle.io/guide/getting-started/modes/photon/
and updating the firmware. A white light means that the wifi module is off.

Hi Stephen,

No it works fine when powered via USB.

Here is what the Photon documentation says
"Power to the Photon is supplied via the on-board USB Micro B connector or directly via the VIN pin. If power is supplied directly to the VIN pin, the voltage should be regulated between 3.6VDC and 5.5VDC. When the Photon is powered via the USB port, VIN will output a voltage of approximately 4.8VDC due to a reverse polarity protection series schottky diode between V+ of USB and VIN. When used as an output, the max load on VIN is 1A. 3V3 can also be used as an output, but has a limited overhead of only 100mA available. (Please refer to Absolute Maximum Ratings for more info).

Typical average current consumption is 80mA with 5V @ VIN with Wi-Fi on. Deep sleep quiescent current is typically 80uA (Please refer to Recommended Operating Conditions for more info). When powering the Photon from the USB connector, make sure to use a quality cable to minimize IR drops (current x resistance = voltage) in the wiring. If a high resistance cable (i.e., low current) is used, peak currents drawn from the Photon when transmitting and receiving will result in voltage sag at the input which may cause a system brown out or intermittent operation. Likewise, the power source should be sufficient enough to source 1A of current to provide an adequate amount of current overhead (especially if powering additional circuitry off of VIN).

Warning: When powering the Photon from long wires on USB and VIN, care should be taken to protect against damaging voltage transients. From the Richtek datasheet:

When a ceramic capacitor is used at the input and the power is supplied by a wall adapter through long wires, a load step at the output can induce ringing at the input, VIN. At best, this ringing can couple to the output and be mistaken as loop instability. At worst, a sudden inrush of current through the long wires can potentially cause a voltage spike at VIN large enough to damage the part.

To avoid these voltage spikes, keep input wiring as short as possible. If long wires are unavoidable, it is advisable to add a 5.1V zener diode or similar transient suppression device from VIN to GND. Another technique is adding more capacitance to the input using an electrolytic capacitor. Please refer to AN-88 by Linear for a good discussion on this topic."

So it looks like it wants 3.6-5.5v. I would think that it would still work at 3.3v. Make sure that your power supply can supply at least 1 Amp.

Ok so I should not use the the step-down transformer after all? In which case I would have something like this:

Four AAA batteries would provide 6v. Which would damage your Photon. You need to give the Photon between 3.6v and 5.5v. Try powering the whole thing off of three AAA batteries as you have drawn. See if that fixes the white light issue. If it does then the Photon isn’t getting enough volts or amps out of the step down.

I’m actually using AAs (sorry I’m not sure how to edit the part in Fritzing), and they are a little run down, so are giving out about 4.5v. If I take one out I get 3.3v.

So if I use 3 new ones they might give 4.5v, but might drop down below 3 fairly quickly if also powering the neo pixels.

I wonder if it would work to use a 5v regulator like this one:

instead of the 3.3v version I’ve been playing with?

Would this give a more consistent voltage to both the Photon and Neopixels, whilst also extending the useful battery life?

If your battery pack is outputting 4.5 volts at full charge, the regulator in the Photon can handle it just fine. I would say power them both off the battery pack. The batteries shouldn’t drop down below 3.6 until they are almost fully exhausted. Using a regulator sacrifices some of the efficiency, and you will actually use your batteries faster that way.

So long as your battery supply is always under 5.5v (and over 3.6) then you will be fine.

Well that would be simpler, if there would be no issues with running the neopixels (140 LEDs) off the same power.

So we tried that today with 3 fresh AA batteries, and it works fine. However I’m wondering how long a set of batteries would last, and if the LiPo option you mentioned earlier would be better.

You said that the Pro Trinket backpack could be made to work with the Photon - would you be able to explain how? (Please bear in mind this is my first electronics project - I’ve learnt a lot already but am still very much a beginner).

Would this be an option?

Would we be able to use the LiPo battery to power the LEDs too?

So if its AAA or Lipo, the thing that determines how long a battery will last its Amp Hours. A Lipo might say 3.7V 2000mAh. Thats 2000 milliAmp Hours, or 2 Amp Hours. A battery that size could power something using 3.7 volts drawing 1 amp for two hours. You will need to know how much power those lights use to find the correct battery size.

Look at this page for info about powering NeoPixels, including power draw:

That battery shield should work nice. You could connect your neopixels to the VBAT pin.

1 Like