Arduino Hygrometer (Moisture Meter) Pt.1

by OnTheBrink in Circuits > Sensors

3268 Views, 20 Favorites, 0 Comments

Arduino Hygrometer (Moisture Meter) Pt.1

1tfof3 (1).jpg

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.

Parts

IMG_0337.JPG

For the hygrometer, you will need:

  1. Moisture Sensor w/ dongle(1)
  2. Arduino Uno (1)
  3. Jumpers male-male(several)
  4. Jumpers female-female (2)
  5. Breadboard
  6. USB B Cable

Serial Printing Hygrometer-Circuit

IMG_0339.JPG
IMG_0338.JPG

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.

  1. Connect the sensor to the dongle board w/ the female-female jumpers.
  2. Wire the VCC pin of the dongle to %V.
  3. Now wire the GND pin of the dongle to one of the many GND ports of the Arduino.
  4. Connect the A0 pin of dongle to the A0 pin of the Arduino.

Now for the code!

Code for Serial Hygrometer

IMG_0342.JPG

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:

/Constants

const int hygrometer = A0; //Hygrometer sensor analog pin output at pin A0 of Arduino

//Variables

int value;

void setup(){

Serial.begin(9600);

}

void loop(){

// 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: ");