A comprehensive guide for building and configuring your own Arduino Mega-based aquarium controller.
"ArduAqua began as a personal mission to automate the daily routines of my aquariums. Over the years, it has evolved into a reliable system that manages multiple tanks in my home. I am sharing this documentation to provide other hobbyists with a transparent, functional, and fully customizable DIY solution."
Scheduled automatic execution of stored events and tasks.
Instantly trigger dosing, dimming, or switching at any time.
Map sensors and actuators to any available I/O pin with support for custom 8-character names.
7 PWM channels with "13Bit" resolution and adjustable frequency (125Hz-1kHz).
All settings managed directly on the device. No PC or App required.
Automatic state recovery after power failure and integrated temperature-based heater protection.
A visual guide to the control layout and display states.
ArduAqua is operated via a simple control panel with 4 buttons.
The top row displays the weekday, current time, and water temperature.
The bottom row cycles through status messages (dimming, heating, alerts) while showing current light intensity.
Adjust the LED brightness instantly using the UP and DOWN keys—no menu navigation required.
The LCD backlight automatically dims during inactivity to reduce ambient light and save power.
During a warning or error, the display flashes to ensure critical issues are noticed immediately.
Complete documentation of the on-device configuration and control structure.
Trigger stored tasks (Dosing, Dimming, Switching, Curve Override) immediately.
View countdown and details of the next upcoming task.
Add, edit, or remove custom 11-point curves. Assign curves to physical PWM ports.
Adjust frequency (125Hz - 1000Hz) to match your LED driver specifications.
Configure the relay that provides mains power to your LED drivers.
Trigger auxiliary tasks (fans, CO2) before or after lighting cycles.
Define the port state when the LED power is turned off.
Set global alarm thresholds for Tank and Sump sensors.
Assign physical ports to Tank, Sump, and Ambient sensors.
Configure heater port, active state, and switching logic.
Calibrate the internal temperature sensor of the DS3231 RTC.
Give your physical ports custom names (8 chars) for better readability.
Configure the starting port, pump count, and active state (HIGH/LOW).
Measure actual flow rates (ml/min) for precise fertilization.
Set the high-precision DS3231 real-time clock.
ArduAqua is built using standard, widely available electronics components. No proprietary hardware is required.
These ports are reserved for specific hardware functions. Most other pins can be freely assigned in the menu.
| Function | Mega Pin(s) |
|---|---|
| LCD Display (via Shield) | 4, 5, 6, 7, 8, 9, 10 |
| Buttons | A10 - A13 |
| LED PWM (7 Channels) | 2, 3, 11, 12, 44, 45, 46 |
| All Other Pins | Freely assignable for Sensors, Pumps, Relays, etc. |
A self-made button module is required. Standard LCD shield buttons use resistor coding which is too imprecise and doesn't support the hardware interrupt needed to wake the device from standby.
Most DS18B20 sensors on the market are clones. ArduAqua can detect these and displays 'B' (Backup/Clone) or 'O' (Original) in the info menu. Both work, but originals are more precise.
For 230V wiring, consulting an electrician is mandatory. Cheap modules often have dangerously small isolation distances; look for PCBs with physical cutouts. Also note that high inrush currents from switching power supplies can 'weld' relay contacts shut over time.
Control up to 16 pumps. The system handles calibration automatically: just measure the output once, and ArduAqua calculates the exact timings for your required dosage.
Written in C++ for AVR, the firmware uses a non-blocking event loop and hardware interrupts for high-priority tasks. Settings are stored in the external AT24C EEPROM (RTC module) to minimize wear on the Mega's internal memory.
ArduAqua uses a "13Bit" resolution (0-8000) for ultra-smooth transitions. You can create curves by defining points or simply by entering an exponent.
| Dim-Level (%) | PWM "13Bit" | Duty-Cycle (%) | Precision Gain |
|---|---|---|---|
| 0% | 0 | 0 | - |
| 10% | 50 | 1 | +30 |
| 20% | 232 | 3 | +8 |
| 30% | 566 | 7 | -6 |
| 40% | 1066 | 13 | -26 |
| 50% | 1741 | 22 | +19 |
| 60% | 2600 | 33 | +40 |
| 70% | 3650 | 46 | +30 |
| 80% | 4897 | 61 | -17 |
| 90% | 6345 | 79 | -25 |
| 100% | 8000 | 100 | - |
F:
A:
A unique feature: you can define a 'Rest State' for PWM ports. Optocouplers can age when kept active for long periods (often necessary to keep a light 'OFF' depending on the driver). By cutting the main LED power via 'Pre-/Post-Start Tasks', the PWM signal can be set to a non-aging state without turning the lamp on.
Visualized Exponential Curve (Gamma 2.2)
avrdude -v -p atmega2560 -c wiring -P COM3 -b 115200 -D -U flash:w:arduaqua.hex:i