A lit saltwater reef aquarium with live coral, rockwork, and a soft blue-green light
|

Build a Neptune Apex for Your Reef Tank on an ESP32 — For $100

Every serious reef keeper has hit the same wall: the commercial controllers that watch temperature, pH, and salinity are either locked behind a subscription, a phone app that stops working, or a price tag that scales with how many pumps you own. Neptune Apex is the name every reef tank runs into — and for a long time it meant “buy a $600 brain and a $300 sensor per parameter.” This is how to build the same thing for under $100, on an ESP32, with no cloud lock-in.

The design goal is simple and deliberate: monitor first, automate second, and split those two concerns cleanly. A sensor that only reads is safe — it can’t kill a tank. A relay that switches a chiller or a doser can. So the whole architecture is organized around a hard line between the sensing layer and the actuation layer, with a safety tier that can kill everything even when the main controller is down. That split is what makes a $100 box trustworthy enough to babysit a $3,000 tank.

A lit saltwater reef aquarium with live coral, rockwork, and a soft blue-green light
The kind of tank this build watches: a lit saltwater reef. Photo by Sabhyata Sahu, Pexels License.

What the system watches

For a saltwater reef tank the four parameters that actually matter are temperature, pH, salinity, and (strongly recommended) ORP. Alkalinity and low-water level are the two I’d add before trusting anything else to the loop. Each maps to a cheap, well-understood sensor:

  • Temperature — a waterproof DS18B20 over 1-Wire, or a PT100 for better accuracy. Poll every few seconds.
  • pH — a glass probe on an HX-511 front-end, reading 0.5–10.0 with roughly +-0.1. This is the one that needs real care: calibration and auto-zero.
  • Salinity — a NTRIG TDS probe. You don’t measure specific gravity directly; you measure dissolved solids and the module temperature-compensates it into a salinity/SG figure.
  • ORP — a platinum electrode on a JJ200 amplifier for redox and water-health signal.
  • Alkalinity / KH and level — optional, but the level sensor is the one safety device that earns its keep.

The reason this works on a microcontroller is that every one of these is either an analog voltage on the ESP32’s ADC, an I2C/SPI device, or a 1-Wire read. No proprietary protocol, no app, no account.

Dark-themed system architecture diagram: ESP32 core with cyan sensing layer, green actuation layer, amber comms, and a rose safety tier, with arrows showing data flow
System architecture: ESP32 core with a sensing layer, actuation layer, comms, and a safety tier. Original diagram by Ivy Byte.

The architecture: two layers, one brain

The schematic above is the whole thing, and the thing you should take away is the color coding. Cyan is the sensing layer — everything that only reads and is therefore harmless. Green is the actuation layer — chiller, pH doser, salt/feed doser, and switched sockets, the parts that can actually do something to the tank. Amber is comms, rose is the safety tier, and the purple box in the middle is the ESP32 running the firmware that is, functionally, your Apex.

Everything in the tank feeds the ESP32 over a single analog/I2C bus. The ESP32 does the thinking: it polls the sensors, runs the PID loops for cooling and dosing, serves a local web UI off its own Wi-Fi, and publishes the same data out over MQTT to Home Assistant or a small broker. From there the numbers land on a phone dashboard, a graph, and — when something leaves a safe band — a Telegram alert. This is the local-first part that matters: the loop closes on your LAN, and the cloud is just a mirror for the alert, not the thing the tank depends on.

The safety tier is the point

A commercial controller is expensive partly because you’re paying for the part that fails correctly. So the safety layer in the diagram is not an afterthought; it’s a separate, independent path that does not trust the main processor:

  • Power loss → hold the last-known-safe state, not an arbitrary default.
  • Over-temp or low-pH → shut the chiller and doser off rather than fighting a bad reading.
  • Low water level → stop the dosers. A doser running dry on an empty sump is the classic tank-killer.
  • Independent contactor → the pumps and lights run through a contactor that can be thrown by the safety tier alone, so a bricked microcontroller can’t strand a chiller in a frozen tank.

That last item is what I would never skip. It’s the difference between “my controller crashed and I lost the tank” and “my controller crashed and the tank survived until I got home.”

Dark-themed wiring and pin-map diagram: ESP32 DevKitC with GPIO pins on the left, relay and sensor connections on the right
Wiring and pin map: ESP32 GPIO pins, relay outputs, and sensor inputs. Original diagram by Ivy Byte.

The wiring, made boring on purpose

The pin map is the part that decides whether this lives or dies. The rule is opto-isolation between the 3.3 V logic and every 12 V load. Sensors ride the analog inputs and I2C; the relays ride their own board with a common ground tied back to the ESP32 at a single point; and anything that drives a mains or 12 V socket goes through an opto-isolated solid-state relay with its own fuse. Two habits keep it boring: fuse every switched circuit, and keep a manual master switch you can throw by hand.

Calibration is the maintenance you can’t automate away: keep the pH and TDS standard buffers (pH 4 / 7 and 1000 ppm TDS) by the tank, log the readings, and auto-zero after each service. A probe that drifts is worse than no probe, because a confident wrong number is more dangerous than an alarm.

Dark-themed bill-of-materials table listing ESP32, sensors, relays, power, and safety components with approximate prices totaling about $98
Bill of materials: ESP32, sensors, relays, power, and safety hardware, roughly $98. Original graphic by Ivy Byte.

What it costs

The bill of materials is in the graphic, but the short version is the point: the controller, every sensor, the relays, the dosers, the power, and the safety hardware come to around $98. Add a chiller and a five-gallon sump for a full reef build and you’re at a few hundred — still a fraction of an equivalent commercial system, and with none of the recurring cost.

Firmware: the part you actually write

The ESP32 firmware is the Apex. In practice this is ESPHome or Arduino doing sensor polling and PID, publishing to MQTT, with Home Assistant (or Blynk) on the other end for the dashboard and a Telegram bot for the alerts. The firmware has one job the hardware can’t do: decide, on a schedule, what “in band” means and what the safe action is when something leaves it — with hysteresis so it doesn’t thrash a pump on and off every second.

Bottom line

You can build a monitoring-and-automation system that does what a Neptune Apex does for a reef tank, for under $100 of parts, on an open microcontroller, with no subscription and no cloud lock-in. The design that earns the trust is the one that’s boring: a sensing layer that can’t hurt anything, an actuation layer that’s opto-isolated and fused, and a safety tier that fails the tank toward survival. That’s the whole trick — and the reason a $100 box can babysit a $3,000 tank.

Similar Posts