Water pump not working

Hey there!

I'm making a project about automatic watering for plants! But i don't understand my problem:

When I connect the water pump to 5v and gnd, it works perfectly, but when i use a digital or analogic pin with 5v (measured with a polimeter), it doesn't work. I tried reprogramming the code, but it still isn't the problem.

const int dry = 595; // value for dry sensor
const int wet = 239; // value for wet sensor

void setup()
{ 
  Serial.begin(9600);
}

void loop()
{
  int sensorVal = analogRead(A5);

  int percentageHumididy = map(sensorVal, wet, dry, 100, 0); 

  Serial.print(percentageHumididy);
  Serial.println("%");

  if(percentageHumididy <= 60){
    analogWrite(A0, 600);
  } else if(percentageHumididy >= 90){
    analogWrite(A0, 0);
  }
}

What should I try?

Welcome to the forum

How much current does the pump take ?

3.3-5v

Idk why it doesn't work, it makes no sense to me...

if you are using an Arduino UNO R3 ...
A0 ist NOT a PWM output pin.
Your pump will not work without any other circuit on an Arduino Pin because it draws to much CURRENT.

Then what should I do?

read here:

and

here

Thanks!

Is not the answer to

Oh, sorry. I don't know how much current it takes...

If you are using a basic Water Pump Like for Small Projects it would usually take around 50mA of current. Use PWM Pins of Arduino To send PWM Signals. This --> "~" type of marks would be beside the PWM Pins !

Do you know how much current an Arduino pin can provide ?

Hi, @aldoci123987
Welcome to the forum.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.

How are you driving the pump, directly from the controller output?
If so then STOP.
The output of the controller will not be enough to power the pump, and you can damage the controller.

Can you please post some picture of your project?
So we can see your component layout.

Can you please post a link to specs/data of the pump?

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

Tysm, but I already solved it!

Ty!

1 Like

How did you fix it.
Can you please post your working code, so it may help someone with similar problems.

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

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