A couple of years ago I decided to set up a planted aquarium. I was fascinated by the beauty of those aquariums. I did everything which I was supposed to do while setting up the aquarium but neglected one most important thing. That thing was lighting. Everything looked fine for few days but then algae started growing everywhere in the tank and the plants were not doing great. It is a tough job to get everything back to normal.
Now after many years, I want to set up the aquarium again giving importance to lighting. I did some research on the internet and found that plants need continuous exposure to light for around 10-12 hours daily. I also came to know that plants respond more to the red and blue spectrum of light.
The trick is to simulate nature as closely as possible inside the aquarium. I could have manually switched ON or OFF the lights but why not automate it. This reduces the human error. So, I decided to make a LED lighting system which turns ON and OFF automatically using Arduino. This makes the lighting period consistent which is what the plants need.
The plan is to turn ON and turn OFF the LEDs at a specific time of day. The LEDs won't turn ON to the full brightness immediately but instead, it will reach from zero brightness to full brightness in an hour. This is to simulate the sunrise. Same applies while turning OFF the LEDs.
The job of providing the exact time is done by the Real Time Clock or RTC. The advantage of using an RTC over millis() is that precise time can be obtained directly. Also, the RTC module has its own battery back up. So even if the Arduino is powered OFF or is reset the time is not lost. This makes it perfect for our application.
Why just control the lighting? As I had some relays laying around, I will be using them to switch ON or OFF some of the appliances like the filter, air pump, heater, etc. too if needed. I added a 12V DC computer fan to provide ventilation.