Hello everybody! Today, I'm going to show you how to make a Arduino moisture meter. You can use this for monitoring water levels in potted plants or in gardens. It's a pretty simple build and had tons of uses, so let's get right in to the build.
Step 1: Parts
For the hygrometer, you will need:
- Moisture Sensor w/ dongle(1)
- Arduino Uno (1)
- Jumpers male-male(several)
- Jumpers female-female (2)
- USB B Cable
Step 2: Serial Printing Hygrometer-Circuit
The first project we'll be doing with the moisture sensor is making a moisture meter that read out in the Arduino serial monitor. The circuit and code for this project is very simple, so that's why there are two separate circuits in this Instructable. Anyway, let's get in to build number one.
- Connect the sensor to the dongle board w/ the female-female jumpers.
- Wire the VCC pin of the dongle to %V.
- Now wire the GND pin of the dongle to one of the many GND ports of the Arduino.
- Connect the A0 pin of dongle to the A0 pin of the Arduino.
Now for the code!
Step 3: Code for Serial Hygrometer
There are tons of basic serial hygrometer programs you can find on the internet, so if for some reason you don't like this program, you can easily find another one or just write on yourself. I also have another version of this project in the works, this time using an RGB LED to display the moisture level. That'll be coming out soon. Thanks for reading and, as always, Happy Making!
Anyway, Here's the code:
const int hygrometer = A0; //Hygrometer sensor analog pin output at pin A0 of Arduino
// When the plant is watered well the sensor will read a value 380~400, I will keep the 400
// value but if you want you can change it below.
value = analogRead(hygrometer); //Read analog value
value = constrain(value,400,1023); //Keep the ranges!
value = map(value,400,1023,100,0); //Map value : 400 will be 100 and 1023 will be 0
Serial.print("Soil humidity: ");