RGB LED Fan Controller (custom electronics project) - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Hardware > Overclocking and Modding
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 01-14-2010, 04:02 PM   #1 (permalink)
 
Join Date: Nov 2006
Location: Illinois, USA
Posts: 2,363
Default RGB LED Fan Controller (custom electronics project)

I haven't been on Tech Forums in a while, mainly because I got interested in electronics projects and spent a lot of time playing with microcontrollers and stuff. However, I recently got a new case for my server and a blue LED fan to light up the front of it. However, the blue LED fan had a burned out LED and it also ran really loud so I decided to take on a project that I had thought of before. I decided to make a custom fan controller that would also include multi-colored LED's, control the fan speed, and read back RPM's all through the computer (no switches or buttons on the case or inside of it, everything is controlled through the PC itself).

To do this project, I started with an Atmel ATMega168 microcontroller (which is about $5) and a level converter for the serial port (about $1). Add to that 2 transistors to control the higher voltage for the fan, a 5 volt regulator to provide a stable power supply for the chips, and some resistors (all these parts around $1 total). The other stuff is a custom PCB I'm going to make once I figure out how to print them and some RGB LED's (found them cheap on eBay) and of course the 120mm blue LED fan with the blue LED's removed.

To connect to the PC I found that my server's motherboard has a second serial port pinned out internally that I could plug into with some basic pin connectors without even using any external ports. Serial connections are great for microcontrollers because USB is more complex and involves more expensive stuff.

I have a program written for controlling the 4 LED's and the fan speed but I am still working on reading the RPM accurately. If anyone else here has any experience with microcontrollers I'll post the code when it's finished as well as pictures of the controller. If it works well, I may figure out how to chain multiple microcontrollers together and come up with a protocol for whole-case lighting control which would be awesome (change the color of the LED's at any time or have some kind of color loop that fades continuously).
__________________

__________________

CalcProgrammer1 is offline  
Old 01-14-2010, 08:10 PM   #2 (permalink)
Wizard Techie
 
philbar71's Avatar
 
Join Date: Apr 2007
Location: Suffolk, VA
Posts: 4,533
Send a message via AIM to philbar71
Default Re: RGB LED Fan Controller (custom electronics project)

Cool. Def post up some pics or vids.
__________________

__________________


The only thing ATi can render faster than nVidia is the BSOD

SLI ON INTEL P45: http://www.techist.com/pc/f76/sli-intel-chipset-219886/

<<< i like rep :D
philbar71 is offline  
Old 01-14-2010, 08:59 PM   #3 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,665
Send a message via MSN to S0ULphIRE
Default Re: RGB LED Fan Controller (custom electronics project)

Dude, this is a relatively simple project, you should be able to do it with one PIC easy.

I'd suggest scrapping the manual control of the fan RPMs and just using a digital potentiometer. Then you'll be able to control it via software on the pc.
Also, you won't need a 5v regulator, the PC power supply is already stable enough. Just use the 5v pin from any of the molex connectors (or pins 7-9 on a sata power cable)
As to the rpm, you'll need an IR LED and an IR receiver probably, one on either side of the fan blades.
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline  
Old 01-14-2010, 09:19 PM   #4 (permalink)
 
Join Date: Nov 2006
Location: Illinois, USA
Posts: 2,363
Default Re: RGB LED Fan Controller (custom electronics project)

PIC, AVR, same thing really, both are cheap microcontrollers, just I know how to program AVR's and haven't tried PIC's yet. I'm not trying to control the RPM, just read it the same way the motherboard does (by counting pulses on the third sensor wire) which should be easy (AVR's have counters built in) but there's noise on the line from PWM frequency, though a capacitor absorbs that and I think I finally got a stable count. With the RPM readout to the PC and the PC able to control the power, it should be easy enough to make some sort of feedback loop to control the RPM directly but I don't plan on making one. If I use molex I will probably eliminate the regulator (using one now just because I'm using a 12V adapter to power everything) as linear regulators just waste power as heat.

As for why the mega168 I tried a smaller, cheaper Atmel microcontroller (tiny2313) but it didn't have enough memory for a color fading routine I found as well as the rest of my code, plus the mega has enough pins to drive LED's, the fan, and read the RPM.
__________________

CalcProgrammer1 is offline  
Old 01-14-2010, 09:33 PM   #5 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,665
Send a message via MSN to S0ULphIRE
Default Re: RGB LED Fan Controller (custom electronics project)

