I Built an open-source LED controller and app from scratch

oldrev

Community Member
View Badges
Joined
Feb 21, 2025
Messages
89
Reaction score
174
Location
Yunnan, China
Rating - 0%
0   0   0
Hello Reefers,

I’ve been working on designing and building what I hope will be the perfect open-source aquarium light controller, and a mobile app to go along with it.

So far, I’ve got a working prototype with a 6-channel design and a functional app.

I’ve been coding for nearly 20 years and have plenty of electronics experience too. I’ll admit we kinda have this gift to keep costs low when it comes to electronics. So, instead of going for something fancy like a Raspberry Pi as the brain, I chose the ESP32-C3, it’s just right for this project. To save even more on the PCB, the controller is super tiny, just 30×22mm, and I’ve pretty much used up every single pin on that ESP32-C3. The other key parts are just two DC-to-DC buck converters and a TL431 voltage reference.

blc06mk1-cover.jpg
blc06mk1-1.jpg


Let’s talk hardware first:
  • Built-in buck circuit for a wide input voltage range, 15–36V
  • 6-channel LED PWM control with phase-shifting support, 1024-level duty cycle, and up to 24kHz
  • A pin for a 3950 NTC thermistor to monitor LED temperature
  • Fan PWM control signal output driven by a PID algorithm, plus a fan voltage output adjustable from 3.5V to 12V. You can lock it at 12V and let the PWM signal handle the fan speed, or use a cheap two-wire fan and have the controller regulate the voltage to adjust speed.
  • Built-in voltage sensing, plus a pin for an INA139 chip to measure total LED current and handle over-current protection.
  • A push button pin to temporary light-on mode or reset WiFi settings.
  • 0.1" pin header, DIY friendly.
Then there’s the phone app:
  • One big reason I started this project was to dive into Flutter development, so I really wanted the app to look slick and polished. Here’s what it can do:
  • Manage multiple devices.
  • Manual dimming mode.
  • Scheduled mode with multi-stage sunrise/sunset dimming.
  • Easy Setup mode.
  • Nightlight mode (temporary light-on feature), super handy when you want to peek at your tank in the middle of the night without messing up your light schedule.

devices-management.png
led-dashboard.png
led-scheduled.png
led-easy-setup.png


This is a fully open-source project, and I mean fully. All the editable hardware design files, firmware, and app source code are up on GitHub: https://github.com/oldrev/borneo. The hardware and firmware are pretty much done, but the app’s still a work in progress—functional, but a bit rough around the edges.

Since I’ve only ever dealt with freshwater planted tanks, I’d love some advice from the saltwater enthusiast. Is this moonlight mode actually important, and if so, what color should it be when it’s on?

Cheers!
Wei L.
 

Besieged

Active Member
View Badges
Joined
Jan 2, 2025
Messages
453
Reaction score
489
Location
Metro Atlanta
Rating - 0%
0   0   0
You may want to make the moonlight mode adjustable if you can... I think it's really a matter of preference for a lot of people. One I expect no few people will have strong feelings about - or at least find themselves annoyed if they can't configure it. Its actual importance is a matter of debate, but if nothing else it has value in allowing people something many want, for their own personal enjoyment.

Personally? From my own understanding, for what little it may be worth?

Blue light is daylight. Above water or under, but especially under as that's what makes it to depth more than any other frequency. This triggers all sorts of hormones and whatnot in corals, fish, and everything else.

What you see underwater when the moon is full isn't blue light - it's white.

For moonlight on my lights, I set them between 0 - 1% blue, and 1 - 5% white.

Others are certain to have their own preferences and feelings on the matter, hence I suggest you might just want to make it a customizable setting.

I would suggest doing the same with sunrise and sunset, for the same reasons. You might also make the length of sunrise/sunset controllable, and have it ramp as smoothly as possible between each setting (including moonlight).
 
OP
OP
oldrev

oldrev

Community Member
View Badges
Joined
Feb 21, 2025
Messages
89
Reaction score
174
Location
Yunnan, China
Rating - 0%
0   0   0
You may want to make the moonlight mode adjustable if you can... I think it's really a matter of preference for a lot of people. One I expect no few people will have strong feelings about - or at least find themselves annoyed if they can't configure it. Its actual importance is a matter of debate, but if nothing else it has value in allowing people something many want, for their own personal enjoyment.

Personally? From my own understanding, for what little it may be worth?

Blue light is daylight. Above water or under, but especially under as that's what makes it to depth more than any other frequency. This triggers all sorts of hormones and whatnot in corals, fish, and everything else.

What you see underwater when the moon is full isn't blue light - it's white.

For moonlight on my lights, I set them between 0 - 1% blue, and 1 - 5% white.

Others are certain to have their own preferences and feelings on the matter, hence I suggest you might just want to make it a customizable setting.

I would suggest doing the same with sunrise and sunset, for the same reasons. You might also make the length of sunrise/sunset controllable, and have it ramp as smoothly as possible between each setting (including moonlight).
Thank you for your reply. This seems weird, I thought this post had already been deleted.

