lh84 / moisture_sensor_esp12

capacitive moisture sensor with ESP8266 (Wifi), powered with 18650 battery (already tested)
Other
8 stars 3 forks source link

Tested? #2

Closed theopensourcerer closed 7 years ago

theopensourcerer commented 7 years ago

This is almost identical to something I have wanted to design for ages now. Thanks for sharing :-)

I have an ESP-12F in my polytunnel recording Temperature and Humidity over MQTT and my job for this winter was to build some moisture sensors too.

Can I ask if you have tested the circuit design and PCB layout yet? I am very tempted to order a few boards from Oshpark and try it out.

lh84 commented 7 years ago

Hi theopensourcerer, the design is not tested yet. I want to build and test the project over the next months during winter time :) I will update the project here as soon as I get new results. But if you want to contribute pease feel free to test everything and please let me know if you find a better solution.

theopensourcerer commented 7 years ago

I bought a couple of the simple Giesomat Sensor kits and have built one but I don't think it is working. Maybe my soldering was rubbish :-(

I have three designs of sensor to test but ultimately I want the same thing as you. A single board with the ESP and the sensor electronics. I may order a board or two of your design from Oshpark and see how they get on.

I grow chillies :-D What is your plant of choice?

theopensourcerer commented 7 years ago

Hi again,

I bought 74HC14 for my breadboard to test the circuit design before committing to building a PCB...

What frequency is the output of the Schmitt trigger on your board? On a quick test on a breadboard I am seeing around 200KHz. I can't imagine an ESP8266 being able to (reliably) measure at that speed as there are no h/w timers available?

lh84 commented 7 years ago

Hi, I didn't have enough time at the moment and work on it. Can you read German? As mentioned here --> http://www.mikrocontroller.net/topic/369582 you can increase the resistor to decrease the frequency. Let me know if it is working

theopensourcerer commented 7 years ago

Interesting - so a 1M R seems to drop the frequency down to ~50Khz or so. I'm still not sure if this kind of speed is easily read by the ESP. And I also wonder if slowing it will reduce the resolution of the sensor at all?

The other sensor I like (a stripped down version of the CHIRP) has a tiny Attiny441 AVR on the sensor stick which runs code to convert frequency to i2c. I am beginning to think this might be a better solution...

https://github.com/Miceuz/i2c-moisture-sensor

theopensourcerer commented 7 years ago

Alternatively, there is a sensor from a Chinese company called DFROBOT which uses a similar technique to the Giessomat but it has a very simple circuit which looks like it converts the frequency to an analogue voltage. I have one of these sensors too and it works. (I do not understand how it works but it does work).

At the bottom of this page are links - one is to the schematic for the sensor... It is very simple :-)

https://www.dfrobot.com/wiki/index.php/Capacitive_Soil_Moisture_Sensor_SKU:SEN0193

lh84 commented 7 years ago

hi @theopensourcerer did you test it with changing just the resistor?

theopensourcerer commented 7 years ago

Sort of ;-) I don't have an oscilloscope - am using piscope on my Raspberry pi and I am not really sure if it made any difference in all honesty. I am going to (hopefully if I get some time) try a few things over the Christmas break.

Like a simple halfwave rectifier, which is what the DFROBOT sensor uses as a digital to analogue converter. And also there is some code here https://github.com/Zentris/erdfeuchtemessung, also in German, which I do not understand and can't get to compile but it does seem to work, from what I can gather using Google Translate, in reading fairly high frequencies directly.

lh84 commented 7 years ago

The author of https://github.com/Zentris/erdfeuchtemessung told me this morning (here http://www.mikrocontroller.net/topic/335407?goto=4834987#4834987), when you change the resistor to 200K the frequ changes to around 120kHZ which the ESP can handle.

Above 150kHZ the ESP crashes.

I will update the schematic at weekend and will replace the R2 with a trimmer potentiometer till 500K.

Am 20.12.2016 um 10:12 schrieb Alan Lord notifications@github.com:

Sort of ;-) I don't have an oscilloscope - am using piscope on my Raspberry pi and I am not really sure if it made any difference in all honesty. I am going to (hopefully if I get some time) try a few things over the Christmas break.

Like a simple halfwave rectifier, which is what the DFROBOT sensor uses as a digital to analogue converter. And also there is some code here https://github.com/Zentris/erdfeuchtemessung, also in German, which I do not understand and can't get to compile but it does seem to work, from what I can gather using Google Translate, in reading fairly high frequencies directly.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

theopensourcerer commented 7 years ago

Cool - that is encouraging.

FYI: I did manage to do one test today which was to pass the frequency output of the schmitt trigger through a very simple halfwave rectifier (one diode, one small capacitor and one resistor). I then fed this into a MCP3202 A/D converter just so I could read the result on my Raspberry Pi (over i2c). That also seemed to work as an alternative method. The ultimate idea being you pass the frequency through the rectifier and straight into the ADC pin of the ESP8266.

lh84 commented 7 years ago

Hi @theopensourcerer now I tested the board. And it works really well. I change some details and added a trim resistor (500KΩ) to adjust the output frequency to around 150 KHz (max). See the new images in readme.