RGB LED Fan Controller (custom electronics project)

Status
Not open for further replies.
I was lucky I guess, the course I did was pretty hands on. We had one class dedicated to learning how to use Microchip (pretty much like Eagle CAD) and another class after that to design/build a custom project.

Good job teaching yourself though, impressive :)
You remind me of a mate of mine, you two would get along great. You wouldn't be into arcade stuff as well would you?
 
Finally got at least a really basic GUI on the PC. I haven't got the connector to attach the LED's to the board so I decided to try making a computer interface for just the fan speed. I found that GTK+ is not too hard after reading tutorials for QT, Visual C++, GTK+, etc. Right now all I have is a slider that goes from 0 to 255 and sends out the value on the serial port when the value changes but it seems to work well.

fancontrol.png
 
seriously dude, for simple programs like that use AutoHotkey. It's the bomb, saves a ton of time and effort.
It'd take like 3 mins to create that, and 10 mins to create something that looks professional and 'finished'

It's also easy to interface with other programming languages, so if you need to you can still use a bit of C, or whatever you'd like.
 
I want to use C++ because it's the most common programming language out there, plus I'll probably have to learn it eventually in a programming class (our current class will cover basic QT later this semester) and GTK+ is common and cross-platform. It's actually quite easy to use if you know C++. For now I'm just going to try basic GUI's but after I finish the project I might come up with some app to check your e-mail or instant messaging, since the fan is essentially a big glowing light on the front of the PC it would make a great status indicator, have it slowly pulse red if you have unread e-mails or a certain pattern for IM's, not sure how to tie into web streams like that though, might have to finally learn something other than C++.

I would also like to make a web page that controls the colors since the fan is in my server, but tying web pages to the serial port is going to be hard.

rgbfangui3.png


Using a protocol that I drafted a few weeks ago I'm also starting to work on the actual code. I created an RgbFan class that has functions to connect, disconnect, set LED color, set fan speed, and read RPM's. It's going to use a ping for connection (whenever the PC tries to connect, it will ping the controller and wait for a reply, if it doesn't receive a reply then the PC will still say it is disconnected). This class will be easy to re-use in other applications and prevent from having to re-write connection and communication code.
 
nice :)
It might be a good idea to have a drop-down list next to each of the rgb led # headings, with a few preset colour combinations in the list.
 
That is a good idea, I have some preset colors on the microcontroller code but I stopped using them when I started doing serial communication. Need to figure out how to do drop down lists but it shouldn't be too hard, I think I'll put just the colors that you can make by turning on/off LED's, not by fading them, as those colors look the best, those are red, green, blue, yellow, cyan, magenta, white (just combinations of turning RGB on and off).
 
The hardware is FINISHED! I got my resistors and connector in today from Digi-Key and finally finished the board. It works! I also coded in a real serial port system with the ability to control each LED individually. Using the magic of copy and paste, I also got all the sliders in the GUI program functional. The only thing left to do now is finish the micro programming by getting the RPM counter finished and then program a Windows GUI (GTK+ is portable but I need to figure out how to do ports in Windows), I have to make a Molex cord to plug it into a PSU as well as connect my pin header for the internal COM port. I also want to make the color fade function that I found work, it is pretty cool, want it to slowly pulse into red when I have unread e-mails :p

Final hardware:
 
It'd also be cool to have like a chaser routine, e.g. that 'spins' the colours on each fan slowly around. But meh yeah, nice job overall! Don't suppose you'll be posting up the code? :p
 
I will be! Once everything is entirely finished (the micro code, the hardware design, and a basic PC app/serial protocol specs) I'm going to post it all somewhere, probably on Instructables with steps on how to build it but I'll post the files as well. Since I made the PCB printout into a PDF you don't even need Eagle to print one.

And yeah, chaser would be awesome, just need to figure out how to write one.

EDIT:

Spent like 2 hours trying to get Windows to compile GTK+ apps, the pre-packaged dev libraries weren't set up properly and it took some searching to get the compiler (DevC++) to work with them. However, when it did work I just dumped in my Linux code, edited the serial port open and write parts, and it compiled perfectly and works.

fanwindows.png


All that's left is to add feedback commands to the microcontroller. This way when I close and re-open the GUI, it will read the current values of all LED's and adjust the sliders. I still need to find a place in the code to do RPM calculation as well and figure out how to send a 2-byte integer one byte at a time and rebuild it properly on the other end.
 
Status
Not open for further replies.
Back
Top Bottom