Externaly powered project to be programmed via USB

Hello together,

I'm currently working on an Arduino UNO based 8x8x8 mono-color LED cube with TLC5940 ICs to support PWM dimming and at the moment I'm thinking about how to construct my case and how to power the project.

One of the requirements is that the cube should be powered only by a wall-wart power supply with at least 2A@5V (64 LEDs per layer at 20mA each = 1,28A + a little more for the rest of the electronics). (The voltage level for the supply is being discussed further below.)

While the cube is powered by the wall wart supply I nevertheless want to be able to plug in a USB cable to the cube to connect it to a PC to reprogram it. This should be possible while the cube is powered without plugging out power, plugging in USB, programming, plugging out USB, plugging in power to see the changes or to remove the Arduino from the case. This could then also be used to stream visualization data from the PC to the Arduino in real time.

First of a power-point sketch of how my current development circuit looks like:

Here the Arduino is powered by the PC via USB while the peripherals are powered via a bench power supply set to 5V. Since the bench supply is not isolated I connected the grounds of the Arduino (and therefore the USB) and the bench power supply to have a common reference. Then the Arduino communicates with the peripherals via normal signal lines. In this configuration the Arduino consumes less then 100mA and everything works fine (at least no smoke so far ;)).

Also a power supply only solution works as expected using a cut-off USB cable, no surprises here (although the extra connection to GND probably is not needed):

But I want to do finally in still something different:

A power supply should be connected to the cube powering the Arduino and the peripherals at the same time to enable complete functionality. If the cube is powered I want to be able to ADDITIONALLY plug in a PC USB connection to reprogram the Arduino or the stream serial data, but the cube has to work without the USB connection as well.

The USB plug in the wall of the case would be extended to the USB socket on the Arduino board, therefore to power the Arduino using the the power supply there are only two options left:

  1. VIN or or power barrel jack
  2. the 5V pin

From what I read on the internet I understood that it is really unadvisable to connect USB and external 5V via the 5V pin at the same time (due to two voltage supplies "fighting" each other as it was said). Therefore I would be left with option 1. This however requires the voltage supply to be 7-12V and this in turn need to be stepped down separately for the peripherals.

