RGB Aquarium Lights With Sunsets and Sunrises




About: I build stuff because it isn't available to buy, or is too expensive, or the ones you can buy don't do what I want them to. Sometimes I don't have a reason, I just want to build something. For me it's about...

Replacing florescent tubes (T8) with RGB LED lights, so gently fade between day time and night time via a sunrise, and sunset approximation.

My fish visibly freak out when the timer turns the fluorescent tubes off, or when they flicker on.

Unfortunately, Fluorescent tubes can't be dimmed either, which means I can't have them gently fade on or off.

LED replacement tubes are expensive, and could be dimmed. but getting them to gradually turn on or off on a timer isn't a product I could find. LED tubes also don't put out as many lumens as fluorescent tubes.

My Axolotl doesn't seem to be able to catch fish in the day time, but has a feast at night. So I want a night light to give the other fish a chance. I tried one off eBay, it was too bright.

What I want is; very low intensity lights at night. fading gently into bright light in the day time, then back out in the evening. To achieve this I plan to use RGB LED strips, an Arduino to control the light hue and intensity, and a RTC (Real time clock) to make the transitions happen at the right times.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: The Plan

Waterproofing is hard. So I want to use what I've got, and has been working so far. The plan is to replace the fluorescent tubes, with my custom equivalent. To do this I will need:

  1. Plastic tube of the same OD (26mm) as the fluorescent tube.
  2. Aluminium tube (16mm OD) to wrap the LED's around, as a heat sink, and former.
  3. 5050, 60 LED/m, RGB, 1-1.2A per meter. 12V, 4.5m needed per 900mm tube.
  4. Need Arduino to do PWM the RGB LEDs
  5. Need RTC so Arduino knows what time it is
  6. Need a power amp, because the Arduino can't put out enough currant to drive the LED's
  7. Need a >130W PSU to power it.

I bought two 5m kits off amazon because it was cheaper than buying PSU's separately. The two laptop style PSU's were 2-2.5A rather than 5A the website toted them to be, or that the labels on them suggested. So the lights weren't that bright, one PSU died within 10 hours, and the other isn't up to the job. My advice; avoid buying bundled PSU's, they probably won't be up to the task. And make sure the PSU you buy, is well over spec'd to ensure it's not put under too much strain.

Also, at full whack, my 9m of RGB is pulling 65.5w. That's only about 6 Amps. So my 20 amp PSU is too far over spec.

