Hardware and mounting
- An arduino microcontroller with WiFi and enough pins to support a neopixel string, OLED, and digital thermometer.
- An Adafruit NeoPixel strip long enough to make four passes across the length of the aquarium.
- A DS18B20 temperature probe.
- A 128 × 64 SSD1306 OLED
- A 1 × 2 × 30-inch wooden board supporting the lights, with cling wrap holding the folded strip against it. The controller and display sit on a breadboard zip-tied above the lighting board.
The original staple-mounted lighting arrangement left connections exposed to the aquarium environment. After corrosion caused the lighting to fail, I changed to cling wrap holding the strip against the board and ensure the connections were covered by the weather-proof strip protector. The existing build photographs document that arrangement; it is not a certified waterproof enclosure by any organization above Mad Magazine.
The controller uses USB power. The LED strip requires a regulated 5V supply and wiring sized for its load, with a common ground. The power-block rating in the existing installation has not been verified but seems to work fine.
Configured connections
- Neopixel data signal uses D4/GPIO2
- Temperature probe uses D5/GPIO14
- OLED SDA/SCL uses D2/D1
Daily lighting cycle
Wi-Fi and NTP provide the clock, configured for US Eastern time with daylight-saving changes. FastLED drives the strip through these programmed local times:
- 7:15–8:00 a.m.: sunrise, blending warm red through orange and gold into blue while increasing brightness.
- 8:00 a.m.–9:00 p.m.: blue-leaning daylight.
- 9:00–9:45 p.m.: sunset, reversing the gradient and reducing brightness.
- 9:45–10:45 p.m.: blue moonlight across the strip.
- 10:45–11:30 p.m.: moonset, gradually dimming the blue.
- 11:30 p.m.–7:15 a.m.: three dim blue patches, with the remaining LEDs black.
The sunrise, sunset and moonset transitions last 45 minutes and use smoothstep easing. Night lighting wraps across midnight. At startup, the firmware sends black to the strip and waits for a valid clock before selecting a lighting phase.
Temperature and local display
The DS18B20 is sampled approximately every two seconds using asynchronous conversions. The last valid reading remains visible during normal conversions; startup or a conversion taking more than five seconds shows Measuring... instead. Invalid readings are cleared and failed or missing probes are retried. Unsupported parasite-power operation is identified separately.
The OLED shows three lines: local time, water temperature in Fahrenheit by default, and the current lighting phase. It refreshes at most twice per second. Missing sensors or displays do not stop scheduled lighting, and the firmware retries a missing display.
Optional remote reporting
ThingSpeak reporting sends temperature in Fahrenheit and a numeric lighting-phase indicator together every five minutes when configured. The phase indicator is not a measurement of LED intensity or fade progress. Uploads require Wi-Fi, valid time and a valid temperature; failed requests retry after one minute, and samples are not buffered during outages.
Software organization
The sketch coordinates separate components for timekeeping, lighting, transitions, reusable effects, temperature sensing, display and reporting. Hardware assignments are centralized in AquariumHardware.h, and a single schedule table selects the lighting effects. This makes it possible to test much of the behavior without an attached aquarium.
Source: AquariumLights on GitHub. This page was updated from the local AquariumController source and its current README; README.txt is retained there as historical notes.