The questions that I currently have due to this situation are as follows:

  1. Is my current development set up with the connected GNDs of the USB powered Arduino and the external power supply safe or I was just lucky so far that nothing was damaged?

  2. What type of power supply is applicable for the final project? I would tend to a switched mode supply due to size and efficiency. May there be problems with high frequency ripples for the Arduino and other ICs stability or will this work fine?

  3. Will my plan work to power the Arduino with 7-12V via the VIN pin (or the power barrel jack) to get the cube running while at the same time being able to communicate with the Arduino from a PC via USB without letting some smoke out or having other problems?

  4. Is it advisable to get a 7V supply instead of 12V or to reduce 12V to 7V before feeding it into the Arduino in order not to overload the onboard voltage converter? (I read this tip in some forum, but I'm not sure if this is needed in every case since the input of the Arduino is rated 7-12V)
    (possibly I want to have 12V available in the case at some point instead of only 7V to be able to use an illuminated pushbutton at the front of the case, those are most often powered by 12V)

  5. What will be the best solution to step down the voltage from 12V to either 7V or 5V? Buck converters for efficiency (what about noise?) or rather linear regulators? Or maybe something else entirely? Should I buy those premade or build them myself? (in the end I'm planning to make a PCB for the whole project, so I guess I could fit the parts on there as well)

Answers my questions as well as additional inputs/ideas are very welcome!

Best regards,
dumbel

  1. No, you where not lucky, it's a must. You need ground for power, you need ground for USB => all grounds shared

  2. Switch mode is just fine.

  3. That would work but then you need to step down the voltage again for the leds...

  4. If you don't load the 5V line with other stuff 12V is fine. But at 12V is can only deliver enough current for itself (and a few leds) because the 7V between 12V and 5V is burned in the form of heat. So by lowering it to 7V you have less to burn so you can draw a bit more current (but still not much). But it looks like you're not driving anything from arduino 5V so you're fine.

  5. Step downs are nice because of the little heat. Noise is decent for most, and besides that, if you feed that 7V into the barrel then it flows trough the on board linear regulator as well. And pre-made are fine. A step down circuit is always a challenge. You can just make a footprint for the pre-made board and use that. THat's what I do, cheaper and saves time.

BUT, I would drop them all. You said you want to build the Uno into a case and extend the USB to the outside. I would just cut that cable open and cut the 5V wire. Now get a 5V supply, this way you don't need to have extra regulators. Now you can connect that 5v to the Uno as well. Via the 5V pin or, because it's already cut, via the cut wire in the usb cable. Don't forget to also connect the GND, it's a MUST but only one ground path is preferred.

Also, don't forget to add some buffer capacitors near the led drivers and the Arduino. And certainly, don't forget the decoupling capacitors near the led drivers!

Thanks first of all for your very thorough answer to my questions! Much appreciated!

BUT, I would drop them all. You said you want to build the Uno into a case and extend the USB to the outside. I would just cut that cable open and cut the 5V wire. Now get a 5V supply, this way you don’t need to have extra regulators. Now you can connect that 5v to the Uno as well. Via the 5V pin or, because it’s already cut, via the cut wire in the usb cable. Don’t forget to also connect the GND, it’s a MUST but only one ground path is preferred.

Well, this would be by far the easiest solution, I guess.

Just to make sure I understood you correctly:
When the USB cable from the computer would be plugged in my cube then actually only the two data lines and the ground line are connected to the Arduino. Therefore, when the cube is not powered by an external power supply but the USB is connected nothing is going to happen.
Once the cube is powered I can communicate like normal with the Arduino inside the cube and when USB is disconnected the Arduino is still powered with 5V via its USB connector (see attachment)

(1) Is there a difference between inputting the 5V to the Arduino via the USB connector on the board or using the 5V pin? The latter would probably be easier/cleaner to do since I already plan to plug the Arduino board onto a group of pin headers on my PCB where there will be a 5V layer anyway.

Also, don’t forget to add some buffer capacitors near the led drivers and the Arduino. And certainly, don’t forget the decoupling capacitors near the led drivers!

Regarding the decoupling capacitors:
Next to my four TLC5940s I will have a ceramic 0.1µF and an electrolytic 100µF capacitor each. Also for the TPIC6B595 shift register used to control the layer MOSFETs I plan at least a ceramic 0.1µF capacitor. (2) Is this sufficient?

Regarding the buffer capacitors:
(3) What is the purpose of those? So far i only heard about the decoupling capacitors.
(4) What do you mean by “near to the Arduino”? And where? In front of the USB connector where the 5V will be fed in?

Best regards,
dumbel

That's indeed the idea. Only thing I'm not 100% sure about is plugging in the USB an then powering it on. It will not destroy the Arduino but I'm not sure the computer will recognize the Arduino in that order. First power, then USB will work fine. And indeed, because the power comes from the power supply the cube will work, with or without USB.

  1. A small one. The power from USB is fed trough a mosfet which is turned on when there is no power on the barrel jack/Vin. But because you're not going to use that it's fine to power the Arduino via the 5V pin.

  2. 100nF ceramic close to each IC is the most important. The buffer is only needed for the high side drivers, here the the p channel mosfets.

  3. The buffer is the bigger dips in power, for example, turning on a complete layer of leds will give a sudden demand of power. The buffer capacitors will provide that locally before the power supply can really act. But because you use a bunch or mosfets I would just add one bigger (like 1000uF) near the mosfets.

  4. If you use the 5V on the pin header then it's close to the pin header. :slight_smile:

But like I said, try to make the power rails into a star shape with the power input as origin of all paths. This way the Arduino and the leds share less common path so current draw on the led side of things will not effect the Arduino that much.