hello, I am pretty new to the world of arduino and I am having trouble with my first project. I can't get my 5v water pump to work. The 5v relay that i am using seems to be working, however whenever i start the program my relay makes a ticking on and off noise but the pump isn't pumping any water. please help ): thanks !
int moistPin = A0;
int wPump = 8;
float moistVal = 0;
int dt = 5000;
int dt2 = 2000;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(wPump, OUTPUT);
pinMode(moistPin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
moistVal = analogRead(moistPin);
moistVal = moistVal / 100;
Serial.print("Plant Soil Moisture: ");
Serial.print(moistVal);
Serial.println(" %");
if (moistVal == 0.00){
digitalWrite(wPump, HIGH);
delay(dt);
digitalWrite(wPump, LOW);
} else {
digitalWrite(wPump, LOW);
}
delay(dt2);
}