To watering the garden, when away, could be difficult. And, to know, whether the plants needs water too. I use a cistern and immersion pump. To control the need of watering, this sensor measure soil moisture, temperature etc., send the data via 433 MHz to a bridge. The bridge in turn, send the data to the apple HomeKit. At this way, i can decide to start the immersion pump and watering the garden.
- data transmission
After messing around with Wifi and BLE, I decided to use 433 MHz connections for better coverage. The sensor itself stands on the ground between plants (many obstacles and signal reflections). Without obstacles, ISM band communication works up to 500 meters - that's nice.
- powering
I want this units battery-powered and rechargeable. In my case, it's enough to get fresh values each 30 minutes. Between that, the unit should "deep sleep". The SAMD21 based boards have an internal and an external oscillator. Using the external, more precise oscillator, i have seen spontaneous RTC freeze. So i modified the RTCZero lib to use the less precise, but more stable internal oscillator OSCULP32K. Along this, the sensor unit goes into deep sleep between the measurements. At least, without charging the unit works around 6 months.
- sensor selection
Using the sensor outside, it's a good idea to select a capacitive sensor for measuring soil humidity like the "DFRobot Soil Moisture" or the SHT31 sensor with more accurate values, working via I2C. Other types, especially simple resistor bases sensors are rotten in some weeks.The environment values (temperature, air humidity) measured in this example by AM3202/DHT22 sensor. Later, i replace this sensor by the more accurate BME280 sensor( I2C interface too).
Additionally, to have the sensor unit outside, at all weather conditions, in minimum a IP67 case is needed to prevent water/humidity inside the electronic case.
- bridge side
My bridge based on a Raspberry Pi Zero W and the RFM69 breakout board. (meanwhile I have 3 different sensor units with vis versa communication threads. I changed from Pi Zero W to Pi 3B+, because of using python threading/multiprocessing on the bridge for faster communication. The single core Pi Zero did not support that.)
On the Pi the RFM69 breadboard using the following Pins:
- Vin to Raspberry Pi 3.3V
- GND to Raspberry Pi Ground
- RFM G0 to Raspberry Pi GPIO #24
- RFM RST to Raspberry Pi GPIO #25
- RFM CLK to Raspberry Pi SCLK = GPIO #11
- RFM MISO to Raspberry Pi MISO = GPIO #9
- RFM MOSI to Raspberry Pi MOSI = GPIO #10
- RFM CS to Raspberry Pi CS1 = GPIO #7
It's a good idea to use a external antenna for better signal coverage here too.
At least, with a distance of 10 meters - through thick walls, plants and obstacles i got a RSSI of 65. (RFM69 transceiver power: 17, can be increased up to 20)
Against the default CPython RFM69 adafruit driver, I use DIO 0 interrupt to detect incoming data. See my project page on GitHub, how the bridge work. For the 433 MHz communication i use:
http://www.airspayce.com/mikem/arduino/RF69/
At least, the bridge log:
- supplement:
Additionally, i transcode the javascript based FakegatoHistory into Python to get a history view in the fantastic eve-app:
Comments