Anyway, in my design, all channels are adjustable, just like in commercial products. The moon light has a dedicated channel, and if 6 channels are not enough, I am currently testing a similar but ESP32 based prototype with 10 channels.
 
OP
OP
oldrev

oldrev

Community Member
View Badges
Joined
Feb 21, 2025
Messages
89
Reaction score
174
Location
Yunnan, China
Rating - 0%
0   0   0
So, here's a little update:

A standalone LED driver board prototype:

IMG_20250323_212230.jpg

IMG_20250323_165901.jpg


And this is a new saltwater and freshwater LED aluminum PCB prototype, currently being manufactured at the fab. I expect to receive it in three or four days.

freshwater_2025-04-11_200503_248.png

marine_2025-04-11_200524_127.png


I’m very experienced with planted tanks, but I’m kinda new to reef tank. I plan to replicate the LED chips ratio of the old AI Prime, and I’m wondering if anyone has better design suggestions.
 

jsmkmavity

Valuable Member
View Badges
Joined
Apr 21, 2023
Messages
2,477
Reaction score
3,910
Location
Sandpoint
Rating - 0%
0   0   0
I would like to get the controller and driver board. When do you think they will be available? I am in the beginning stage of a diy reef light upgrade now.
 
OP
OP
oldrev

oldrev

Community Member
View Badges
Joined
Feb 21, 2025
Messages
89
Reaction score
174
Location
Yunnan, China
Rating - 0%
0   0   0
I would like to get the controller and driver board. When do you think they will be available? I am in the beginning stage of a diy reef light upgrade now.
I've got two sets of working prototypes left. They're hand-soldered, so they don't meet lead-free standards, and I'm not planning to sell them. For testing purposes, I can send you a set of controller and driver for free, but you'll need to pay the shipping cost. Just let me know the current rate you need for each of the 6 channels.
Drop me a PM for the details.
 
OP
OP
oldrev

oldrev

Community Member
View Badges
Joined
Feb 21, 2025
Messages
89
Reaction score
174
Location
Yunnan, China
Rating - 0%
0   0   0
So, this is the aluminum PCB I just received from the PCB fab:
2025-04-14_211740_888 (4) (中).jpg


The following is the heatsink case I'm planning to use.
I got it from a friend, and it's about 160mm in size.

2025-04-14_211740_888 (2) (中).jpg

2025-04-14_211740_888 (1) (中).jpg

2025-04-14_211740_888 (5) (中).jpg


BTW, I took these photos using a lightbox that cost around $8 and my cheap Redmi phone. They look pretty good, right?

There are still many parts I haven't received, so please stay tuned for updates.
 

Arthur_Dent

Active Member
View Badges
Joined
Oct 13, 2020
Messages
320
Reaction score
292
Location
South Florida
Rating - 0%
0   0   0
This project is epic. I haven't had time to dig into your GitHub, but are the grbl files and bom's up there? If not, are you planning on publishing them?

I see a project in my future here....
 
OP
OP
oldrev

oldrev

Community Member
View Badges
Joined
Feb 21, 2025
Messages
89
Reaction score
174
Location
Yunnan, China
Rating - 0%
0   0   0
This project is epic. I haven't had time to dig into your GitHub, but are the grbl files and bom's up there? If not, are you planning on publishing them?

I see a project in my future here....
The GitHub repository doesn't have Gerber and BoM files, but something even better: the design source files. You can use Horizon EDA (an open-source design software) to export the Gerber and BoM files, or freely modify the existing design.

Please note that the latest aluminum PCB design is not included because I haven't soldered and tested it yet.
 

Arthur_Dent

Active Member
View Badges
Joined
Oct 13, 2020
Messages
320
Reaction score
292
Location
South Florida
Rating - 0%
0   0   0
The GitHub repository doesn't have Gerber and BoM files, but something even better: the design source files. You can use Horizon EDA (an open-source design software) to export the Gerber and BoM files, or freely modify the existing design.

Please note that the latest aluminum PCB design is not included because I haven't soldered and tested it yet.
Dude, this is awesome. We have a 4 month old, and so, my time lately has been limited, but I am absolutely going to build one of these.
 
OP
OP
oldrev

oldrev

Community Member
View Badges
Joined
Feb 21, 2025
Messages
89
Reaction score
174
Location
Yunnan, China
Rating - 0%
0   0   0
I've finished soldering the aluminum PCB, but I forgot to change the inductor packaging, so it can't run at full power, 1.4A per channel.

For now, I've hardware-limited it to 1.2A per channel, but I think running at full power might still be a bit risky. I'll power it up for testing tomorrow night.

To be continued...

2025-04-15_233314_266 (m) (1).jpg

2025-04-15_233303_612 (m).jpg

2025-04-15_233309_361 (m).jpg
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 37 27.4%
  • 100% dry rock + 100% live sand

    Votes: 46 34.1%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 22.2%
  • 75% live rock, 25% live sand

    Votes: 12 8.9%
  • 25% live rock, 75% live sand

    Votes: 10 7.4%
Back
Top