emcniece / rak-mqtt-soil-monitor

A solar-powered MQTT soil moisture and temperature monitor, featuring RAKwireless Wisblocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RAKWireless MQTT Soil Monitor

This project features RAKWireless boards and modules (mini base board with solar and LiPo power, soil moisture probe, temperature/humidity sensor) that publishes state over MQTT. Designed for integration with Home Assistant.

Hardware

Software

Arduino Boards

Add these URLs to the "Additional board manager URLs" in the Arduino IDE preferences:

https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless_index.json
https://raw.githubusercontent.com/RAKwireless/RAKwireless-Arduino-BSP-Index/main/package_rakwireless.com_rui_index.json

Following this you can search for "RAKwireless ESP32 Modules" (or keyword: RAK11200) in the board manager, then install.

Arduino Libraries

Setup

  • Install Arduino boards via manager
  • Install Arduino libraries via manager (or download and import .zip)
  • Solder male header pins into BOOT and GND

Programming

The RAK11200 ESP32 module has a BOOT pin that must be pulled to GND to enable upload/programming mode. The RAK19003 Mini Base Board exposes this pin on the edge headers. A wire may be used to short BOOT and GND, or you can solder male header pins and use a jumper (provided with the base board kit) to enable boot mode. A small SPST tactile pushbutton switch can be soldered to leads of female headers, creating a dedicated boot switch.

Example boot switch using female headers and SPST pushbutton RAK19003 mini base board with ground and boot pins highlighted

Programming sequence:

  1. Hold BOOT switch / short BOOT pin to GND
  2. Press reset button
  3. Release BOOT switch / disconnect BOOT-GND short
  4. Click "upload" from Arduino IDE
  5. Wait for Hard resetting via RTS pin... log line
  6. Press reset button again

Now your ESP32 module should be running your code. Open the Arduino IDE serial monitor at 115200 baud to view printed output.

References & External Documentation

ToDo

  • Cleaner MQTT publishing method (wrap string formatting and serial printing)
  • Low-power operation
  • Soil moisture sensor
  • Improved battery measurement curve
  • MQTT topic updatable from MQTT message
  • Linting & tests

About

A solar-powered MQTT soil moisture and temperature monitor, featuring RAKwireless Wisblocks

License:MIT License


Languages

Language:C 84.2%Language:C++ 15.8%