Build your own Tank Watch

If you're comfortable with basic electronics and can follow a wiring diagram, you can have your tank monitored in an afternoon. This guide covers everything — parts, wiring, firmware, and first-time setup.

Parts list

  • ESP32-C3 SuperMini — the brains. Small, low power, built-in WiFi.
  • JSN-SR04T — waterproof ultrasonic distance sensor. Measures water level from the top of the tank.
  • Weatherproof enclosure — IP65 rated box large enough to fit the ESP32 and sensor cable gland.
  • USB power supply — 5V USB-A adapter, or a USB power bank for off-grid use.
  • M12 cable gland — for sealing the sensor cable where it enters the enclosure.
  • Basic tools — drill, hole saw for the sensor mount, cable ties.

All parts available locally (Jaycar, PB Tech) or cheaply from AliExpress. Typical build cost: $30–60 NZD.

Wiring overview

The JSN-SR04T connects to the ESP32-C3 with four wires:

Sensor wireESP32-C3 pin
VCC (red)5V
GND (black)GND
TRIG (yellow)GPIO4
ECHO (blue)GPIO5
Full wiring diagram →

Set up in 5 steps

  1. Flash the firmware — download the latest release and run firmware/flash.sh. Needs arduino-cli.
  2. Wire up the sensor — connect VCC, GND, TRIG (GPIO4), and ECHO (GPIO5). See the full wiring diagram for an ASCII layout.
  3. Mount and seal — sensor head points down through the tank lid. Minimum 25 cm of clearance above the water surface for accurate readings. Use a cable gland where the cable enters the enclosure.
  4. Connect to WiFi — power on the device, connect your phone to its PihaTankWatch-XXXX WiFi network, enter your home WiFi credentials in the captive portal page.
  5. Claim in the app — tap Open Piha Tank Watch in the captive portal (or go to app.pihatankwatch.nz), sign in, and enter your tank name, depth, and capacity. Done.

Common DIY questions

Does the sensor work on plastic tanks?

Yes. The JSN-SR04T is a non-contact ultrasonic sensor — it measures from the top of the tank down to the water surface, so tank material doesn't matter.

What's the minimum water depth the sensor can measure?

The JSN-SR04T has a 25 cm blind zone below the sensor head. Mount it so the sensor is at least 25 cm above the full water line.

Can I run it on battery / solar?

Yes — it runs from a USB battery bank or a solar + LiPo setup. The default build stays powered between readings, so for long unattended runs it's best paired with mains or solar top-up. Deep-sleep firmware to stretch off-grid battery life is available as an opt-in build for self-builders — it's experimental and not yet validated on battery hardware, so for now still pair it with mains or solar.

My WiFi doesn't reach the tank — what can I do?

A WiFi repeater or a PowerLine adapter are the simplest options. The device only needs to connect briefly once per reading interval, so marginal signal often works fine.

Ready to build?

Create your free account before you start — you'll need it to claim the device once it's online.

Create free account