Brian Dorey's Allotment Gets Remote Moisture Sensor with a Raspberry Pi Pico and Semtech SX1262
Solar-powered and transmitting readings over LoRa, this sensor system ties in to Home Assistant to avoid wasted watering trips.
Web developer Brian Dorey has brought some handy technology to bear on getting the most out of his allotment — working with his brother Andrew to add Raspberry Pi Pico-powered soil moisture monitoring with a LoRa backhaul to the plot.
"In our polytunnel we have two raised beds where we grow a variety of salad fruit and vegetables and shelves with pots to grow seedlings," Dorey explains. "In the summer months we go to the allotment to water the plants every other day. However, depending on the temperature, we don't always need to add water to the plants, so being able to remotely monitor them would be a useful addition to our Home Assistant smart home system, saving unnecessary trips. Our allotment is approx 1,000 meters (0.6 miles) from our home with almost direct line of sight apart from a few trees blocking the view."
The brothers opted for a simple off-the-shelf capacitive moisture sensor — a PCB you insert into the soil and that provides an analog signal corresponding to the moisture in the ground — as the data source for the system, but needed a way to get it off-site so they could check the status before making a trip to the allotment for watering. The solution: a Rasbperry Pi Pico microcontroller board linked to a Semtech SX1262 LoRa expansion module for long-range low-power data transmission to the nearby house. Finally, an ePaper display provides easy local monitoring — and everything runs from a custom PCB designed to fit into a weatherproof project box.
"Power is provided by a 10W solar panel from Amazon which has a 5V output connected to the PCB," Dorey adds. "We only want sensor data to be sent when it is daytime, so a solar panel was the easiest option. We considered using batteries but don't want to risk any battery overheating or fire problems as the high daytime summer temperatures and low winter temperatures at night could damage lithium batteries. The power consumption of the board is around 22mA while the [Raspberry Pi] Pico is idle, rising to 100mA for three seconds while the sensors are read and then dropping back to 25mA while the data is transmitted through the LoRa radio and the ePaper display is updated."
The transmissions are received by a Raspberry Pi Pico W — a model which adds a Wi-Fi and Bluetooth radio alongside the original Raspberry Pi Pico's RP2040 microcontroller — with SX1262 add-on located in the loft of Dorey's nearby house. This connects to the home Wi-Fi network and automatically posts received data to an MQTT broker for use in Home Assistant dashboards.
The project is documented on Dorey's website, with source code and KiCad project files for the PCB available on GitHub under the permissive MIT license.