Hiya,
I'm new to the Arduino world so I don't know much.
Recently I've been making a smart irrigation system using Arduino Uno. The project involves in using a 4 relay module, a battery holder (holds 3 AA batteries),
a soil moisture sensor, and a water pump (3V - 6V). The system works perfectly well but when the water has reached the desired moisture, the water pump keeps on until the power is cut off.
Code:
int water; //random variable
void setup() {
pinMode(3,OUTPUT); //output pin for relay board, this will sent signal to the relay
pinMode(6,INPUT); //input pin coming from soil sensor
}
void loop() {
water = digitalRead(6); // reading the coming signal from the soil sensor
if(water == HIGH) // if water level is full then cut the relay
{
digitalWrite(3,LOW); // low is to cut the relay
}
else
{
digitalWrite(3,HIGH); //high to continue proving signal and water supply
}
delay(400);
}
It is hard to see from the photograph, but it looks to me as though the arduino pin 3 is connected to the input for the end relay on the PCB, but the pump wiring goes to the second relay along.