DIY Electric Soil Finger

by Sverd Industries in Circuits > Arduino

5289 Views, 140 Favorites, 0 Comments

DIY Electric Soil Finger

introbilde.jpg

Today I'm going to show you how to make your own electric soil finger!

What's an electric soil finger you say? Allow me to explain: This is a sensor for measuring the amount of water in plant soil. This will then in turn show you whether or not it's time to water your plants, or if they are very much happy with the amount of water they have right now!

The inspiration for this was that I was constantly sticking my fingers in my plants dirt to learn if I needed to water them. However, this only gave an idea of the water on the very top layer of soil, no good!

I wanted a deeper and more quantifiable measurement and thus the Electric Soil Finger was born.

If you like this project click the VOTE button in the upper right corner!

Let's get started!

Parts and Tools

20160620_161245_HDR.jpg
20160620_165423_HDR.jpg
20160620_173721_HDR.jpg

You are going to need the following:

Parts:

Tools:

  • Soldering iron
  • Wire strippers
  • Wire cutters
  • Pen

How It Works

20160620_161919_HDR.jpg
20160620_162107_HDR.jpg

The code works by reading sensor values and based on these reading the position of the servo is set.

The moisture sensor gives analog variations in voltage which is read by the arduino. Arduino has a resolution of 0 to 1023 for reading analog values.

After calibrating my sensor to completely dry and completely wet soil, I found my sensor readings vary from 0 - completely dry, and 720 - completely wet.

Sensor readings are scaled from 0 to 720 to the possible servo positions which are between 0 and 180 degrees.

Normally analog values vary slightly each millisecond. If these variations are directly translated to servo positions, the servo will jitter and not settle in a smooth position.

I remedied this phenomenon by always taking in 10 sensor readings and calculating their average, before setting the servo position based on the sensor values. This worked great and the servo is much smoother!

Soldering

20160620_165716_HDR.jpg
20160620_170243_HDR.jpg
20160620_170252_HDR.jpg
20160620_170333_HDR.jpg
20160620_161353_HDR.jpg
20160620_170559_HDR.jpg
20160620_170921_HDR.jpg
20160620_172120_HDR.jpg

The moisture sensor has three pins. These are connected to 5 V, GND, and Analog Input 1 from the arduino. If your sensor only has to pins you need to create a voltage divider. Connect the two pins in series with a 1k ohm resistor. Now connect one end of the series to 5 V and the other end to GND. Connect a wire from the middle of the series junction to analog input 1, and you've created a sensor that varies voltage based on readings!

A servo has three wires and these are usually yellow, red, and brown. The signal wire is yellow and is connected to pin 3 on the arduino. The red wire is positive voltage and is connected to 5 V, and the brown wire is the ground pin and is connected to GND on the arduino.

I chose to connect the servo to pin 3. What matters here is that the servo is connected to a PWM pin which is usually indicated by a tilda (~) or a circle around the pin.

The female DC jack is soldered to either pin RAW or pin VIN. Both are different names for unregulated voltage input. This input can usually vary between 5 and 12 volts which gives you a lot of different options for powering your soil finger!

Calibrating and Uploading the Code

20160620_175512_HDR.jpg
20160620_161925_HDR.jpg
20160620_175954_HDR.jpg
20160620_162113_HDR.jpg
20160620_171032_HDR.jpg
20160620_171125_HDR.jpg

You might need to calibrate you sensor, but most moisture sensor will give values in the same range as specified in the code. First, stick your sensor in really dry earth, open the serial terminal and check the values. For me this was 0. Now completely moisten your soil or stick your sensor in a glass of water. Read the values written in the serial terminal, for me this was around 720.

These are the values you need to enter in line 5 and 6 in the arduino sketch to calibrate your sensor.

Choose the "Arduino Pro or Pro Mini", connect the USB cable to the FTDI select your port and upload the code!

Now you just load the program on to the arduino. If you are using an arduino pro mini with a FTDI programmer, insert the FTDI the right direction into the arduino. Check the pictures to see the right direction. Or you can try both directions, it is just one way that will light up the on board LED on the arduino, so that's a quick way to check.

Downloads

Wrapping It Up

20160620_172600_HDR.jpg
20160620_172756_HDR.jpg
20160620_173021_HDR.jpg
20160620_173028_HDR.jpg
20160620_173123_HDR.jpg
20160620_173251_HDR.jpg
20160620_173343_HDR.jpg

I wanted the complete package to have a compact look so I was thinking about 3D printing an enclosure. However, I also wanted this project to be easily replicated this meant a 3D printer or CNC would be out of the question. I needed something compact, cheap, and easy to do. Then inspiration struck me!

I could just tape everything tightly together! One component was done at the time. I held down a component and did a tight circle of electrical tape around it to keep it in place. This is the order everything was taped down with the servo as the base:

  1. Arduino pro mini to the top of the servo
  2. Sensor wires to the back of the servo
  3. Female DC jack to the side of the servo
  4. Loose wires were coiled and taped to the top of the servo and the arduino

Adding a Gauge

20160620_174159_HDR.jpg
20160620_174404_HDR.jpg
20160620_174646_HDR.jpg
20160620_175201_HDR.jpg
20160620_175252_HDR.jpg

A servo has 180 degrees of movement. This was used to create a gauge out of cardboard to tell the water level.

I started by cutting out a piece of cardboard that would grip the servo tightly. Then, within 180 degrees I drew on a sun symbol indicating dry soil, and a water droplet indicating wet soil. I also added a few indicator lines between these symbols to show just how dry or wet the soil is.

Be sure and choose the location of your symbols after checking what side the servo points to if the sensor is in a glass of water.

I removed the servo needle and pressed on the cardboard. It's a good idea to secure the cardboard with a dab of hot glue on the backside so it wont slide off.

After attaching the cardboard you can fasten the servo needle again. Move the servo head completely to one side and attach the needle pointing to this side, to ensure the needle isn't skewed while moving around.

Finished! Final Thoughts

20160620_180107_HDR.jpg
20160620_175844_HDR.jpg

That's it, now you've got a precise way of knowing whether your plants need more water of they're satisfied!

Now if you're anything like me you'll run around and check all the plants you can!

If you like this project click the VOTE button in the upper right corner!