I'm not sure if I should post this on another forum but I will just post it here. I am using a Raspberry Pi for Octoprint on my 3D printer and my 3D printer uses an Arduino MEGA 2560. Since the MEGA is powered by a power supply from the 3D printer I was wondering if I could use the Arduino MEGA to power the Raspberry Pi without having an extra cord to power the Raspberry Pi. I think it is possible but I don't know what pins to use to power the Raspberry Pi from the Arduino. All I want to know is if it is possible and what pins from the Arduino MEGA would I use to power. My guess is that I use the 5v and ground pins on the Arduino MEGA to power the Raspberry Pi with its GPIO 5v and ground pins.
As long as the R-PI does not overload the Arduino on-board regulator
According to this (I wouldn't take it as "gospel" - do some research):
...a Raspberry Pi will want quite a few milliamps depending on what it is doing. You're probably not going to be able to power the RPi from the on-board regulator of the Arduino Mega; it's not made for that.
Hmm - this seems to confirm it:
So - you need at least a 5 volt, 1.2 amp power supply to power the RPi.
If you want to use the power supply of your printer, you need to find out what it can provide, what your printer requires (if you are using a RAMPS 1.4 system - that's going to be about 20 amps @ 12 volts DC).
You need to find out if the power supply will have enough capacity to supply an extra amp or more for the RPi - most likely, it will - but you need to verify that first.
if it does - then you should look and see if it provides a regulated 5 volt output; if it does, then great - but if it doesn't (maybe it only provides regulated 12 volts or 24 volts - or something like that) - then you are going to need to add a voltage regulation board of some sort so you can power the RPi from it. There are ton of options available for this - a bit of googling will show you many (I would suggest using switched-mode regulation if you can get away with it - while you could just hang a 7805 with a heatsink from the 12/24 volt output of the power supply, it isn't very efficient, and if you want to go beyond 1 amp (with a to-220 device) - you'll need a bypass transistor or something).
Once you have your 5 volts - then you need to get it into your RPi; you could do this by building (again - google it) or buying a "USB Power Only" cable or such. Another way to do things (and eliminate the need for a regulator) - is to add a USB Hub to the RPi - power the hub from the power supply (you'll need a hub that can take the higher voltage, of course) - and it will power the RPi - as a bonus, you'll expand the number of USB ports of the RPi.
Again - don't try to power the RPi from the Mega - the on-board voltage regulator of the Mega is already over-taxed at 12 volts (due to the poor heatsink strategy of the Arduino design - which uses the PCB for the sink - arguably OK when you'r only dealing with an input of 7-9 volts, but beyond that it starts getting warm quickly depending on the current draw). Plus, it doesn't have the capacity or extra parts needed to support being able to supply beyond one amp.
In short:-
I was wondering if I could use the Arduino MEGA to power the Raspberry Pi without having an extra cord to power the Raspberry Pi.
No.
Grumpy_Mike:
In short:-No.
Thank you