I've got a few questions about the proper way to power an electronic circuit on a prototype board that I intend to control with an arduino.
The circuit is one of those fun 8x8x8 led projects. I've experimented with building it on a prototype board, have measured some of its parallel segments and have some uncertainties. The basic theory is 64 leds can be on at a time. Given the persistence of vision, cycling through the layers at a decent rate makes them appear as if they are all on. Their cathodes are bent horizontally and connected into a layer while their anodes will be connected to the led in a column above and below. The 64 led's will be controlled by a set of 8 shift registers with synchronized clock and latch buses and independent data lines. Lastly, a layer will be activated by applying voltage to the base of a transistor that closes the circuit for the given layer.
A really hacked up version of the circuit is here(I don't have proper circuit drawing software as of yet and this is just meant to give you an idea of what I'm doing rather than be definitive). I'm using blue LED's that have a forward drop of around 3-3.4V, current limiting resistors of 100 Ohms, and transistors capable of switching 800mA+. I've read quite clearly that you don't draw more than 40mA from an arduino pin or sink more than 200mA into its ground.
My concerns are around powering this properly.
How do you permanently power a circuit that needs 5V and power an arduino from the same power supply at the same time when the circuit draws significantly more current than the arduino?
Issue 1 - Did I construct my parallel circuit correctly
I hooked up a regulated 5V breadboard power supply and wired it to the VIN of the arduino which I understand goes through the regulator on the board. I connected the power directly to the shift registers to power them and brought the ground of the IC's and the LED's back to the power's ground directly. The arduino itself is hooked up to a set of buses that control the clock and latch pins on the IC's, send data to each register and activate the transistors' bases. I tested what I believe are the separate parallel elements of the circuit by sticking an ammeter in series right before the ground of each: the arduino gnd & the power supply (~35mA), the LEDs gnd to the power supply (~95mA) for 8 LED's, the IC's gnd's (seemingly 0mA). Three questions: do the numbers make common sense? Second, is it silly to think that I'd power an IC directly yet have some of its pins (latch/clock/data) hooked up to the arduino? Also, the shift registers say not to ground more than 70mA into them. As far as I can tell they are outputing (per measurement) as much as ~95mA but the current is grounded straight to the power supply and not the IC and when I try to measure the current grounded into the chip, I get a 0 reading. Does this make sense?
Issue 2 - How do I avoid the USB inadvertently powering the whole thing and melting the arduino? For context, I intend to be able to have the cube hooked up to the USB port to read animations that are too complicated to load onto the arduino. When I hook it up to a USB, I believe the arduino prefers to be powered from that. If, say, the external power to the cube is off, in this state since the VIN appears to be bidirectional, the current flows from the USB through the VIN to the LED's. Thoughts on how to approach this problem?
Issue 3 - The docs say to power the arduino with a source that's 7-12V. I think the onboard regulator steps this down a bit. But, if the circuit calls for 5V as well and you want to power it directly(i.e. have one power supply), that seems like an unfortunate happenstance if you can't wired 5V regulated power source to the VIN and expect the arduino to "behave" well. FWIW, mine did, but I don't want to count on that for the long run. How do people approach this problem? Having a separate power for the arduino vs. the circuit is certainly possible but I've got to believe that people don't do this. One thought I had was to wired the 5V regulated supply directly to the 5V pin of the arduino. The docs say pretty clearly not to do this however because it bypasses the regulator. However, if the supply is regulated, should I care?
Issue 4 - External power considerations. All designs that I'm emulating call for some decoupling capacitors. I've been studying how some power is provided to projects and would it be safe to say that regulated power supplies are designed to provide constant voltage but have no buffering capability that capacitors provide and I need to put them in my circuit for smooth operation?
Issue 5 - capacitor sizing. I'd like to understand how one should think about this circuit snippet. Consider that I may draw between 0 and 1A pretty quickly to light the cube. I see what I believe are 3 capacitors that are put on right in front of the other, I guess in parallel across vcc & gnd that go 1000uf,100uf,10uf. After that, do you just create a pair of power and ground buses for the circuit and arduino to tap? Also, is the theory that a set of successively smaller capacitors provide faster stored charge as the power supply may not be keeping up. Can folks share how they think of this, how big of a capacitor or set of capacitors would be put after the main power supply? If you have a regulated power supply, isn't part of it's raison d'etre to provide constant current and why would you even need capacitors?
I understand this is a big pile of questions and am grateful for some input.
David