*facepalm* somehow I forgot about the third wire. epic fail lol.

Um and yeah, I tend to use the terms PIC and AVR interchangeably.

What language are you writing the program in?
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline  
Old 01-14-2010, 09:41 PM   #6 (permalink)
 
Join Date: Nov 2006
Location: Illinois, USA
Posts: 2,363
Default Re: RGB LED Fan Controller (custom electronics project)

C (avr-gcc), I'm not good enough for assembly, it just looks confusing. I tried it a while back on TI calculators after I got interested in programming from playing with TI BASIC but every program I ever wrote in assembly crashed the emulator and I never bothered to get back into it, I figure I'll be taking a more advanced programming class eventually where I'll learn it, but C is a good language. Using AVR Studio and then a parallel port programmer I made because I'm too cheap to buy a real one.
__________________

CalcProgrammer1 is offline  
Old 01-14-2010, 09:47 PM   #7 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,665
Send a message via MSN to S0ULphIRE
Default Re: RGB LED Fan Controller (custom electronics project)

lol
Yeah don't bother with assembly. TBH it's not that hard, you only need to know about 35 different commands and that's it. The bad thing is you have to do everything one step at a time, and it's not a very powerful language.

So, what step are you working on atm? Just putting the hardware together?
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline  
Old 01-14-2010, 10:03 PM   #8 (permalink)
 
Join Date: Nov 2006
Location: Illinois, USA
Posts: 2,363
Default Re: RGB LED Fan Controller (custom electronics project)

It's all on breadboard right now, I have the AVR and MAX232 serial chip hooked up, I have the AVR outputting PWM through 2 transistors (NPN to PNP to step up 5V to 12V) that is connected to the fan. For the LED's, I ordered a 50 pack of RGB common-cathode ones on eBay because they were cheaper than ordering 4 of them through Mouser (an online electronic parts store here where I got the rest of the parts). I found a software PWM routine to create an "analog" signal on any pin I need so I can control 12 channels (3 per LED, 4 LED's total) and implemented it, then also found a color fading routine that slowly fades between two colors. I'm going to put the fading on the chip itself so you just tell it to fade a certain LED to a new color, probably have the AVR send back a "done" message to the PC.

As for counting the RPMs, I got what I think is a steady signal input (checked it with a scope and it looks clean) but using interrupts to count sometimes fired wrong. I found a bit of code for the Arduino board that ran an accurate frequency counter up to several MHz and I tested it and got better numbers than my code did so I need to figure out what it's doing and implement it. After I get it working I'll draw up a PCB on Eagle CAD (or some other program if I can find a better one) and try the laser printer PCB technique to make a custom board. If I like how it works I'll probably make more for future builds (I have enough parts to at least build 2 and enough of everything other than the microcontroller and serial chip to build a lot more than 2).
__________________

CalcProgrammer1 is offline  
Old 01-19-2010, 02:19 AM   #9 (permalink)
 
Join Date: Nov 2006
Location: Illinois, USA
Posts: 2,363
Default Re: RGB LED Fan Controller (custom electronics project)



I finally installed some RGB LED's in a fan. I ran out of wire so I only got to install 2 of the LED's, the other 2 are still on the breadboard. I also just drew up a PCB layout that should work, though I have a little work left on counting RPMs before I finalize the board. The base code is done (driving LED's, fan speed control, serial communication) except for reading the RPM, all I need to do after that works is come up with a protocol and then write a program for the PC to control it, if it tests OK then I'll create a PCB and install in my server. If it works well, I'll add one to the side panel as well.
__________________

CalcProgrammer1 is offline  
Old 01-19-2010, 02:30 AM   #10 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,665
Send a message via MSN to S0ULphIRE
Default Re: RGB LED Fan Controller (custom electronics project)

hey, nice
let me know if you hit any snags. What language are you planning to write the program for the PC with?
__________________

__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PROJECT : Kill Kitty (Now with nude pics) Harper Overclocking and Modding 57 12-16-2009 08:56 PM
Project Sestren Worklog - World's First Back/Outside Mounted Tri Loop Cube! pc1x1 Overclocking and Modding 102 12-06-2009 03:55 AM
Zalman Fan Controller Issue intent Hardware Repairs and Troubleshooting 1 01-14-2009 02:05 PM



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 01:28 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.