Shared PSU arduino and LEDs

Hello
I am planning to build an aLED lamp that uses approx 3m led strip WS2812B (60 LED per m - so using approx 180 LEDs) and a PCB which should share the same PSU. I have a couple of questions. One is about the PCB. I have an arduino uno which I am using to prototype but it would be too big for the project. I have used teensy 2.0 before (but not externally powered). Would that be suitable or do you have any other PCB to suggest?

the second question is about an issu I am having straight after trying using shared power. I have attached a pic with my connections.
If I power the board via USB and the LED strip separately everything works well. If I remove the usb cable and connect the arduino Vin with the 5V supply) there is a voltage drop and the arduino light just flickers (I measure the voltage and it drops substantially). HOWEVER, if noticed that if I disconnect the led from the power supply, I connect the arduino to it, and then, after turning on the arduino, I reconnect the led strip it does work, but if I turn the supply off and on again it will stop and will not restart. I believe it is a voltage issue, any one can shed a bit of light to help me understand what I am doing wrong please.
Please note that at present, for prototyping, I am using only 40 LEDs, the capacitor is 470uF and the resistor is 220.


this is with shared PSU:

The voltage applied to Vin goes through a voltage regulator to drop it to 5V so no wonder you have a problem

You can power the Uno by connecting a 5V supply to one of its 5V pins but that may cause a problem if you also plug in the USB lead. Some Arduino boards do not have this problem due to how their circuits are designed but I cannot remember whether there is a problem when using the Uno

As a test, disconnect the USB lead and connect one of the Uno 5V pins to your power supply along with a GND connection, of course

Powering the Uno via the 5V output pin is in general not a good idea unless you have a well regulated power source which you do not.

Either power the Uno with a 7-12V supply connected to Vin or barreljack or with a separate 5V supply connected via the USB connector.

I had tried that too but same result

Using a well regulated power supply, of course

Is there any advantage of powering via the USB port rather than a 5V pin ?

My PSU states that it is regulated :confused:

Read the section on Power in the FAQ

1 Like

Thanks jim-p, that's quite clear. I was hoping to have one power supply for both the board and the led strip... but it appears that that's not possible, at least with the arduino uno...

Why not ?

I was just looking in to it. I would need to use PSU of about 7V to power the arduino and then reduce the voltage to 5 to power the led strip ... (maybe with voltage divider?)

You could employ the solution suggested by @jim-p and supply 5V to the board via a "power only" USB lead.

1 Like

oh... I understand, running another wire from the transformer to the usb socket?
something like this?? sorry for the appalling quality of the pic :slight_smile:

update: I tried it but it doesn't seem to work

when connected this way it works if I do the following:
1 disconnect USB from Arduino and disconnect ground and 5v of the LED strip
2 power on PSU
3 connect USB to arduino (now arduino power up correctly
4 connect LED strip ground and 5v to breadboard, now LED strip works correctly
BUT
if I switch off and on the PSU the whole thing will not work again and I have to repeat the sequence above to get it to work.

It looks like the issue was caused by my PSU.
I have tried a different one and I do not get the problem.
I am curious to know why this was happening with that PSU though... (which, contrary to the one I am using now, is supposed to be regulated)
Basically the arduino will power ok if I switch the PSU on first then connect it to the arduino (via usb, 5Vin, or 5V -> it works fine with all three inputs) and I get 5.2 V across the PSU output. However, when switing the PSU off and back on again I only get 2.6 V to 2.8 V and the arduino has not enough power. Removing the USB cable (or the 5Vin, or 5V wire) and plugging it back in, brings everything back to normal...

It's regulated - just poorly so. It evidently doesn't handle peak loads very well.

There are things you might have done. For instance, use a reset controller that holds the microcontroller in reset as the power stabilizes. Or add massive amounts of capacitance at the output of the PSU (think >10000uF instead of 470uF). Or add a circuit that only switches the power to the LEDs after the microcontroller has started, and perhaps offers a soft-start function as well.

However, in a case where you're just powering a couple dozen smart LEDs and an Arduino, if any of the above is necessary, just use a better PSU. A PSU that can't handle something like this basically just stinks anyway.

1 Like

Yes, I think you are right and I was planning to use this PSU for prototyping anyway.
I am probably not going to use more than 120 LEDs so I am thinking to get a 5V 10Amp PSU (I have seen on from amazon for about £13). Only they seem to be quite big,which means I have to review the size of my project (lamp) to fit it in...

Any brand advice welcome :slight_smile:

I often go for the generic Chinese ones you can get pretty much anywhere. If your project draws e.g. 6A, make sure to get a 10A rated unit. I mostly use the open-frame type in my smaller projects that go into a (usually plastic) housing, or the closed, metal-encased ones for higher power projects. If you want to hear a brand, you'll probably come across Meanwell - but really, there are lots of generic units that are virtually identical and that appear to be just as good.

WS2812B has about 55mA max current consumption per led, so for 180 leds 10A psu would be perfect. Probably you have to power your strip from both ends if you want to drive them all at full brightness. Of course you don't need to, you can limit brightness/current in your code. I'm running 300 leds + esp8266 with 3A usb charger without any problems, but my led current is limited to max 2A in the code (Wled).

WS2812B leds don't draw current at startup, you have to have your code running to power them.
May be that big capacitor without current limiting draws too much at startup to supply arduino sufficiently ?

@rsmls thank you. That's good to know as I had come across Meanwell and I was wandering whether it was better than generic ones. I suppose my concern is mainly about the safety.
I am still not sure how many LEDs I will be using and may just wait until I made up my mind as the bigger the power the bigger the size (and I am trying to keep the size as small as possible).
Thanks for your input!

@kmin and to link it with my previous post that is also another thing I need to test as I may just limit the current (although - on the other hand - having the option to have max brightness is a plus)

WS2812B leds don't draw current at startup, you have to have your code running to power them.
May be that big capacitor without current limiting draws too much at startup to supply arduino sufficiently ?

No I had the code running when I tested it, and I tried to remove the capacitor as well. It's quite weird really, as this is a transformer that should definitively be better than the one that is working (which is a samsung mobile charger...). The one that is not working is a Maplin, I can't remember how much I paid for it but it wasn't cheap.