Skip to content

Techposts/TankSync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TankSync — reliable smart water monitoring

Firmware: AGPL-3.0 Hardware: CC BY-SA 4.0 ESP-IDF Home Assistant

Never worry about your water tank again. A solar-powered sensor on the rooftop, a quiet hub on the wall, and smart water monitoring that keeps working — even when the internet doesn't. Long-range LoRa (RYLR998) to an ESP32 hub, local web UI, Home Assistant via HACS, optional cloud PWA. Open at the core.

Populated TX PCB (open hardware) BSP-threaded sensor mount installed on a tank lid (current production)

Custom circular TX PCB and current-production PETG enclosure (REV 2.2, May 2026) — tested through Delhi summer at 45°C ambient.

Try the in-browser flasher first

👉 tanksync.smartghar.org/firmware/

No esptool, no Python, no CLI. Plug your board into USB, click Install, the browser does the flashing through WebSerial. Works on Chrome/Edge desktop. Takes ~45 seconds per board.

Why TankSync — engineered to be reliable, not just smart

Most "smart tank" products treat the cloud as the product. TankSync treats reliability as the product — and the cloud as an optional layer of polish on top.

  • Works fully offline. Hub keeps showing levels, lighting the LED ring, and beeping on overflow — even when your WiFi, your ISP, or our cloud is down. Local operation is the default; cloud is opt-in.
  • Long-range LoRa, no rooftop WiFi. Sensor talks to the hub over 865 MHz LoRa — through concrete walls, between floors, across a property. Up to 5 km line-of-sight. The rooftop doesn't need WiFi. Ever.
  • Solar-powered transmitter. Mounts on the tank lid. Charges in regular daylight, runs on a single 18650, deep-sleeps between readings. Months of autonomy. No wires to the tank.
  • Home Assistant native. Auto-discovery via MQTT plus a dedicated HACS integration — every tank shows up as an HA device with live sensors, fill events, and editable settings.
  • Open at the core. Firmware (AGPL-3.0), hardware (CC BY-SA 4.0), schematics, BOM, and flashing tools are all public. Self-host it. Fork it. Modify it. Audit it. No vendor lock-in.
  • Built for Indian realities. Designed and tested through Delhi summer (45 °C ambient). UV-stabilised PETG, IP65 sealing, monsoon-ready. Engineered for terrace tanks, high-rise apartments, thick walls, and unreliable connectivity.

Architecture

                    LoRa 865/915 MHz (up to 5 km, through walls)
                    ==============================================>
  TRANSMITTER                                          HUB (RECEIVER)
  ESP32-C3 SuperMini                                   ESP32 DevKit
  + JSN-SR04T Ultrasonic                               + RYLR998 LoRa
  + RYLR998 LoRa                                       + SH1106 OLED
  + 18650 + solar                                      + WS2812 LED ring
                                                       + WiFi (optional)
                                                          |
                                              +-----------+-----------+
                                              |                       |
                                       MQTT (TLS)              Local web UI
                                              |              192.168.x.x
                                    +---------+---------+
                                    |                   |
                              Home Assistant      Cloud dashboard
                              (HACS integration)  (optional, hosted)

Hardware

Component Part Approx cost (INR)
Receiver MCU ESP32 DevKit v1 ₹300–400
Transmitter MCU ESP32-C3 SuperMini ₹200
LoRa module REYAX RYLR998 (×2) ₹650 each
Ultrasonic sensor JSN-SR04T (waterproof) ₹350
Display SH1106 1.3" OLED I²C ₹250
Battery Protected 18650 + holder ₹200
Solar charger CN3791 MPPT module ₹120
Boost converter MT3608 3.7 V → 5 V ₹50

Total: ~₹3,800-5,200 per complete system (one hub + one tank). Per-tank addition: ~₹1,500.

📐 Detailed wiring + power chains → 📋 Full BOM →

Quick start

Option 1: Browser flasher (easiest — no install)

👉 tanksync.smartghar.org/firmware/

Plug your board into a USB port, pick the right card (Receiver Hub or Transmitter), click Install. Done in ~45 sec.

Option 2: esptool.py (CLI)

Download the latest .bin from Releases.

# Receiver (ESP32 DevKit)
esptool.py --chip esp32 -b 460800 write_flash 0x10000 tanksync-receiver-rx-vX.Y.Z.bin

