Overview
This project deals with a way to save water and also helps farmers to tell whether the soil needs water or not from this project we can save wastage of water in the fields.
In this project we have used a Temperature Sensor (LM 35) which tells the temperature of the soil from that temperature we can calculate how much water we have to give in the fields and we also get to know that when we have to give water into the fields. On detecting the need for water according to temperature the motor will get start automatically.
Hardware required
- Arduino Uno R3
- NPN Transistor
- Resistor
- DC Motor
- LED Red
- LED Green
- BreadBoard
- Jumper Wires
- Temperature Sensor(LM35)
Schematic Diagram
Fig 1. Circuit Diagram
Arduino Code :
const int LM35 = A0;
const int motor = 13;
const int LedRed = 12;
const int LedGreen = 11;
void setup() {
Serial.begin(9600);
pinMode(motor, OUTPUT);
pinMode(LedRed, OUTPUT);
pinMode(LedGreen, OUTPUT);
delay(2000);
}
void loop() {
int value = analogRead(LM35);
float Temperature = value * 500.0 / 1024.0;
if (Temperature > 50){
digitalWrite(motor, HIGH);
digitalWrite(LedRed, HIGH);
digitalWrite(LedGreen, LOW);
}
else {
digitalWrite(motor, LOW);
digitalWrite(LedRed, LOW);
digitalWrite(LedGreen, HIGH);
}
delay(1000);
}
Precautions
- Connections should be done properly.
- Arduino is case Sensitive so code accordingly.
- Give different colors to the wires.
- Resistors to be used with sensitive devices.