Moisture Sensor Project

19,411

Circuit Image

The goal is to create a final package that is as inconspicuous as possible, without any visible wires or adapters. This necessitates powering the project with a small battery. To conserve energy, the ATMega (or potentially the ATTiny) will be placed in deep sleep mode and will wake up approximately every 30 minutes to measure moisture levels, transmit data, and then return to sleep. A button may be included to allow for additional measurements, although it is uncertain if the ATMega can remain in deep sleep while monitoring for button presses. Concerns about battery life led to an exploration of the feasibility of using a small battery, specifically a CR2032, to power a JeeNode, which successfully transmits data using an RFM12B transmitter. A moisture sensor circuit is essential, and a temperature sensor is preferred due to its influence on moisture readings. Multiple units of this setup are needed, all adhering to criteria of being inexpensive, compact, and water-resistant, while also being easy to duplicate and modular, utilizing available 9V batteries. The chosen enclosure is constructed from standard PVC water pipe, featuring a mounted RJ11 T-Adapter at one end, which serves as a mounting point for a 6-pin header connected to the Jeenode. The header is not electrically connected but provides a physical connection point. Wires are soldered to male 6-pin connectors with necessary resistors, particularly for a DS18B20 one-wire temperature sensor. There is a noted relationship between temperature and the resistance of soil/water. Initial testing involved a DS18B20 sensor to record temperature, revealing interesting data trends overnight, with both temperature and moisture/resistance graphs showing declines. A more refined graph was later uploaded, showcasing packet transmission data over time. The new setup demonstrated a stabilization in resistance readings compared to the initial setup, although the resistance values were not consistently stable.

The circuit design features a microcontroller (ATMega or ATTiny) that operates in low-power mode, significantly extending battery life by reducing power consumption during inactive periods. The microcontroller is programmed to periodically wake up, perform moisture and temperature measurements, and transmit this data wirelessly via the RFM12B module. The use of a CR2032 battery, known for its compact size and capacity, ensures that the device remains unobtrusive.

The moisture sensor circuit can be designed using resistive or capacitive methods, with the DS18B20 temperature sensor providing accurate temperature readings that can be correlated with moisture levels. The implementation of a button allows for manual triggering of additional readings, though this may require careful consideration of the microcontroller's sleep mode capabilities to avoid excessive power draw.

The enclosure, crafted from PVC pipe, provides durability and water resistance, essential for outdoor applications. The RJ11 T-Adapter serves a dual purpose: it not only facilitates physical connection for the Jeenode but also allows for easy access to additional sensor connections if required. The soldering of male 6-pin connectors ensures a secure and reliable connection for the sensors.

The data transmission is managed by the RFM12B module, which operates on low power and is capable of sending data packets at regular intervals. The timing of these packets, set at approximately every 12 seconds, allows for continuous monitoring while conserving battery life.

The relationship between soil moisture and temperature is critical for accurate readings; thus, the design incorporates both sensors for comprehensive environmental monitoring. The observed variations in resistance readings highlight the need for calibration and stabilization of the sensor setup, particularly when using larger electrodes that may affect soil conductivity.

Overall, the design emphasizes modularity, ease of duplication, and efficient power management, making it suitable for widespread deployment in various agricultural or environmental monitoring applications.I want the final package to be as invisible as possible, and without any wires / adapters / etc. Obviously that requires me to run this project from a small battery. To preserve power, I`m thinking about putting the ATMega (eventually probably the ATTiny) into deep sleep, and wake it up once every 30 minutes or so. Let it sense the moisture level, send out a package, and go back to sleep again. Probably a button too, to trigger an extra measurement (if that`s feasible without having to keep the ATMega out of deep sleep to continually watch for a button press. ). As I was worried about battery life, and if this could even be done with a small battery (I plan on using a CR2032), I started a different topic to first see if it would be feasible.

Turns out it`s possible to run a JeeNode off of a CR2032, and let it send packages over the RFM12B transmitter (thanks JCW, and everyone else who helped out)! I`ll be needing at least a moisture sensor circuit of course, and preferably a temperature sensor as well.

As the temperature influences the reading from the moisture sensor. I will be needing dozens of these - or similar enclosures. Same criteria: cheap, small, water resistant. Add to that: easy to duplicate, modular and use the hundreds of 9v batteries I have at my disposal. So, I needed something easy to access. Here is what I settled on: (see attached) It`s a made from standard pvc water pipe. I mount a RJ11 T-Adapter in the endcap on one end that I get from from Monoprice. I pop off the back of the adapter and mount a little 6-pin header for the Jeenode to "plug in". It`s not connected to anything. Just serves as a mounting point. The wires I solder up to some male 6-pin connectors with whatever resistor is required right from the T connector wires. This one happens to be for DS18B20 one-wire, so there`s a resister under the black glob (Liquid Tape - I love this stuff!).

If I need to use the other ports, I just do the same thing to the other end. I was told that there is a relationship between the temperature and the resistance of the ground/water. Yesterday evening/night I hooked up one of the DS18B20 sensors, so I could measure temperature as well.

Program is far from finished, and has some weird scales (hey, I wrote it between 2:00 a. m. and 3:00 a. m. , give me a break ;-), however it is interesting to see that overnight both the temperature graph and the moisture/resistance graph show a little drop! I guess the temperature has a larger influence than I thought. A screenshot of the graphs is attached of course. The horizontal axis shows the number of packets plotted (roughly a packet every 12 seconds). Packet transmission started around 3. 00 a. m. and the screenshot was taken around 10. 00 a. m. Edit 16:20: I`ve uploaded a better graph, which doesn`t have the messed up scale. The negative range on the horizontal axis is from 3. 00 a. m. to 10. 00 a. m. , the positive range is for another few hours during the day. This resulted in some unexpected behavior. I`ve added a screenshot of my simple plotting application. Red(temp) and Blue(moisture) are from the initial setup (dead plant :-), and yellow(temp) and green(moisture) are from the new setup with the living plant.

The resistance in the new setup took some time to "stabilize". Don`t know why that is. Perhaps it is due to the big nails that I`m using, with the "head" still on and going in the soil first (thereby creating a somewhat larger "hole" than required). The resistance of the new setup was only half compared to the old setup. I`ve added 400 in the graph, just to make it look better, but it started out in the 450-ish (with the first setup being in the 850-ish) and stabilized in the 550-ish (still 300 lower!) The resistance readings aren`t very constant.

The first setup returned pretty constant values, but the ne 🔗 External reference