Andrew Kanzler
Published

Soil Moisture Sensor for Arduino

Turn your ordinary garden into a smart one with the help of an Arduino and a Soil Moisture Sensor.

BeginnerProtip1 hour943
Soil Moisture Sensor for Arduino

Things used in this project

Hardware components

Arduino UNO R3
×1
Arduino Soil Moisture Sensor
×1

Story

Read more

Code

Arduino Code

C#
#define SensorPin A0 
float sensorValue = 0; 
void setup() { 
 Serial.begin(9600); 
} 
void loop() { 
 for (int i = 0; i <= 100; i++) 
 { 
   sensorValue = sensorValue + analogRead(SensorPin); 
   delay(1); 
 } 
 sensorValue = sensorValue/100.0; 
 Serial.println(sensorValue); 
 delay(30); 
} 

Credits

Andrew Kanzler

Andrew Kanzler

11 projects • 1 follower
I am a DIY geek. Love to interact and create with Raspberry Pi. Also, a drone photographer.

Comments