Introduction: Measure Soil Moisture With Sound Amplitudes
In this tutorial, we will explain how to make a device that measures soil moisture with sound amplitudes.
Step 1: Materials
- Particle photon
- Electrical wires
- Jump wires (male and female)
- Sparkfun sound detector
- 5 pins
- Piezzo buzzer element
- Small PVC pipe 2x
- End cap for the PVC pipe (ours is from Pipelife) 2x
- Closing cap for the PVC pipe (ours is shaped like cone) 2x
- Glue and hot glue
- Solder tin
Step 2: Connect the Particle
Connect your particle to your phone and computer. The details are described here: https://docs.particle.io/guide/getting-started/start/photon/
Step 3: Build Your Setup
Before measuring, you need to build your setup.
Glue the end caps to the small PVC pipes. Make a hole in the end cap and insert an electric wire through it.
For both pipes
Take the closing cap and attach the piezo buzzer element to the inside of the cap. Connect this element to the electric wire. Close the PVC pipe with this cap.
Make sure the PVC pipes are completely waterproof. To be sure, put some hot glue around the electric wire on top of the end cap.
Strip the other end of both wires.
PVC pipe 1
Divide the stripped wire into two and solder each of these outlets to a jump wire with a male end. Wrap some ductape around this soldered part, to ensure that the wires will not touch each other.
PVC pipe 2
Take your Sparkfun sound detector and remove the small microphone. Solder two electrical wires to the outlets of where the microphone used to be, see photo for clarification. Solder the other side of these wires to the end of the electrical wire from the second PVC tube.
Solder the 5 pins to the Sparkfun sound detector.
Now there's one building step left. You need some extra wires.
Take three long electrical wires. Cut two male jump wires into two. Strip three of these and solder them to the electrical wires. Cut two female jump wires into two. Strip three of these and solder them to the other end of the electrical wires.
Let's start connecting to the particle!
Step 4: Connect Your Setup to the Particle
First, connect the three electrical wires to the Sparkfun sound detector by using the female outlets of the wires. These need to be placed on GND, VCC and ENVELOPE.
Place the particle on the breadboard.
Connect the male outlets of PVC pipe 1 and of the electrical wires connected to the Sparkfun sound detector to the breadboard as shown on the photos.
Step 5: Code
Go to the website build.particle.io. Make a new app and insert the code as shown in the photos.
A measurement is now taken when the buzzer makes a sound of 1KHz (metingBuzz) and when the buzzer is silent (metingNul). The difference between the two is shown with metingDiff.
Your results while measuring can be seen on the website console.particle.io.
Optional, but practical to get a quick overview, is to send your results of the difference to Google Sheets. This can be done with the website IFTTT.com.
Step 6: Measure!
Fill approximately half a bucket with sand. Place the two PVC pipes (so your buzzer and your sound detector) in the bucket. Make sure the closing taps touch each other!
Fill the bucket a bit more with a thin layer of sand but completely covering the pipes. Tamp the sand a bit.
Now start your measurement! (Flash the code)
Once your metingDiff results seem about equal, pour some water out of a bottle over the sand. The values will drop once the water touches the sensor, and go up when the water is infiltrated more. One of our measurements is included in the photos as an example.
And there it is, your own sensor to measure soil moisture!
We have a be nice policy.
Please be positive and constructive.