COMPONENTS-
Arduino uno X 1
Breadboard X 1
Hygrometer X 1
Jumper Wires
What is Hygrometer?
This module can give us a digital signal when the soil need watering and this output can be adjusted by the potentiometer. Or it can give us an analog signal of current soil moisture! In this tutorial we will use the analog signal output of this module and we will change it in percentage value. Finally we will print in serial monitor the current percentage value of soil moisture
.
CONNECTION-
use the default ADC connection
CODE-
int AnalogPin = 0; // FSR is connected to analog 0 int LEDpin = 11; // connect Red LED to pin 11 (PWM pin) int Reading; // the analog reading from the FSR resistor divider void setup(void)
{ Serial.begin(9600); // We'll send debugging information via the Serial monitor pinMode(LEDpin, OUTPUT); } void loop(void) { Reading = analogRead(fsrAnalogPin); Serial.print("Analog reading = "); Serial.println(Reading); if(Reading<200)
{
Serial.print("needs water"), //connect your motor pins and turn on the motor
delay(50000);
else
}
Serial.print("the plants is watered"); delay(100); }
*feel free to raise any doubts in this project
i have a doubt in the project