Build An Hygrometer Using Arduino

I am building an automated irrigation system for my vegetable patch. This will be a system that monitors the soil moisture level and then turns on a pump to send water to my garden according to the detected moisture level.

The water is coming from our rainwater tank, there is also an overflow on the tank that Iā€™ve redirected to the garden (both the vegetable and ornamental gardens) so that water isnā€™t just sluiced off into my neighbors property. Itā€™s been doing that since before we bought the property.

Arduino HygrometerThis instructable is about one fairly simple part of the project, the soil moisture monitor.

For this instructable, youā€™ll need:

  • 1 x Hygrometer (I bought mine from eBay)
  • 1 x Arduino (Iā€™m using a UNO)
  • 3 x LED (Red, Green, Blue)
  • 3 x 220 ohm
  • 1 x 10k ohm resistor
  • jumper wires

Step 1: Wire it up

There are three bits that are important in this project.

Connect the Hygrometer to Analog 0 (A0) on the Arduino, it doesnā€™t matter which side of the Hygrometer is connected to A0.

This connection also passes through the 10k Ohm resistor to 5V (we are splitting the load). It is the difference in load that the Arduino will detect on A0.

The other pin on the Hygrometer connects to GND on the Arduino.

If thatā€™s as far as you go ā€¦ youā€™d be done, of course you wouldnā€™t be able to see any Blinky lights ā€¦ but thatā€™s OK.

If you want to have a visual monitor of the moisture level, then youā€™ll be wanting some LED.

Iā€™ve used pins 13 (RED), 12 (GREEN) and 11 (BLUE) in my sketch, you can use others if you want ā€¦ I wonā€™t oppress you.

Connect Pin 13 to the anode of the red LED (long leg)

Connect a 220 ohm resistor between the red LED cathode (short leg) and to GND

Connect Pin 12 to the anode of the green LED (long leg)

Connect a 220 ohm resistor between the green LED cathode (short leg) and to GND

Connect Pin 11 to the anode of the blue LED (long leg)
Connect a 220 ohm resistor between the blue LED cathode (short leg) and to GND

Thatā€™s it ā€¦ youā€™re all wired up.

Arduino Hygrometer SchematicStep 2: Arduino Sketch

The guts of the sketch simply reads the value on A0, works out if the value falls within a predefined range (0 ā€“ 400 = Dry, 400 ā€“ 700 = Moist and 700 + = Wet).

It also turns the appropriate LED on and off according to the same range.

Because I have grand plans of connecting the device to a controller at some later stage, Iā€™m also sending the output to Serial.

The entire sketch is very simple ā€¦ even I can understand it šŸ™‚

The video simply shows the monitor transitioning between states of Dry/Moist/Wet ā€¦ with my ham fists in the action.

Oh, yeah ā€¦ please excuse my colour blindness ā€¦

 

For more detail: Build An Hygrometer Using Arduino

 


About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation and engineering. My writing style is clear and simple, and I am skilled in using infographics and diagrams. I am a great researcher and am able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter
Scroll to Top