Sharing Vcc/GND between two arduinos

Hi there!

I have a project where parts of it it consists of a Arduino Mega 2560, as well as a Peggy 2.0 pegboard from Evil Mad Science (Peggy 2). The Peggy is essentially an Arduino Diecimila clone with mux/LED drivers. The two boards used to be powered by a regulated 5V power supply going into the Peggy 2.0. The Mega got its power from the Peggy 2.0 (it has Vcc and GND in a tiny prototyping area), coming in through the GND and Vin pins on the Mega. The only other connection between the two boards is the I2C cables they use to chat with eachother.

As the Peggy 2.0 doesn't have a voltage regulator, I needed to give it 5V regulated power. However, for physical design reasons, I'd rather power the two boards from the Mega, using a 9V power supply on the standard Mega power plug (I also trust the voltage regulator on the Mega more than my wallwart).

Now I realize that I'm bordering on the silly here, but since I hate the smell of fried components in the morning, I just wanted to be 100% sure: if I connect a 9V to the Mega, and keep the connections (VCC/GND on the Peggy and Vin/GND on the Mega) I should be fine, right? All I am doing is "reversing" the power, and as far as I can see from the Arduino Mega 2560 page, I can also provide voltage through this (Vin)pin.

I don't know if there is any difference between the Vcc and the Vin pins on the Mega, but I suppose there is no issue with supplying voltage from the Mega's Vin pin to the Peggy, or is there something I don't know about the Vin? After all, since the Peggy 2.0 powers 625 9mm LEDs, two muxes and two LED drivers in addition to an ATmega328P, I suppose the total current could be on the high side?

OJ

I don't know if there is any difference between the Vcc and the Vin pins on the Mega,

Yes, they are two totally different voltage levels from different voltage sources. Vin on a mega board is whatever voltage is plugged into the external voltage connector (minus one diode voltage drop) which needs to be in the recommended +7 to +12vdc range. This feeds the mega's on-board +5vdc regulator and that regulator's output voltage is the Vcc for the board and is +5vdc and also wires to the 5v pin.

So if your 'Peggy' board requires +5vdc to operate (an assumption?) it must not be done via the Vin pin as that would destroy it. I might be able to be powered by the mega's 5v pin, but only if the current draw of the Peggy board is lower then the mega's +5vdc regulator can supply. I couldn't find an overall schematic drawing for the Peggy, nor mention of it's maximum +5vcc current requirement.

Lefty

I would start by seeing how much power the peggy takes!

From memory, it's something like 25x25 - that's 625 LEDs. At 20mA and 3V each, that's 12.5 mA at 3V or nearly 40W of LEDs!

Clearly even your wall-wart was not supplying 10s of amps so they must be driving them at a much lower duty cycle (maybe 1/25th if they drive a column at a time or 1/12 if they do the same but at 40mA) which might reduce it to maybe taking 1-2A at 5V. However, even then, the regulator on your Mega' is likely to get pretty hot trying to supply 1A in addition to it's normal load.

If the regulator on your mega can supply the current your peggy needs then fine - join 5V on the Ardu to 5V on the peggy. DON'T join your peggy to Vin 'cos that's whatever unregulated power you are providing to your Arduino (e.g. 9V DC).

"Vin" is the wrong Mega pin for regulated 5V. If you have a regulated 5V source it connects to "+5V". By connecting 5V to Vin you are giving the Mega's 5V regulator insufficient voltage. The Mega was probably running on 3 or 4 volts.

"Vin" would also be the wrong pin for feeding 5V from the Mega to the Peggy. It connects to the power plug so it would be putting out 9V!

How much power does the Peggy draw with all the lights on? It may be too much for the Mega regulator. You could build a 5V regulator on the Peggy prototype area and feed it from the Mega Vin (raw 9V) pin.

johnwasser:
How much power does the Peggy draw with all the lights on? It may be too much for the Mega regulator. You could build a 5V regulator on the Peggy prototype area and feed it from the Mega Vin (raw 9V) pin.

Thank you for your enlightening replies guys! I think the idea of building a voltage regulator on the prototype area of the Peggy and feed it raw 9V from the Mega might be a feasible way to go. I will doublecheck this, but if I recall correctly, the Peggy documentation actually mentions that a 7805 could be an option if one wants to use a higher voltage wallwart. Since the Vin then supplies raw 9V without the risk of damaging the Mega voltage regulator this should keep the Mega safe, and the Peggy should be safe behind a 7805.

Dr_Ugi is correct in that the Peggy lights one column at a time (which it also uses to create "shades of grey" for the LED display), and even though the total amps still could be quite high, as long as a separate 7805 handles the voltage regulation for the Peggy I believe I should be fine.

Perhaps I could add one more question: if a 7805 is a tad too weak (i.e. gets too hot), what is the commonly used alternative? I've gotten so used to relying on the 7805 that I haven't really looked at alternatives for higher currents (for 5V). Better safe than sorry after all :slight_smile:

Actually, strike that last question about the 7805 alternative - Google provides a rather huge amount of answers to that questions. Sorry, was low on caffeine at the time :wink: