Skip to content
MCU Atlas

aquacontrol32: dimmable aquarium LED controller on a plain ESP32

Turn a plain ESP32 into an aquarium light controller: five dimmable LED channels, sunrise and sunset ramps, a web schedule, temperature probes and a display.

Difficulty:IntermediateSource available

What it is

Free MIT-licensed firmware by CelliesProjects ('Cellie') that turns a plain ESP32 into a five-channel dimmable aquarium LED controller: hardware PWM (~1.22 kHz, 16-bit) on GPIO 22/21/17/16/26 through IRLZ44N MOSFETs for 12 V common-anode strips, sunrise/sunset ramps edited from a browser on your Wi-Fi, up to three DS18B20 probes, an optional OLED or touch display, and per-channel moonlight that tracks the real moon phase.

What you need

How hard

Intermediate (MCU Atlas editorial estimate): soldering the five-MOSFET driver stage and 12 V wiring, plus a toolchain pinned on purpose to Arduino IDE 1.8.12 and ESP32 core 1.0.4. The web side is beginner-friendly — the schedule editor runs in any browser on your Wi-Fi.

Photos

The aquacontrol32 home page: five channel bars with brightness, the moon phase and temperature readings. aquacontrol32 web UI, rendered from the project's own interface files; values shown are illustrative sample data, not a real tank. MIT, CelliesProjects/aquacontrol32.
The 24-hour ramp editor: drag time-and-brightness points for one channel, with a live now cursor. aquacontrol32 web UI, rendered from the project's own interface files; values shown are illustrative sample data, not a real tank. MIT, CelliesProjects/aquacontrol32.
The author's live tank controller in daily service — a genuine archived capture, not a local render. Author's live tank controller (salamanders.wasietsmet.nl) via web.archive.org, captured 2026-11-16.

Photos: 1-2 by aquacontrol32 web UI, rendered from the project's own interface files; values shown are illustrative sample data, not a real tank. MIT, CelliesProjects/aquacontrol32.; 3 by Author's live tank controller (salamanders.wasietsmet.nl) via web.archive.org, captured 2026-11-16.

Key Facts

  • Five LED channels dimmed by ESP32 hardware PWM (~1.22 kHz, 16-bit / 65,535 steps, refreshed 100x per second) on GPIO 22/21/17/16/26, each switched by an IRLZ44N logic-level MOSFET for 12 V common-anode strips
  • Browser-based scheduling: up to 50 time/brightness points per channel at 1-minute resolution — linear ramps give sunrise and sunset; one-tap LIGHTS OFF/ON/AUTO override
  • Up to three DS18B20 temperature probes on one wire (GPIO 5) with optional 30-day logging
  • Optional displays: 0.96in SSD1306 OLED (I2C on GPIO 19/23) or 2.8in ILI9341 touch TFT
  • Per-channel moonlight tracks the real moon phase
  • No longer maintained (README note added 2025); last release 2021 (v1.6.8) — pinned to Arduino IDE 1.8.12 + ESP32 Arduino core 1.0.4; the author's successor for modern cores is aquacontrol32-pio
Wiring diagram: five ESP32 GPIO pins (22, 21, 17, 16, 26) each drive one IRLZ44N MOSFET gate through a 100 ohm gate resistor; the MOSFET drains switch the negative legs of 12 V common-anode LED strips and the sources go to ground; GPIO 5 hosts the shared DS18B20 OneWire bus with a 4.7 kOhm pull-up; GPIO 19 and 23 carry I2C SCL and SDA for the optional OLED
How the five LED channels are wired — low-side switching, five times over: each ESP32 GPIO (22, 21, 17, 16, 26) drives an IRLZ44N logic-level MOSFET through its 100R gate resistor, the drain goes to the strip's negative leg, the source to ground, and the 12 V common-anode positive rail ties straight to the strips. GPIO 5 carries the shared DS18B20 OneWire bus (4.7 kOhm pull-up to 3.3 V); GPIO 19/23 are I2C for the optional OLED. Pin facts from the aquacontrol32 firmware defaults (devicePinSetup.h). (MCU Atlas (original diagram))

