gkasprow / Sensor-Box

Multichannel standarized enviorement for home automation and other MQTT applications
18 stars 11 forks source link

soil moisture sensor #13

Open gkasprow opened 5 years ago

gkasprow commented 5 years ago

Some day the water distribution failed - one of the tubes slipped off the filter terminal and plants were not watered for a few days. Another time, I shut down the main water valve by chance and left home for one week. Plants hardly survived. This was my inspiration to build distributed soil humidity monitor. I want to have following features:

So i built simple circuit to check the proof of principle. The schematic is simple: obraz The generator built on the Schmidt inverter generates ~50MHz square wave which is fed to the divider that consists of the capacitance probe and R9. Resulting voltage is rectified and fed to the uPC ADC input. The sensor is piece of FR4 with two long strips, covered by plastic sleeve. This is very simple but has some issues:

gkasprow commented 5 years ago

Frequency stability can be improved by adding crystal generator. But popular low cost oscillators are 25, 48, 50 or 100MHz. And still they cost at least 1$ per piece. But we need plenty of that sensors. We already have hex inverter IC, so let's try to build oscillator out of gates. Here is example circuit obraz borrowed from here. But still, there are not such crystals that run at 80MHz. We need to run ordinary crystal at third overtone. This is example configuration that would do the job obraz. I borrowed it from here In an overtone mode, an additional inductor LI and capacitance CC is required to select the 3rd-Overtone mode, while suppressing or rejecting the fundamental mode. The Lc tank may be located at either input or output of the inverter. However, the Lc tank at the out put is referred, because it helps to clean up all unwanted modes before signal goes through the crystal. We cannot use Schmidt type negator, we need to have linearised inverter which acts as linear amplifier. Finally we end up with something like this: obraz C13 and L2 are tuned at 81MHz, C5 and C12 give together 19pF which is close to 18pF required by the crystal.

jordens commented 5 years ago

Or go the classic 555 route. There are a bunch of boards like that on aliexpress for a $.

gkasprow commented 5 years ago

Yes, but they use very low frequency. And they have accuracy similar to the human finger :) . Some use resistive method which degrade over the time. I have very different soil types around my home so want to measure it "properly". I know that this can be done easier, but FDR probe gives quite good results. I even purchased 2 of them and I'm currently testing it. I like its shape and accuracy and want to build something similar. It inspired me. The circuit is molded in plastic but I assume it works in similar manner as the circuit above. I will calibrate it with various soil types and later on maybe write some paper on my research :)

gkasprow commented 5 years ago

And here is preliminary drawing of the device implementing the features above: obraz obraz

To lower the cost, helical antenna is also integrated with the PCB

gkasprow commented 5 years ago

And here is the proof of the very first concept with single detector circuit; 2018-09-18 21 19 34

muz0k commented 4 years ago

