Water Pump and Arduino (Auto Top-Off project)

Hello! I am trying to make an auto-top system that is powered by Arduino for my aquarium. I am using a submersible pump, an external reservoir, and a 1 gallon tank (scaled small compared to my 20 gallon tank haha). I know for my code, I would likely set a delay. Here is code that I got help with to start off (not official!) :

const int pumpPin = 2; // Digital pin connected to transistor base

void setup() {
  pinMode(pumpPin, OUTPUT);
}

void loop() {
  digitalWrite(pumpPin, HIGH); // Turn on pump
  delay(5000);                 // Run pump for 5 seconds (adjust as needed)
  digitalWrite(pumpPin, LOW);  // Turn off pump
  delay(10000);                // Wait 10 seconds before next cycle (adjust as needed)
}

One of my main questions however, is how can I connect my water pump to my Arduino Nano R3? I know I likely have to use a breadboard for a circuit.
Here are the pump product pages (only going to use one of them, just had both at my disposal since I don't know which would work better):
https://www.amazon.com/gp/product/B07Y27SVPP/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
https://www.amazon.com/gp/product/B0BJJBK746/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

Thank you!

No Arduino can be used as a power supply! Especially a motor! Use separate supply and let the Arduino just be a control for your project.

1 Like

Yes, you're right! Sorry didn't mean to say it was a power supply! Meant to say how can I make a separate supply? I know I need a breadboard and a transistor or relay.

Since one pump is mains AC powered and the other is 5 volts DC, you need to make a decision about how you will proceed.

I am only using one water pump and it is 5V DC. How can I turn it off/on using Arduino? I know I cannot power the water pump using Arduino only, but what would be the separate power supply and how can I connect that to the Arduino?

I also assume I need a transistor or relay module.

At this point in your project, a relay module is best.

What the difference between this and you other topic
There seem to be a lot of good information there that you just ignored.

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