0% found this document useful (0 votes)
36 views3 pages

Design of Soil Moisture Indicating Project by Using Arduino Uno in Tinker Cad 2

Uploaded by

220901509
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views3 pages

Design of Soil Moisture Indicating Project by Using Arduino Uno in Tinker Cad 2

Uploaded by

220901509
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DESIGN OF SOIL MOISTURE INDICATING PROJECT BY USING

ARDUINO UNO IN TINKER CAD


PROGRAM FOR THIS PROJECT ;

int moisture = 0;

void setup()

pinMode(A0, OUTPUT);

pinMode(A1, INPUT);

Serial.begin(9600);

pinMode(8, OUTPUT);

pinMode(9, OUTPUT);

pinMode(10, OUTPUT);

pinMode(11, OUTPUT);

pinMode(12, OUTPUT);

void loop()

// Apply power to the soil moisture sensor

digitalWrite(A0, HIGH);

delay(5000); // Wait for 5000 millisecond(s)

moisture = analogRead(A1);

// Turn off the sensor to reduce metal corrosion

// over time

digitalWrite(A0, LOW);

Serial.println(moisture);

digitalWrite(8, LOW);

digitalWrite(9, LOW);

digitalWrite(10, LOW);

digitalWrite(11, LOW);

digitalWrite(12, LOW);

if (moisture < 200) {


digitalWrite(12, HIGH);

} else {

delay(5000); // Wait for 5000 millisecond(s)

if (moisture < 400) {

digitalWrite(11, HIGH);

} else {

if (moisture < 600) {

digitalWrite(10, HIGH);

} else {

if (moisture < 800) {

digitalWrite(9, HIGH);

} else {

digitalWrite(8, HIGH);

You might also like