Hi Sir, After two years later, I decide to make one for myself but can not decide if copying the same circuit you build or adding/changing some components with my very limited knowledge of electronics. I want to ask some questions. I just this circuit be more sensitive. If I could ever complete it, it will measure the moisture of hazelnut by sticking two needles(for me they are probes) inside a hazelnut.(I can't find any hazelnut moisture meter, there are meters for almost all other grains.) First: Why didn't you add a resistor (Rs) before crystal? I don't know it is a must but it is said to be lifesaver of crystal. Second: Instead of 27mhz crystal, can I use bigger ones like 30 or 40/50? Does it make circuit better or not? Third: Can I use 74hc04 instead of lvc04? If yes, do I need rearrangement of components?(I hope not) Last one: How about adding MCP3421(18bit adc with I2C)? To make measurement more sensitive(most probably the microcontroller I will use esp32, so much so good) I am really looking forward to hear you as soon as possible. Thanks in advance. adsasd

gkasprow commented 4 years ago

First: Why didn't you add a resistor (Rs) before crystal? I don't know it is a must but it is said to be lifesaver of crystal.

The logic gate already has a resistance which is sufficient in this case

Second: Instead of 27mhz crystal, can I use bigger ones like 30 or 40/50? Does it make circuit better or not?

Actually, there are no 50Mhz crystals. These are ones for smaller frequency that run on usually third overtone. That’s why you need LC circuit. This circuit does not work on 27MHz but on 3*27Mhz

Third: Can I use 74hc04 instead of lvc04? If yes, do I need rearrangement of components?(I hope not)

what's wrong with HC04? I didn't try, but this should work

Last one: How about adding MCP3421(18bit adc with I2C)? To make measurement more sensitive(most probably the microcontroller I will use esp32, so much so good)

This circuit won't benefit anything from 18bit ADC. Temperature stability and the method won't give you accuracy better than a few %. However if you need to detect subtle changes in humidity increasing ADC resolution may help, but don't expect anything better than noise.

muz0k commented 4 years ago

Dear sir, I really thank you for your time and fast answers. I am on adc noice suppression research.

ikotzig commented 3 years ago

Dear Greg,

My name is Ivan Kotzig, I am from Slovakia. I also want to make inexpensive, but above average sensor. I can invest into tooling, as I own a molding company.

Did you advanced further from the above schematics? I was considering a 100MHz circuit I found on Internet, but the components cost about 10 Eur, which is above my intentions.

I am a firmware developer, so I plan to ad an inexpensive CPU to your above schematics. I need 16 sensors connected by wire, not a long distance.

Any information would be welcome. Ivan Kotzig ivantoolsquarecom

100MHz_sensor.pdf

gkasprow commented 3 years ago

The entire design (sch and PCB) is already in the repo. I built the PCB, I also done some FW development but have other priorities right now.

petergzmo commented 3 years ago

The entire design (sch and PCB) is already in the repo. I built the PCB, I also done some FW development but have other priorities right now.

@gkasprow can you tell me where the sch and PCB are located in this repo? I can't seem to find them...

gkasprow commented 3 years ago

it's here https://github.com/gkasprow/Sensor-Box/tree/master/Sensor_Box_Hardware/Sensor-Box/Sensor_Box_LoRa_Flower_Wachdog

ollyboy commented 2 years ago

Your design is very good. Did you do any testing, would be great to see some real world results

gkasprow commented 2 years ago

A batch was produced. I will install them once the spring comes :)

ollyboy commented 2 years ago

if you use mcpl604 and the spare gates you could have 3 sensor circuits, top, middle, lower. This would provide better data and eliminate the possibility of misleading low capacitance paths in soil with organic materials and debris. Also maybe some gain on the output to get 0-3.3v range. Also why the 10k on output, would not <1k be better given micro controller ADC impedance.

ollyboy commented 2 years ago

LT6905 oscillator may be better than xtal for single probe design, cheaper than the xtal,chip,inductor combo

gkasprow commented 2 years ago

@ollyboy This design is good enough. One can make it much more precise, of course. But the question is what you want to achieve. I want to know if my plant is dying or not ;) It's not laboratory equipment. The 10k output resistance does not matter. The ADC S&H circuit needs low impedance and it's provided by a 1nF cap. The S&H circuit draws ns-scale current pulses from the source, if you leave just 1k resistor, it would be far too high. 1nF cap does the job nicely. LTC6905 is fine, but these days chips appear and disappear. It's easier to find replacement for classic crystal or logic gates.

gkasprow commented 2 years ago

Btw, I updated the design. I replaced the CPU with a low-cost RAK module based on Cortex M0. Atmel chip didn't have enough memory to implement LoRa authentication (OTAA). Only ABP worked.

delta77101 commented 1 year ago

Is there any further update on this design? Did you run any tests on your original set of boards? What range of voltages did you end up getting from dry to fully wet soil?

gkasprow commented 1 year ago

Didn't do any other tests. I installed an automatic off-the-shelf irrigation system, so don't care about individual plants' moisture.