Home > Projects > LED Projects > LED aquarium lighting with an Arduino based PWM timer

LED aquarium lighting with an Arduino based PWM timer

Summary of LED aquarium lighting with an Arduino based PWM timer


This article details an impulse-purchase aquarium lighting project using four cool white Cree XP-G R5 LEDs to prevent algae. A 1A constant current supply with PWM support drives the lights, controlled by an Arduino microcontroller and a Maxim DS3234 real-time clock. The system features fade-in/out effects and is configured via USB serial port for time, duration, brightness, and PWM speed.

Parts used in the LED Aquarium Lighting Project:

  • Four Cree XP-G R5 LEDs (cool white)
  • One amp switching constant current supply with PWM support
  • Maxim DS3234 real-time clock
  • Arduino board
  • Laptop power supply
  • CR2032 coin cell battery
  • Custom PCB shield

I bought a small aquarium (54l) as an impulse buy and I needed some lights for it, so naturally I wanted to use LEDs. I also needed a timer for the lights. I also wanted the lights to fade in and out when they were going on or off as a cool effect.LED aquarium lighting with an Arduino based PWM timer

I ordered four Cree XP-G R5 LEDs (cool white, apparently too warm of a light will cause algae growth) and a one amp (switching) constant current supply (with PWM support) from LED-tech.de.I had some Maxim DS3234 real-time clocks with a serial bus (SPI) which looked easy to implement so I decided to use one. I also had one spare Arduino board so that was going to be my microcontroller of choice. I used a laptop power supply as the power source.

The PCB was a pretty simple “shield” for the Arduino, just the RTC, a CR2032 coin cell battery for RTCs memory retention and thats about it. I did manage to get a couple of bugs there though as you can see from the jump wires.Communicating with the RTC was fairly straightforward. The most complex part of this project was the actual software and to make it easily configurable and work like I wanted it to. LED aquarium lighting with an Arduino based PWM timer SchematicThe software is configurable via USB (serial port) and you can change the time, the lighting period (how long the lights are on), the PWM speed (how long it takes for the lights to fade in/out), maximum brightness and set the time when the lights are supposed to go on. It also includes user input sanity checking and if the input makes no sense it will print a help page (with all the commands listed).

 

For more detail: LED aquarium lighting with an Arduino based PWM timer

Quick Solutions to Questions related to LED Aquarium Lighting Project:

  • Why were cool white LEDs chosen?
    Cool white LEDs were selected because apparently too warm of a light will cause algae growth.
  • How are the lights powered?
    A laptop power supply was used as the power source for the project.
  • What is the function of the CR2032 battery?
    The CR2032 coin cell battery is used for RTC memory retention on the custom PCB shield.
  • Can the lighting schedule be changed after assembly?
    Yes, the software is configurable via USB where you can change the time and lighting period.
  • What parameters can be adjusted via the serial port?
    You can adjust the time, lighting period, PWM speed, maximum brightness, and the start time for the lights.
  • How does the system handle invalid user input?
    If the input makes no sense, the system prints a help page listing all available commands.
  • What effect do the lights have when turning on or off?
    The lights are designed to fade in and out when they go on or off.
  • Which microcontroller was used for this project?
    An Arduino board was used as the microcontroller of choice.

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter
Scroll to Top