Long-range wireless water tank level monitoring using LoRa (RYLR998), ESP32, and a cloud dashboard. Monitor multiple tanks from up to 5km away with no WiFi needed between sensor and receiver.
LoRa 865/915 MHz (up to 5km)
=========================>
TRANSMITTER RECEIVER
ESP32-C3 SuperMini ESP32 DevKit v1
+ SR04T Ultrasonic + RYLR998 LoRa
+ RYLR998 LoRa + SH1106 1.3" OLED
+ 18650 Battery + WS2812B LED
+ Solar (optional) + WiFi
|
+-----------+-----------+
| |
MQTT over TLS Web UI
| 192.168.x.x
+---------+---------+
| |
Home Assistant TankSync Cloud
(auto-discovery) tanksync.smartghar.org
- Long Range: RYLR998 LoRa module, 5km+ line of sight
- Multi-Tank: Support up to 10 transmitters per receiver
- Low Power: Transmitter deep sleeps between readings (configurable 1-1440 min)
- Local Display: SH1106 1.3" OLED on receiver shows tank levels, battery, signal
- Web UI: Built-in configuration interface on the receiver (WiFi, MQTT, LoRa, OTA)
- Home Assistant: Native MQTT auto-discovery integration
- TankSync Cloud: Web dashboard with push notifications, multi-tank monitoring, QR device linking
- MQTT over TLS: Secure communication between receiver and cloud (port 8883)
- OTA Updates: WiFi OTA for receiver, LoRa OTA relay for transmitter
- Captive Portal: Auto-redirect WiFi setup on iOS, Android, and Windows
- Remote Config: Push sleep interval and sample count to transmitters over LoRa
- Email Verification: Resend API + Cloudflare Turnstile on signup
- Auto MQTT Provisioning: QR code scan auto-configures receiver's cloud MQTT connection
| Component | Part | Approx. Cost |
|---|---|---|
| Receiver MCU | ESP32 DevKit v1 (or ESP32-C3 SuperMini) | $4-8 |
| Transmitter MCU | ESP32-C3 SuperMini | $3 |
| LoRa Module | REYAX RYLR998 (x2) | $8 each |
| Ultrasonic Sensor | JSN-SR04T / AJ-SR04M (waterproof) | $4 |
| Display | SH1106 1.3" OLED I2C | $3 |
| Battery | 18650 LiPo + protected holder | $2.40 |
| Solar charger | CN3791 MPPT (replaces TP4056 for solar TX) | $1.45 |
| Boost converter | MT3608 3.7V β 5V | $0.60 |
| Power monitor (optional) | INA219 over I2C | $1.45 |
Total: ~$46-63 per complete system (entry vs premium SKU)
π Detailed wiring diagrams, pin connections, and power chain β Includes block diagrams for both DevKit-RX and C3-RX, full TX power chain with solar charging, and both power-monitoring variants (voltage divider vs INA219 over I2C with auto-detect).
π Full BOM β
Download the latest .bin files from Releases.
# Receiver (ESP32 DevKit)
esptool.py --chip esp32 -b 460800 write_flash 0x10000 tanksync-receiver-vX.Y.Z.bin
# Receiver (ESP32-C3 SuperMini)
esptool.py --chip esp32c3 -b 460800 write_flash 0x10000 tanksync-receiver-c3-vX.Y.Z.bin
# Transmitter (ESP32-C3)
esptool.py --chip esp32c3 -b 460800 write_flash 0x10000 tanksync-transmitter-vX.Y.Z.binPrerequisites: ESP-IDF v5.4+
# Receiver (ESP32 DevKit)
cd firmware/receiver
idf.py build
idf.py -p /dev/ttyUSB0 flash
# Receiver (ESP32-C3)
cd firmware/receiver-c3
idf.py set-target esp32c3
idf.py build
idf.py -p /dev/ttyACM0 flash
# Transmitter (ESP32-C3)
cd firmware/transmitter
idf.py set-target esp32c3
idf.py build
idf.py -p /dev/ttyACM0 flash- Receiver starts in AP mode -- connect to the
TankSyncWiFi network - A captive portal opens automatically (or navigate to
192.168.4.1) - Configure your home WiFi credentials, MQTT broker, and LoRa settings
- Transmitter auto-pairs on first boot -- press the "Start Pairing" button in the receiver web UI
A web dashboard for monitoring your tanks from anywhere. Use the hosted version or self-host your own.
Hosted: tanksync.smartghar.org -- sign up, scan the QR code from your receiver's web UI, and your tank data flows to the cloud automatically.
Self-host:
cd pwa
npm install
cp .env.example .env # Edit with your MQTT broker and API keys
npm run build
npm start # Runs on http://localhost:4800Features: multi-tank monitoring, push notifications, QR code device linking, email verification, dark/light themes, historical charts.
See pwa/deploy/ for production deployment with systemd and Nginx.
The receiver publishes auto-discovery messages via MQTT. Tanks appear automatically in Home Assistant as sensor entities.
firmware/
receiver/ ESP32 DevKit receiver (MIT)
receiver-c3/ ESP32-C3 receiver variant (MIT)
transmitter/ ESP32-C3 transmitter (MIT)
pwa/
server/ Fastify + SQLite server (self-host) (AGPL-3.0)
server-cloud/ Fastify + PostgreSQL server (cloud deploy) (AGPL-3.0)
client/ React + Tailwind frontend
deploy/ Systemd, Nginx, and deploy scripts
hardware/ BOM and hardware designs (CC BY-SA 4.0)
docs/ Documentation and images
.github/workflows/
build-firmware.yml Automated firmware builds on tag push
deploy-cloud.yml CI/CD deploy to DigitalOcean on push
- Firmware: Push a version tag (
git tag v2.2.0 && git push origin v2.2.0) to auto-build all 3 firmware binaries and create a GitHub Release - Cloud: Push changes to
pwa/on main to auto-deploy to the production server via SSH
Transmitter -> Receiver: TANK:<dist_cm>:<bat_pct>:<bat_v>:<msg_id>:<fw_ver>
Receiver -> Transmitter: ACK:<msg_id>
Config Downlink: SET:SLEEP=<seconds>:SAMP=<count>
Pairing: PAIR_REQ / PAIR_ACK:<addr>:<name>
- MQTT over TLS (Let's Encrypt certificates, auto-renewing)
- Per-user MQTT credentials with topic-level ACL
- Cloudflare Turnstile captcha on signup
- Email verification via Resend API
- Rate limiting on auth endpoints (5 register/min, 10 login/min)
- JWT tokens with 30-day expiry
- Security headers (X-Frame-Options, CSP, HSTS via Cloudflare)
- UFW firewall, fail2ban, SSH key-only deploy
| Component | License | Details |
|---|---|---|
Firmware (firmware/) |
MIT | Free for any use |
Cloud App (pwa/) |
AGPL-3.0 | Must share source if hosted as a service |
Hardware (hardware/) |
CC BY-SA 4.0 | Attribution + ShareAlike |
Contributions are welcome! Please open an issue or pull request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes
- Push to the branch
- Open a Pull Request
Ravi Singh - YouTube
Built with ESP-IDF, React, Fastify, and a lot of late nights.


