Elektroda.com
Elektroda.com
X
Elektroda.com

Wireless soil moisture sensors

Sareph 3852 12
This content has been translated » The original version can be found here
  • Wireless soil moisture sensors
    Since my girlfriend is a flower freak, she marked something to stick in the ground, forget about the fact that it is in the ground for a few months and in the meantime find out about how much water is in the ground (aka "when it's best to water" ), preferably via WiFi. With WiFi, nothing came out, because in total everything that uses WiFi has electricity consumption from space, and we want to have about half a year of work on a 300-400mAh battery. An option was still BLE (nRF52), but it also dropped out due to little convenience.
    It ended up with the STM32F030 paired with the LT8920. The STM does not need to be introduced, and the LT8920 is a 2.4GHz radio transceiver, the main advantage of which is the small number of additional elements needed, all two capacitors and a 12MHz crystal are needed. In addition, the power consumption in sleep at the level of 6uA and the cost of 25 cents apiece. But there is no rose without thorns, the range is ok in practice, but it could be better: about 1-2 concrete walls, and terrible documentation.

    The humidity measurement is performed by the capacitive method:

    Wireless soil moisture sensors Wireless soil moisture sensors Wireless soil moisture sensors

    2.4MHz PWM signal with 30% duty cycle is fed to the input of the measuring system. After passing through a filter consisting of PCB tracks, any ambient water and R2 is flattened. We are interested at the moment what is more or less the maximum level after filtering, and this can be measured by a maxima detector composed of D1 (it is actually 4148 diode, there was no corresponding symbol in the eagle at hand), C1 and R3. After that, even a not too fast ADC and the determination of voltage levels in dry and wet environments for calibration is enough.

    Wireless soil moisture sensors

    Charging via mini USB socket using TP4057, stabilization to 3V is provided by HT7530-7, both in SOT23-5 housings. The peak current consumption during measurement / transmission is about 60mA, 22mA in reception, and in sleep mode it does not exceed 30uA. Measurement / shipping takes place once every 5 minutes, it takes about 55ms. This theoretically should allow you to work with a 400mAh lipo battery for about 8 months, taking into account the 3% self-discharge and without considering the manual listening mode.

    Wireless soil moisture sensors

    The system has one button, the operation of which differs depending on the holding time:

    * single press - immediate measurement and sending the current data in the packet (LED blinking)
    * hold for 3s - the system goes into the listening mode, it allows you to remotely switch to the bootloader and upload new firmware via the radio or read data live via the control unit, possibly also changing the parameters (LED flashing every 1s)
    * hold for 10s - reset + bootloader input for 30s (LED blinking 3xs)

    Currently, there is no other option to turn off data traffic than disconnecting the battery. But I think that changing the STM32F030 to F07x would give the option to configure via USB, useful in case of some very wrong settings. This, however, maybe in the next version, the current one works quite well for our needs.

    Wireless soil moisture sensors

    When measuring soil moisture, the system also measures battery voltage, optionally temperature (NTC), and USB voltage during charging.

    A clock is used to collect data from sensors:

    Wireless soil moisture sensors

    Built on STM32F107 (and 18 matrix displays 8x8 20 / 1.9mm), it has an Ethernet port, several sensors specifying the parameters of the environment in which it is located and a transciver on the LTC8920 which allows it to exchange data with sensors.

    Wireless soil moisture sensors

    But this one will be described more precisely as my darling will do something meaningful with his WebUI ;)

    Cool! Ranking DIY
    Can you write similar article? Send message to me and you will get SD card 64GB.
    About Author
    Sareph
    Level 23  
    Offline 
    Sareph wrote 531 posts with rating 275, helped 54 times. Been with us since 2004 year.
  • #2
    khoam
    Level 39  
    Sareph wrote:
    2.4MHz PWM signal with 30% duty cycle is fed to the input of the measuring system.

    I understand that the fill and frequency of this signal is constant? What was the dictated choice of these parameters?
  • #3
    Sareph
    Level 23  
    khoam wrote:
    I understand that the fill and frequency of this signal is constant? What was the dictated choice of these parameters?
    Yes, she was. I experimented with the widest measuring range, in this case 2100 by 12bit ADC.
  • #4
    398216 UsuniÍty
    Level 43  
    How do you protect the tile against moisture?
  • #5
    Sareph
    Level 23  
    398216 UsuniÍty wrote:
    How do you protect the tile against moisture?
    I did not protect, the solder mask is water resistant, and the FR4 does not absorb it. One thing I did not mention - the sensors will get housings at a free moment so that an accidental clearing does not hurt them, but most of the flowers get water in the saucer, so they will not be hurt either way. ;)
  • #6
    gkalfail
    Level 6  
    A very nice design. Congratulations!

    I am interested in what is the matter with the antenna. Is it just a 1/4 wavelength piece of wire? You don't need any impedance adjuster or something like that? Any requirements for wire thickness, pcb etc?

    (As you can see after the questions, I immediately "set myself on fire" to use LT8920 in my project. I have never done anything RF, especially on 2.4GHz, and I think that a project with this chip could be my first in this plot :D )
  • #7
    Jogesh
    Level 28  
    And what's the range in open space? Didn't you prefer to use the 'L' series Prock. They are more energy efficient.
  • #8
    Sareph
    Level 23  
    gkalfail wrote:
    A very nice design. Congratulations!

    Oh, thank you.

    gkalfail wrote:
    I am interested in what is the matter with the antenna. Is it just a 1/4 wavelength piece of wire?
    Exactly.

    gkalfail wrote:
    You don't need any impedance adjuster or something like that? Any requirements for wire thickness, pcb etc?
    As I wrote, the documentation for the circuit is impaired and contains absolutely no hints as to what this circuit likes best for its antenna. And the sample layout in the documentation looks like this:

    Wireless soil moisture sensors

    Sometimes they even forgot to rename the chips, because the documentation sometimes refers to LT8900 or 8910, it looks like someone took the documentation from one of them, called it from 8920 now and didn't even do a search & replace to replace all the names.

    Also, I chose the simplest solution, 1/4 length wire as close to the layout as possible and it works. It seems to me that somewhere on the Internet I saw a circuit on this transceiver with the antenna connected through one capacitor and pulled to ground with a 10k resistor, but that would be it.

    gkalfail wrote:
    (As you can see after the questions, I immediately "set myself on fire" to use LT8920 in my project. I have never done anything RF, especially on 2.4GHz, and I think that a project with this chip could be my first in this plot :D )
    Don't be shy, it looks pretty cool on paper, and really 3 additional elements and it works. Although I doubt very much about the 200m range, it is very easy to use, even with this impaired documentation. ;)

    Added after 3 [minutes]:

    Jogesh wrote:
    And what's the range in open space?
    I haven't checked. But * it seems to me * that with the minimum speed and maximum power (which is not entirely known how to set it up, because such good documentation) it could be 100m.

    Jogesh wrote:
    Didn't you prefer to use the 'L' series Prock. They are more energy efficient.
    Apparently so, but all in all F0 are always on hand, so instead of ordering Lki specifically for this, I took what I have in stock. And so it turned out to be energy-saving than the initial assumption of charging every six months. ;)
  • #9
    pier
    Level 23  
    The + 12V symbols on the diagram are probably an error?

    Have you been using these sensors for a long time? I am asking because I have been testing my version for several months and I noticed that the soil around the sensor can loosen and falsify the results.
    The phenomenon is more troublesome if we water the flowers directly into the pot.
  • #10
    Sareph
    Level 23  
    pier wrote:
    The + 12V symbols on the diagram are probably an error?

    Yes, I copied this fragment from another schematic where it was actually 12V and it just stayed that way.

    pier wrote:
    Have you been using these sensors for a long time? I am asking because I have been testing my version for several months and I noticed that the soil around the sensor can loosen and falsify the results.
    About a month and I noticed something like this, but it does not happen by itself, but for example pressing a button can slightly move the sensor and change the indicated value by half. The problem is sufficiently solved by tamping the ground around the sensor, at least enough that there is no problem with connecting the cable / disconnecting the usb, as long as it is delicately. ;)
  • #11
    .:KoSik:.
    Level 18  
    Very nice design.
    Some time ago I made a similar project but powered by CR2032. It has been working on one battery for 4 months without a noticeable drop in voltage, so it should last a little longer.
    In my project, I approached the measurement itself a bit differently, but I will not describe it again (here: https://www.elektroda.pl/rtvforum/topic3681817.html

    As for loosening the soil, it happens for me right after planting the sensor. After 2-3 weeks, slight sideways movements will not affect the measurements.

    Skoda that you have not uploaded graphs from measurements from a longer period. You could then see what the stability of the measurements is.

    best regards
  • #12
    Sareph
    Level 23  
    .:KoSik:. wrote:
    Very nice design.
    Oh, thank you.

    .:KoSik:. wrote:
    Some time ago I made a similar project but powered by CR2032. It has been working for 4 months on one battery without a noticeable drop in voltage, so it should last a little longer.
    I was wondering about 2032, but with the peak consumption of about 60mA, I found that I would not test how they would behave and I would take a safe option. ;)

    .:KoSik:. wrote:
    In my project, I approached the measurement itself a bit differently, but I will not describe it again (it is here: https://www.elektroda.pl/rtvforum/topic3681817.html).
    Hmm, I think that I could use this method and check if there is any difference.

    .:KoSik:. wrote:
    Skoda that you did not upload charts with measurements from a longer period. You could then see what is the stability of the measurements.
    Because there is no record of long-term data yet, as I will probably complete it.
  • #13
    kaczodp
    Level 12  
    Sareph wrote:
    khoam wrote:
    I understand that the fill and frequency of this signal is constant? What was the dictated choice of these parameters?
    Yes, she was. I experimented with the widest measuring range, in this case 2100 by 12bit ADC.

    The D1 diode disturbs the measurements a bit. This method of measurement was used in analog meters. Capacitance can be measured by measuring the pulse time, not the voltage. The diode is not needed and the measuring range is wider. STM32 can measure time in hardware so the program is simple.

    Added after 1 [minutes]:

    pier wrote:
    The + 12V symbols on the diagram are probably an error?

    Have you been using these sensors for a long time? I am asking because I have been testing my version for several months and I noticed that the soil around the sensor can loosen and falsify the results.
    The phenomenon is more troublesome if we water the flowers directly into the pot.

    Because measuring soil moisture is not such a simple matter. Measuring capacitance alone will not help here. Try to measure the water capacity, add salt and the result will change and it shouldn't. Therefore, a good sensor (the sensor itself) costs about PLN 150.