# Transmitter (ESP32-C3 SuperMini)
esptool.py --chip esp32c3 -b 460800 write_flash 0x10000 tanksync-transmitter-tx-vX.Y.Z.bin

Option 3: Build from source

Prerequisites: ESP-IDF v5.4+

# Receiver Hub
cd firmware/Receiver-ESP32-DevKit
idf.py build
idf.py -p /dev/ttyUSB0 flash

# Transmitter
cd firmware/Transmitter-IDF
idf.py set-target esp32c3
idf.py build
idf.py -p /dev/ttyACM0 flash

First boot

  1. Hub starts in AP mode → connect to TankSync-XXXX WiFi from your phone
  2. Captive portal opens (or visit 192.168.4.1)
  3. Configure home WiFi + (optional) MQTT broker + LoRa settings

What you'll use it through

Two surfaces — pick either, or both. They show the same data.

TankSync PWA dashboard (phone) Hub local web UI (any device on the same Wi-Fi)

Left: the PWA at tanksync.smartghar.org — works from anywhere. Right: the hub's local web UI — works fully offline. Full walkthrough in the Wiki.

  1. Transmitter pairs over the air — hold its BOOT button for 2 sec, hub LED turns green when paired

Photos of a real build

Bare PCB, fresh from fab Populated PCB, angled view Opened case showing internals + antenna

Lid with integrated solar panel pocket BSP-threaded sensor mount on a test tank lid Close-up of the sensor-mount nut + thread

More photos + STL files for the case + schematics + 3D STEP models: hardware/.

Home Assistant integration

Two routes — pick whichever fits your setup:

  1. Native MQTT auto-discovery — the hub publishes auto-discovery topics; tanks appear in HA as sensor entities with zero setup beyond pointing HA at the same broker. Read-only.
  2. HACS integration: SmartGhar — full bidirectional control. Every tank is an HA device with grouped Sensors / Events / Configuration / Diagnostic entities, plus a hub device with buzzer + LED controls. Capacity, sleep interval, samples-per-wake are editable from inside HA and ride the same MQTT command channel as the PWA, so both stay in sync.

HACS listing — SmartGhar v0.8.0 Integration overview — 3 devices, 41 entities Tank device page — info + sensors Sensors + Events + Configuration Configuration + Diagnostic — editable from HA

HACS repo: github.com/Techposts/smartghar-homeassistant · Full setup + entity reference: HACS Integration wiki page

What's NOT in this repo (and why)

This is the open-source TankSync firmware + hardware mirror. The hosted cloud dashboard (PWA at tanksync.smartghar.org) is a separate proprietary product that adds:

  • Remote access from anywhere (no port forwarding)
  • Push notifications to your phone
  • Multi-tank history + insights
  • QR-code device linking
  • Multi-hub fleet management for societies, farms, hotels

The firmware works fully without the cloud — local web UI on the hub gives you tank levels, settings, OTA updates, Home Assistant integration. Cloud is opt-in convenience, never a dependency.

Licenses

Component License What this means
Firmware (firmware/) AGPL-3.0 Free for personal + community use. Commercial users who modify and distribute must also open-source their changes under AGPL.
Hardware (hardware/) CC BY-SA 4.0 Attribution + ShareAlike. Build it, sell it, modify it — credit the source and share-alike.
HA Integration MIT (separate repo) Frictionless for HA ecosystem.

Why AGPL on firmware? It keeps TankSync open for hobbyists and HA users while preventing commercial vendors from repackaging the firmware into a closed product. If you want a non-AGPL commercial license for embedded use, reach out to the maintainer.

Contributing

Issues and PRs welcome. Read the wiring guide before opening hardware-related issues.

Author + brand

Ravi Singh (@ravis1ngh on YouTube) — solo-building open-source home infrastructure in India under the TechPosts Media / SmartGhar banner. Design, firmware, hardware, PCB layouts, and 3D-printed enclosures — all done in-house.

TankSync is part of the SmartGhar ecosystem (smartghar.org) — calm, local-first smart-home infrastructure engineered for real-world Indian deployments.

About

Solar-powered long-range water-tank monitor — LoRa to an ESP32 hub with OLED + LED indicators. MQTT-native + Home Assistant integration via HACS. Open firmware (AGPL-3.0), open hardware (CC BY-SA 4.0). Works fully offline; hosted PWA optional. First product in the SmartGhar ecosystem.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors