I'm still pretty new to all this. I'm trying to run a couple air pumps and a stepper motor on an Arduino mega for a project. I was able to get my circuit working with a 9V battery, but I can only run either the pumps or the motor on any given sketch, otherwise the second one doesn't run. When I swap it for a 9V wall adapter, nothing works at all. What should I do?
The stepper says it takes between 0.5-2A and the 2 air pumps each take 400-500 mA, but I'm not trying to activate the motor and pumps at the same time, just in sequence. With the wall adapter I can't run any of the three even by themselves
Sorry, I'm still new to this so I'm not 100% sure what you mean by that. I'm just using digital pins for the motor and pumps, but I am also powering a pressure sensor from the I2C pins (but that reads fine still). I'm also using the 3.3V for the sensor, and both the 5V and Vin pins for the motor and pumps.
It sounds like you are powering the high current motor and pumps using the Arduino as a power supply, which it is not designed for, but seeing your schematic will clarify that
I'm using an Adafruit TB6612 motor driver for the stepper, which has me connecting the Vcc to the arduino's 5V supply, but also a VM to the Vin arduino pin
Does the power adapter say DC? An AC power adapter would be BAD! Do you have a multimeter? If not it's probably time to get one, and a cheap meter is better than no meter!
Check the polarity. It's usually shown on the power supply but you can also check it with a meter (or with an LED and series resistor). Assuming it has a barrel connector, the inside should be positive.
If you have a multimeter check the 9V output unconnected and then when connected (by measuring Vin on the board).
Make sure the barrel connector fits correctly. They come in a variety of sizes and if the inside hole is too big it may not make contact.
The power adapter may simply be defective...
You can't (reliably) power the motors & pumps through the on-board 5V voltage regulator. If the 9V is OK, but 5V is not, that's most-likely the problem. If they are 9V motors they can be run from the power supply but if they are 5V motors you'll need a separate voltage regulator, and probably a switch-mode regulator to handle the currents.
And, you can't power a motor directly from an I/0 pin. They both need drivers (with a separate connection to a power supply). The I/0 pins are rated for 40mA "absolute maximum".
P.S.
I've never overloaded the built-in regulator myself but some linear regulators will oscillate and go unstable when overloaded. That won't always show-up on a meter but it can foul-up a microprocessor. (It will show-up with an oscilloscope.)
Point is, meeting those criteria is as easy as falling off your chair. Of course, newbies can't be told of the criteria, or every spammer who wanted to join would know what to do to get access, which isn't desirable. Still, as Bob has posted elsewhere, they get through anyways, so...
C