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);
}```