About This Project

aquacontrol32 is free, MIT-licensed firmware by CelliesProjects ("Cellie") that turns a plain ESP32 into a dimmable controller for aquarium LED lighting. Instead of a plug-in timer clicking your lights on and off, each of the five channels fades smoothly between brightness points you set — so your tank gets a gentle sunrise, a full day, and a slow sunset, every day, on a schedule you edit from any browser on your home network. You can add up to three Dallas DS18B20 temperature probes to watch the water, and a small OLED or colour touch display so the controller shows everything at a glance without a computer. Planted-tank keepers use gradual ramps like this to avoid stressing light-shy fish and to run dawn-to-dusk photoperiods that stubborn algae hates. The trade-off to know up front: the author has moved on to a successor project (`aquacontrol32-pio`, for newer ESP32 Arduino cores) and this original repo is no longer maintained — it builds with the tool versions named below and keeps working on the tank it's installed on. MCU Atlas is not affiliated with CelliesProjects.

Why build it

A mechanical timer gives your aquarium two states: blast and black. Real daylight doesn't work like that, and neither do tanks. Sudden full blast can startle fish and kick off algae spikes; planted aquaria do best with a photoperiod that ramps up and down. Off-the-shelf aquarium dimmers exist, but they cost real money and their schedules live in someone else's app.

aquacontrol32 takes the other road: an ESP32, five MOSFETs, some resistors and an afternoon of soldering (full list below), and the schedule lives on a little web page served by the controller itself. Nothing to install, no account, no cloud — type the controller's address into a browser on your Wi-Fi and you're tuning today's light show. The web interface came from the author's own permanently-installed tank controllers, and it shows: everything you need day-to-day is one click deep.

What you get

Five dimmable channels. Each LED channel (GPIO 22, 21, 17, 16 and 26) is driven by the ESP32's hardware PWM at about 1.22 kHz with 16-bit resolution — 65,535 brightness steps, smoothed a hundred times a second, so fades are genuinely flicker-free. One logic-level IRLZ44N MOSFET per channel does the switching for 12 V, common-anode strips.

A web schedule with real ramps. Up to 50 time-and-brightness points per channel, at one-minute resolution; the firmware interpolates linearly between points, and that interpolation is your sunrise and sunset. A 24-hour graph editor lets you drag the day into shape, with a live "now" cursor. A one-tap override switches all lights OFF, ON, or back to AUTO.

Temperature monitoring. Up to three DS18B20 probes on a single wire (GPIO 5), with names you set yourself, shown on the home page and optional 30-day logging.

A display, if you want one. A 0.96" SSD1306 OLED shows lights and temps (or system data); a 2.8" ILI9341 touch TFT is also supported, backlight included.

Moonlight that follows the real moon. Each channel has a "full moon" brightness, and the firmware dims it by the actual moon phase — a nice night light for the tank that waxes and wanes on its own.

No-fuss Wi-Fi. Credentials in the sketch or one-tap ESPTouch pairing from your phone; clock kept accurate over the internet (SNTP) with your timezone.

Hardware you need

The author's parts list lives in a companion hardware repo (`CelliesProjects/aquacontrol-hardware`), originally written for an ESP8266 predecessor — one trap: that BOM lists a WeMos D1 mini, which is the wrong chip. For aquacontrol32 you need an ESP32; the firmware is developed and tested on the MH-ET LIVE MiniKit ESP32, and any plain ESP32 board with five free output pins works (adjust pins if yours differs).

