WateringBot Problem (Nano + Relay + Moisture Sensor Probe)

This is my first real aruindo project and so far im having a lot of fun learning.

My current setup is an arduino nano, a soil moisture sensor and a relay connected to a 5v pump for watering my plants.

The problem I'm having is that although the led stops blinking when soil moisture reaches over "700" the relay stays on and keeps pumping water making for very wet and unhappy plants.

I'm not much of a code monkey but have the suspicion i'm using the if statements and/or the loops wrong? Any help would be greatly appreciated.

const int LED= 12;//Digital pin that the LED is connected
#define RELAY1  10    //Digial pin relay is connected too 
void setup(){
Serial.begin(9600);
pinMode(LED,OUTPUT);
pinMode(RELAY1, OUTPUT); 
}

void loop() {
int sensorReading= analogRead(A0); //reads the sensor value
                  


Serial.println (sensorReading); //prints out the sensor reading

if (sensorReading > 700){//if reading is above 800, LED blinks on and off
digitalWrite(LED,HIGH); //turns the LED on
digitalWrite(RELAY1,LOW); //turns the RELAY on
delay(1000); //waits for a second
digitalWrite(LED,LOW); //turns the LED off

delay(1000); //waits for a second


if (sensorReading < 699)
digitalWrite(RELAY1,HIGH);//turns the RELAY off

}

it seems like your second if statement needs {}

edit: also you should have first if statement end before second if statement starts. otherwise it will only turn off sensor if the reading is exactly 699 or 700

Also I would use the Relay NO not NC because if for some reason the Arduino fails and no longer sends signal to pump the relay will stay on and you will flood your plants. (This would mean you switch your digitalWrite(RELAY1, HIGH) and digitalWrite(RELAY1, LOW).

This code should fix your if statements:

const int LED= 12;//Digital pin that the LED is connected
#define RELAY1  10    //Digial pin relay is connected too 
void setup(){
Serial.begin(9600);
pinMode(LED,OUTPUT);
pinMode(RELAY1, OUTPUT); 
}

void loop() {
int sensorReading= analogRead(A0); //reads the sensor value
                  


Serial.println (sensorReading); //prints out the sensor reading

if (sensorReading > 700){//if reading is above 800, LED blinks on and off
digitalWrite(LED,HIGH); //turns the LED on
digitalWrite(RELAY1,LOW); //turns the RELAY on
delay(1000); //waits for a second
digitalWrite(LED,LOW); //turns the LED off

delay(1000); //waits for a second
}

if (sensorReading < 700){
digitalWrite(RELAY1,HIGH);//turns the RELAY off

}
}