Devices & Components
Arduino Uno Rev3
SparkFun Soil Moisture Sensor (with Screw Terminals)
Buzzer
12V DC Water Pump
9V battery (generic)
Breadboard (generic)
Jumper wires (generic)
5 mm LED: Red
Arduino Wireless Proto Shield
Software & Tools
Arduino IDE
Project description
Code
Code For this Project
c_cpp
Write this code or copy it from us.
1#include <AFMotor.h> 2// DC motor on M2 3AF_DCMotor motor(2); 4void setup() { 5 Serial.begin(9600); 6 motor.setSpeed(1000); 7 motor.run(RELEASE); 8} 9void loop() 10{int sensorValue = analogRead(A0); 11 Serial.println(sensorValue); 12 delay(1); 13if(sensorValue>300) 14{ 15motor.run(FORWARD); 16} 17else 18motor.run(RELEASE); 19} 20
Code For this Project
c_cpp
Write this code or copy it from us.
1#include <AFMotor.h> 2// DC motor on M2 3AF_DCMotor motor(2); 4void setup() { 5 Serial.begin(9600); 6 motor.setSpeed(1000); 7 motor.run(RELEASE); 8} 9void loop() 10{int sensorValue = analogRead(A0); 11 Serial.println(sensorValue); 12 delay(1); 13if(sensorValue>300) 14{ 15motor.run(FORWARD); 16} 17else 18motor.run(RELEASE); 19} 20
Downloadable files
Circuit Diagram
By this diagram,you can easily make an Automated watering System with Indicator.
Circuit Diagram
Comments
Only logged in users can leave comments