Automatic watering project works with usb/macbook power but not 9v external power supply

Hi, I am making a simple automatic plant waterer that uses these water pumps

I want to use 2 water pumps to pump water to 2 different plants.

The pumps are connected to a single relay, (
which is being powered by the 5v pin on my elegoo uno R3. The pumps are also powered by the same 5v pin.

Everything works with only one pump connected. Everything also works with two pumps connected when I am powering the arduino with my computer. However, when I use my 9v battery to power the arduino (through the built in 9v battery socket thing), it works with one pump, but with two pumps no water moves at all. I am guessing this has something to do with the 5v pin not being able to provide enough current to power both the relay and the two pumps. But why does the 5v pin supply different current when connected to the computer than when connected to 9v battery?

Is there a different power supply I can use to solve this issue, or anything other ideas to fix this? I don't really have another power supply to power the pumps with, so it would be preferred to still use the 5v pin.

Here is my code:

void setup() {
pinMode(7, OUTPUT);


void loop() {

while(millis() < 20000)
digitalWrite(7, HIGH);
digitalWrite(7, LOW);


What type of 9V battery? If it's the rectangular one used in smoke alarms, then that is your issue, they cannot supply much current.

Yes, just like these:

Is there another type of battery I can easily use with the port on the arduino?

this is indeed not suitable to provide lots of current
There are lots of resources on line regarding batteries. Here is a random one

You need to check what power is required by your system, powering everything through the 5V pin might put lots of pressure on your arduino’s regulator and small copper traces


PS do yourself a favour and please read How to get the best out of this forum and modify your post accordingly to include code tags

Here we go again - and again, and again! :roll_eyes:

You cannot use the "barrel jack" or "Vin" to power a serious project.

Nor indeed, can you use "smoke alarm" batteries.

If it requires 5 V - the Arduino (UNO, Nano and most older versions) require 5 V to operate - then you need to power it at 5 V. The on-board regulator could power the UNO board itself with 5 V - but almost nothing else and certainly not any form of motor or pump.

Get a common USB "phone charger" rated to at least one Amp. It might power three of those water pumps though to be honest, the specifications on that listing are almost certainly completely misleading and the stall current of the pumps is likely far higher than the quoted 250 mA. A 2.1 A supply would be more appropriate.

Use the power supply to connect to the pumps and feed 5 V to the UNO via the "5V" pin except when you connect it to a PC via USB.

Someone on another recent thread is challenging me on the point about the on-board regulator being usable so I just gave up. The OP will eventually figure out who is telling porkies! :grin:

Hi, thanks for the response.

How exactly would I use a phone charger to power anything? Am I supposed to cut off the end and solder the wires? Also, the system isn't anywhere near a wall outlet, so if you are implying I should plug the charger into an outlet that wouldn't be possible. Also, I am in a college dorm with almost no tools (no soldering iron).

Since I have a relay, I think I could just keep using the smoke alarm battery to power my arduino, and then use a different battery through the relay to power the pumps.
Here are some specs on the pumps: * Voltage: DC2.5-6V , Current: 150-250mA

  • Power: 1.28W

Do you have any recommendations for batteries I could use for this? Ideally something that wouldn't require soldering.

You could Use 4 AA batteries in series for the motor. There are cheap batteries holder with leads, some even have an On/Off Switch


Can you please post a circuit diagram?
Can you please post a picture of your project so we can see your component layout?

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

Thanks Jackson, I will try that. If it doesn't work I will post a circuit diagram.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.