The essentials: the ESP32 board; five IRLZ44N logic-level N-channel MOSFETs; five 100 Ω gate resistors (one between each ESP32 pin and a MOSFET gate); a 12 V power supply for the strips plus a 2.1 mm barrel jack; a small 5 V regulator circuit (7805, 1N4001 diode, two capacitors) to feed the ESP32 from the 12 V rail; and 4.7 kΩ pull-up resistors for the sensor and display buses. Optional: the SSD1306 OLED, the ILI9341 touch TFT, and up to three DS18B20 waterproof probes. The full line-by-line list with our part links is in the Parts list on the page.

Build and flash

Wiring is low-side switching, five times over: strip positive goes straight to 12 V (common anode), strip negative to the MOSFET drain, MOSFET source to ground, ESP32 pin through its 100 Ω resistor to the gate. Ground the 12 V supply and the ESP32 together. Probes hang off GPIO 5 with a 4.7 kΩ pull-up to 3.3 V; the OLED uses I²C on GPIO 19 (SCL) and 23 (SDA); the TFT has its own pin table in the repo (`tft_board_pins.md`).

Then the firmware — and this is the one place the project's age matters. The repo predates today's ESP32 Arduino cores and is pinned on purpose:

1. Install Arduino IDE 1.8.12 (available from arduino.cc's older-IDE downloads).

2. In Boards Manager, install ESP32 Arduino Core 1.0.4 — not a newer one; newer cores changed the PWM APIs and the build fails.

3. Install the exact libraries the README lists: OneWire (the stickbreaker fork, 2.3.3 — the stock OneWire does not work on ESP32), AsyncTCP 1.0.3, ESPAsyncWebServer 1.2.3, MoonPhase 1.0.0, Task 1.0.0, FFatSensor 1.0.2.

4. Open `aquacontrol32.ino`, put your Wi-Fi name and password in the `wifi_network` / `wifi_password` lines (or skip this and use the ESPTouch app later), and skim `deviceSetup.h` / `devicePinSetup.h` to confirm the pins match your build.

5. Select the board ("MH ET LIVE ESP32MiniKit" if you have it) and set the partition scheme to "Default with ffat" — the schedule and logs live on a flash filesystem.

6. Upload. The first boot formats that filesystem, so give it a minute before worrying.

First run: from flash to first sunrise

1. Get it on Wi-Fi. With credentials in the sketch it just joins. Otherwise open the ESP-Touch app on your phone, pick your network, and the controller pairs itself (it reboots after five unconnected minutes — just power-cycle and try again).

2. Find it. Check your router's client list for the hostname, or watch the display if you fitted one.

3. Log in and lock it. Open the address in a browser; the default login is `admin` / `esp32`. Change that password on the Setup page before anything else — it's a home gadget, but it controls your lights.

4. Set the clock stuff. Same Setup page: timezone and hostname. The clock syncs itself over the internet (SNTP), so ramps happen at real sunrise-time, not boot-time.

5. Name your channels. On the Channels page, rename channel 1–5 to your lights (warm white, RGB channels, whatever you built), pick display colours, and set each channel's full-moon night level.

6. Draw your day. Open the Editor, drop time-and-brightness points for one channel — 08:00 at 0%, 09:00 at 70%, 19:00 at 70%, 20:00 at 0% is a fine first schedule — then copy the idea to the other channels. Upload it as your timer file — the controller stores it on its own flash as `default.aqu` and loads it again at boot — and the file manager can back it up.

7. Test with the override. Hit LIGHTS ON, watch every strip come up, hit AUTO and watch the schedule take over mid-ramp.

8. Probes and logging. On the Setup page, scan for DS18B20 sensors, name them ("tank", "sump", "room"), and switch temperature logging on if you want the 30-day history (it's off by default to spare the flash).

Tips and gotchas

Respect the version pins. Arduino IDE 1.8.12 + ESP32 core 1.0.4 + the exact library versions above. "Update everything and retry" is the single most common way this build fails — newer cores removed the PWM calls this firmware uses.

It's unmaintained, on purpose. The repo's first line says it: "This project is no longer maintained." If you want the same idea on a current ESP32 Arduino core 3.x toolchain, the author's successor is `aquacontrol32-pio`. The original keeps running fine on already-built controllers.

Don't skip the 4.7 kΩ pull-up on the sensor bus. Without it the firmware sees "ghost" DS18B20 sensors. It's the project's own documented known issue.

2.4 GHz Wi-Fi only. The ESP32 radio in this configuration doesn't do 5 GHz networks; if your router bands are split, join the 2.4 GHz one.

Touch sideways? Some ILI9341 boards ship with inverted touch coordinates; there's a one-line `TOUCH_IS_INVERTED` fix in `deviceSetup.h`. Boards with no MISO line have their own switch too (`TFT_HAS_NO_MISO`).

Bricked after a bad flash? Full erase and re-flash (`esptool.py erase_flash`, then upload again) and restore your timer file from the file-manager backup. First boot after any re-flash re-formats flash and is slow — that's normal.

Keep it on your home network. The web login is plain HTTP basic auth with a default password; it was built for a trusted LAN, not the internet. Don't port-forward it.

12 V is 12 V. The strip supply and the ESP32 must share ground, and the MOSFET wiring is low-side — strip negative to drain, never switch the positive leg. Double-check common-anode strips before powering up; addressable strips (the WLED kind) are a different project.

Skill takeaway

The transferable pattern here is bigger than aquariums: an ESP32's hardware PWM channels plus five cheap logic-level MOSFETS is a general-purpose dimmer for any 12 V lighting, and the web interface shows how far a self-hosted settings page can carry a project. Same parts, different goals: our WLED page (/projects/wled-wi-fi-control-for-addressable-led-strips-on-esp32/) does browser-controlled lighting for addressable strips, the solar plant waterer (/projects/plantwatery-solar-esp32-automatic-plant-watering/) automates the rest of the greenhouse, and everything on the ESP32 hub (/esp32/) runs on the same board you just learned to dim.

aquacontrol32: dimmable aquarium LED controller on a plain ESP32

Bill of Materials

Parts list

9 parts · 2 linked

Heads up: some Buy links are affiliate links. If you buy through one, MCU Atlas may earn a small commission at no extra cost to you. It never changes which parts we list. How this works

5× IRLZ44N logic-level N-channel MOSFET

No verified link — check the original project

5× 100R gate resistor

No verified link — check the original project

1× 12 V power supply sized for your strips + 2.1 mm barrel jack

No verified link — check the original project

1× 7805 regulator + 1N4001 diode + 0.22 uF/0.1 uF capacitors (5 V rail)

No verified link — check the original project

3× 4.7 kOhm resistor (OneWire + I2C pull-ups)

No verified link — check the original project
No verified link — check the original project
No verified link — check the original project

Not included: Addressable (WS2812-class) strips are NOT what this drives — 12 V common-anode strips only; the WLED project is the addressable-strip route, Nothing to buy beyond parts: the web interface is served by the controller itself — no app, no account, no cloud

Download CSV

Related Projects

WLED: Wi-Fi control for addressable LED strips on ESP32
Illustration
ESP32
The go-to firmware for WS2812B-style LED strips on ESP32: 100+ effects, sound-reactive audio built in, browser installer, Home Assistant support, stable 16.0.1.
Beginner·Code
4 parts listed
Plantwatery: solar ESP32 automatic plant watering
Illustration
ESP32
A solar-powered, 3D-printed ESP32 watering system that checks soil moisture twice a day and pumps water as needed.
Beginner·Code
7 parts listed
ESP32 pool controller: automated filtration and solar heating over MQTT
Illustration
ESP32
Turn an ESP32, a relay module and two temperature probes into a set-and-forget pool controller: automated filtration, solar heating and MQTT for Home Assistant.
Intermediate·Code
8 parts listed