5. Usage
With
Arduino
This is a summary of the moisture sensor which can be used to detect the moisture of the soil.
When the soil moisture deficits, the sensor output value will decrease. You can know whether a
plant needs water or not by observing the results that the sensor outputs. The following sketch
demonstrates a simple application of sensing the moisture of the soil.
Connect this module to one of analog port A0 of
cable, and then insert the Sensor into the soil or place it anywhere you want.
Plug Grove - Base Shield into the Arduino/Seeeduino and connnect Arduino to PC via a USB
cable.
The hardware installation as shown
Note:This sensor isn't hardened against contamination or exposure of the control circuitry to water
and may be prone to electrolytic corrosion across the probes, so it isn't well suited to being left in
place or used outdoors.
Copy and paste code below to a new Arduino sketch.
int sensorPin = A0;
// select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
Grove - Base Shield
below:
6
with the 4 pin Grove
Need help?
Do you have a question about the Grove Moisture Sensor and is the answer not in the manual?
Questions and answers