Tank:
My target aquarium is a Juwel Rekord 800; a common 110 liter tank with a hood, lights and feeding hatch. The built-in fluorescent lighting has been stripped out, and LED strips installed in their place.
I installed a fan into the old channel that held the original lighting starter wiring; it takes external air in and blows it (fairly gently, it's a 40mm radial fan) onto the water surface at one end of the tank. The same channel conceals all the wiring and the controller itself is mounted above this, power comes from an external 24v PSU brick mounted safely away from the tank.
A temperature sensor hangs below the lid in the water; It has been soldered to a three core cable then waterproofed by sealing with heatshrink filled with silicon aquarium sealant. A discreet reedswitch (sealed magnetic switch) detects when the feeding hatch / lid is opened.
Hardware:
- DIP package ATMega328P (ie. same chip as arduino Uno) and packs a built in 5V regulator and FTDI connector for programming and serial debug or control.
- The four High-power LED/Fan mosfets are all on PWM outputs for intensity control.
- Both the I2C and OneWire interfaces are brought out for Displays and Temperature sensors to use; there are positions for pull-up resistors as needed.
- The two remaining PWM lines drive a simple buzzer/speaker driver and the LCD backlight.
- An analog pin and three digital pins are made available for switches, light sensors etc, All connectors have power pins to simplify wiring.
Software:
- The water temperature is read 3x per second and displayed, the display is also updated with icons and info messages to display the tank, fan and lid status.
- Audio beeps and simple tunes are played to provide feedback on user actions and alerts about automatic actions,
- Lights are turned on by a button press, they then take 1/2 an hour to fade fully up, run for 7.5 hours and spend the next 1/2 hour fading down. A button press while on begins the fade-down sequence immediately.
- The lights fade up Red first, then the Green/White channel, and finally Blue. The sequence is the same when fading down, Red first, Blue last.
- If the tank temperature rises above 28C the lights fade down to reduce their heating effect, by 30C they are fully off.
- The button has a 1 second de-bounce / hold-down time delay to avoid accidental operation, when pressed during the fade up/down cycles it accelerates them so they complete over a few seconds.
- During the main 'on' phase it can be pressed and held to run down the timer, useful if the tank is reset during a water change, etc.
- The (optional) fan will start to run at 33% when the temperature exceeds 27C, it will speed up proportionally over the next two degrees until it reaches 100% at 29C.
- The fan also 'pulses' at 33% for 30 seconds every five minutes when the lights are on to cool down the air-gap under the lid and improve oxygenation, when the lights are off it does this every 20 minutes.
- The (optional) lid switch is actually on the feeding hatch. It plays a notification when opened to alert staff if a guest is 'fiddling'. There is a lid reminder beep every five minutes while open.
- While the lid is open a button press triggers a maintenance mode which disables the fan and fast-fades the lights off, closing the lid exits this mode.
- If the lid has not been opened for 24 hours a notification beep sounds every five minutes and the display says 'Please Feed", after 48 hours it is three beeps every three minutes, and displays 'Feed us Now'.
- All delays and trigger temperatures are clearly defined, commented and modifiable in the main code file, hardware definitions are broken out into a separate pin definition header file.
- A full serial debug and logging interface is provided, button and lid actions can be simulated. All system data is periodically logged in a defined format with millis() timestamps. All user and automatic actions are recorded and timestamped too.
I would have thought adding pin headers for common real time clock modules with battery backup would have worked better then a button to press every day. also an ldr can do the same job. ie if the tank is indoors have the lights come on automatically when the main lights come on.