Step 2: Getting the Lights Ready

    1. First I ripped out the wiring from the fluorescent system.
    2. Then I cut down the plastic and aluminium tube to fit. Same length as the original tube will work once the connectors are gutted.
    3. The tubes need the edges chamfering it so that it doesn't catch any LEDs or seal
    4. Check the LED strips are fully working, no dead pixels
    5. Wrap the strip around the aluminium tube at a tight angle. Like a helix.it should touch itself edge to edge on the next layer.
    6. Slide the led wrapped aluminium tube into the plastic tube.
    7. You will have to drill out your connectors to make enough room for the ribbon to get through into the hood.
    8. screw it all up
    9. clip it back together
    10. give it another test

    Step 3: Arduino Wiring and Programming

    There is a photo of the wiring.

    I've attached the program for you.

    It's a bit counter intuitive because the LED's are common Anode (+ve 12v). So it works by grounding the pin. 255 is 12v, so the potential difference is 0v between it and the 12v common anode. So in this situation they're off. 0 PWM is 0v, 0v to 12v, is 12v potential difference, so 0 PWM is 100% on.

    It changes by 1 of 255 per second on each channel, Red, Green, and Blue.

    When the Arduino turns on, all the outputs go to 0. So the grounded pins make the lights come on full whack for a moment. But it quickly initialises and sets the lights to the correct level.

    I've programmed it to start from night mode, sequentially until it catches up with the cycle it should be in. This will take 13 minutes maximum.

    Step 4: Results

    The lights are plenty bright enough, but not as bright as I expected. I ended up turning the blue down a bit so that it gave a "warmer", more daylight like light.

    It transitions between modes so gently, you often don't notice it's happening. The fish seem much happier. I have a reclusive Pleco, and she never used to come out when you were in the room, now she comes out as soon as it's in night mode. Sometimes twilight and daylight too.

    You can end up with some strange intermediate hues as it transitions. This is because the Red, Green, and Blue, channels are changed by 1 unit per second. Not proportionally. This could be fixed with a little coding to limit the difference between each variable during a transition, or to change the values proportionally, which would avoid the occasional odd colour tinge.

    • Would I do it again?
      • Yes
    • Would I recommend it to others?
      • For ease of use, yes.
      • For serious fish keepers who care about the intensity and wave length of light for plant health: possibly not.
      • Having said this, my plants are doing fine. Possibly better than with the old lights!



      • Indoor Lighting Contest

        Indoor Lighting Contest
      • Stone Concrete and Cement Contest

        Stone Concrete and Cement Contest
      • DIY Summer Camp Contest

        DIY Summer Camp Contest

      13 Discussions


      19 days ago

      will this same LED setup work for a live plant aquarium?

      1 reply

      Reply 18 days ago

      Yes, most of the plants in those photos are live. If you over feed your fish and don't do enough water changes then you will get algae blooms.


      Question 10 months ago


      I would like ask, because I have all right connected, but I use RTC module DS1302.

      Is it problem?

      BTW: when I try serial connection thru the Arduino IDE, message is:

      45:165:85 165/165/165 Day of week: Temperature:0.00C





      Could u help me please? Ondrej

      1 answer

      Answer 10 months ago

      Hi, the DS1302 has issues, the DS3231 is far more reliable. Arduino Playground has further details: https://playground.arduino.cc/Main/DS13029

      Is your system working? If not, what is it doing wrong? It's often good to get each aspect working individually then combine them. Like set the lights to fade and check it works, Set the clock to just print the current time, then get the code to print a line or do something with the lights at some arbitrary trigger like the first thirty seconds of the minute or the last. Then combine them and get it to fade the lights when it triggers, then change the trigger times to your actual wanted trigger times.

      Trouble shooting is the same for pretty much every problem: Break it down into it's functional elements, check each part is doing what it should do in isolation, slowly recombine each working part one at a time until you find a problem. If you get it back together without finding a problem and it works now... Don't think about it too much, act like you know what your doing, and get on with your life.


      1 year ago

      Thread dig here!
      Great project! Just what i was looking for for my tank.
      I went a different way with the actual lights and im using 5 x 1 meter strips attached into my existing LED light housing that had long ago died. I just gutted it out and stuck the strips in.

      Id like to add an extra channel and incorporate high intensity cool white leds to approximate midday sunlight for a few hours.

      Any chance of some assistance with the coding?



      1 year ago

      hello, I wanted to ask you if this sketch was possible to modify it.

      I would need to activate 2 relays at different times.

      I hope you can and if you can give me a very kind gentlemen's guide


      2 years ago

      That should work fine.


      2 years ago

      LetsBuildOne Could possibly draw up a wiring schematic for this? It doesn't have to look pretty, I just want to see how it's all connected as a schematic.

      2 replies

      2 years ago

      This sounds brilliant and just what I'm looking for. My goldfish are not at all amused by the flouresant light been switched on and off either!...one of them actually bumps things in the tank...i think it's a form of protest!
      Anyways, the problem is, I have no idea what your talking about beyond the concept! Can you put one together and send it to me?!


      3 years ago

      Fascinating info!! I'm not really sure I understand all the components you rigged back together but I may just have to research those items and give this a try!! Looks great and I've not been thrilled with the lighting I've found out there for my price range!! Thanks for sharing!!

      1 reply

      Reply 3 years ago

      Please ask away, and I'll edit the detail in for everyone else too. I'm happy to help you guys out!