So, I've put together my Christmas tree lights - a string of WS2811s driven by my Uno board. They are 12 volt WS2811s, so I have rigged a 12 volt supply to them and just using the Uno for the data channel, powered, initially by the USB port of the PC. So far, so good.

Then I take the whole arrangement to the tree and try to power the Uno from a USB charger - but that's where it all goes wrong! The LEDS start to flash madly, nothing like the pattern that I've programmed.

I've tried various USB chargers and various USB cables to no avail, I've tried powering with 6 volts to the DC in socket - same thing. When I go back to the PC and pick up the Uno power from the USB cable, all is good! I have no idea what can be causing this, please help!

  • Garbage chargers. Did you try powering the Uno from the 12V supply as well? – Ignacio Vazquez-Abrams Dec 6 '16 at 12:22
  • Also, 6V is out of spec for Vin. – Ignacio Vazquez-Abrams Dec 6 '16 at 12:22
  • 3
    You are using two different power supplies? (PC + 12V or USB Charger + 12V) Have you connected the grounds from the two power supplies? – Code Gorilla Dec 6 '16 at 12:57
  • 1
    @Matt That worked! Thank you very much! This is one of those times when I have to just accept that I'll never really understand some of these subtle things that can happen with things like ground lines. If you want to enter this as an answer I will happily upvote and mark this as accepted. – Lefty Dec 6 '16 at 13:48
  • 3
    @Matt most PCs have GND referenced to EARTH. If the power supply too, has it's ground referenced to earth, both grounds are effectively tied together (via the earth). Most phone chargers are isolated. – Gerben Dec 6 '16 at 14:12

[Turning my comment and other peoples replies into an answer to make it easier to read]

You are using two different power supplies? (PC + 12V or USB Charger + 12V) Have you connected the grounds from the two power supplies?

I have a limited understanding of why, but I know that unless the two power supplies have a common ground level the values for 0V and 5V may not be the same across the two feeds and you get odd and unpredictable behaviour.

Gerban explained that the reason it works on your PC is that most PC Power supplies reference Gnd from the Earth. If you 12V supply is an ex-PC PSU, or similar, that will be doing the same which is why that setup works, they share a common ground via the mains earth. The 5V phone charge probably has a plastic earth pin, which means it doesn't do this and therefore the Gnds are not tied to each other.

Majenko's blog will provide a more detailed, less hand wavey explanation: https://hackingmajenkoblog.wordpress.com/2016/12/06/the-importance-of-sharing-grounds/

| improve this answer | |

The Arduino Uno barrel jack input connects to a linear 5 volt regulator. These types of regulators require a several volt difference between the input and output. So you need to supply 5 volts + several more volts or at least 7 volts at the barrel jack.

From the Arduino Uno web page:

The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

| improve this answer | |
  • Good theory - I assumed this myself when I first saw the behaviour I was getting - but the Sony USB charger I tried next is the highest power one I have - I once used it to power the Uno AND 100 5 volt WS2811s drawing about 2 amps between them. – Lefty Dec 6 '16 at 14:05
  • I deleted the part of my answer concerning a power supply as I re-read your question and am not clear on how you connected everything together. From my understanding, are you using 2 power supplies? One for the LEDs and one for the Arduino? And is the Arduino power supply a USB power supply connected to the Arduino's USB port? And is the ground of the Arduino connected to the ground of the LED strip? – st2000 Dec 6 '16 at 14:07
  • Also, are you sure WS2811 are 12 volt parts? – st2000 Dec 6 '16 at 14:21
  • I've been using 5 volt WS2811s most of the time, powering them direct from the Uno, the Uno was, in turn just powered from the USB cable from the PC. I found that having even 100 in a string meant that I couldn't get power from 1 end to the other. I got a string of 200 12 volt ones and, obviously needed to power them from an external source. I wired a 12 volt laptop supply to the + and - of the string but leaving the rest as it was - i.e. USB to Uno, data channel from Uno to string AND NO OTHER CONNECTION to Uno. That worked fine... – Lefty Dec 6 '16 at 14:36
  • ...so I thought I would be able to just power the Uno from a USB charger and all would be OK - but then hit the problem exactly as I have described in the question. So it seems that from Gerben's comment at the top, the PC worked fine because its ground was connected through the mains power to the ground of the 12 volt supply - but when I used an isolated USB charger, this broke the connection between the 2 grounds. When I now connect the ground from the 12 volt line to the ground of the Uno, the problem goes away. – Lefty Dec 6 '16 at 14:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.