Arduino Nano/Uno digital output not outputting 5v

Hi! I'm very new to Arduino programming (this is my second project), so please bear with me.

I'm trying to make an automatic irrigation system, where I have a moisture sensor, and when it is below a certain amount, my Arduino powers a small 5v peristaltic pump.

The problem is that the pump is not strong enough and barely pumps water out when connected to digital pin 1-12. I know that it is being supplied with less than 3.3v, as I tried manually powering it with 5v and 3.3v (on the board), and it gives MUCH more strength than the digital output pins do.

I thought the digital output pins were supposed to give 5v, thus I assume it would properly power the pump. All of the other components are wired correctly, everything works as it should aside from the strength of the pump. I tried this with a Nano and an Uno, same results.

Would I need an external power source for my project? I assumed it'd be simple enough to do like this.

Here is the code:

int soilMoistureValue = 0;
int percentage=0;
const int outpin = 12;

void setup() {
  pinMode(outpin,OUTPUT);
  Serial.begin(9600);
}

void loop() {
soilMoistureValue = analogRead(A0);
//Serial.println(soilMoistureValue);
Serial.print("Moisture Level: ");
Serial.print(percentage);
Serial.println("%");

percentage = map(soilMoistureValue, 190, 540, 100, 0);

if(percentage < 90)  
{
  Serial.println(" pump on");
  digitalWrite(outpin,HIGH);
}

if(percentage >95)
{
  Serial.println("pump off");
  digitalWrite(outpin,LOW);
}
delay(1000);
}```

The digital output pins can only supply 20ma. You can damage the Arduino by trying to pull more current. You can not drive a pump motor directly from the output pins. You will need the Arduino output to switch a transistor, mosfet, or relay which connects the pump to a voltage source which can supply the current.

1 Like

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project :wink: See About the Installation & Troubleshooting category.

relay module....

Yes, you need an external power because that method works ,better you use a transisor or relay module.

transistor is affordable

relay module is used for high volts arduino cant handle

delay command is used for its name

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