I am working on a big project that uses multiple infrared sensors, motors, solenoids, lights, and pushbuttons. I ultimately wanted to run everything using a 9V DC power supply through my Arduino MEGA. Last night my Arduino got really hot to the point you couldn't even touch the area by the DC power port on the board. I've realized that this is going to be way too much to power with my board. I have an Arduino UNO as well and I was thinking about using that with a 9V power supply as well so only half of the components will be powered by the Mega and the other half by the UNO.

I was having trouble because my infrared sensors for example, have a VCC GND and OUT pin. When I connected the VCC and GND to the UNO and had the Mega read the OUT it was getting a bunch of weird readings that were not correct.

With my motors and the NPN circuits when I used the 5V and ground from the UNO as the power supply and my I/O from the Mega to tell it to be on or off, nothing happened.

I was doing research on I2C and if that would be something that could work for this but it seems like it will overcomplicate a lot of this. I essentially just want to use the UNO as an extra source of power so I'm not pulling so much from the Mega alone. I would ideally want to keep all of my code on the Mega and have the UNO only for the power supply. Any advice on how to make this work? Thanks!

You cannot supply loads like a solenoid with an arduino at all. The arduino output pins like small currents, not big currents.Even more than a few LED's is too much.

You need to learn how to use small currents from arduino to control external transistors or relays to supplypower to the other devices. If you have a big enough 9V power supply, you can take current from there directto the output side supply of the relay or transistor. That current doesn't go through the arduino at all.

heres the thing the onboard regulator can only supply up to 500mA of current at one time b4 it dies. if you have any additional Voltage regulator, basically you are taking the load off the onboard regulator...