FanBus Digital Fan and LED Interface for PC using ATMega168 microcontroller
Last year I modified a blue LED fan with RGB LED’s to enhance the look of my server case. Last summer I built a gaming computer and ever since I wanted to light it up with multiple controlled lights and fans. I finally figured out an easy interface and designed a simple network (the “fan bus”) to connect microcontroller-based fan and LED controllers to.
The bus uses a simple TTL-level serial signal in half-duplex mode. A MAX232 on the distribution board adjusts the RS-232 input from the PC to microcontroller-compatible levels. A diode and pull-up resistor are used to convert the full-duplex UARTs (and MAX232) into half-duplex. The diode is responsible for pulling the line low when the Tx pin drives low. This allows a large number of devices to be plugged in at the same time without any damage to the serial hardware. With a properly formed protocol there are no collisions or communication problems.
Every device has a pre-programmed/reprogrammable address stored and loaded from EEPROM that it uses to identify itself.
The devices I built are more RGB fan controllers which are modified from the original design (eliminate the MAX232 and compact the board a bit to save space). They have the same functionality (4 RGB LED’s with 256-level PWM, 256-level hardware high-speed PWM with drive transistors for the fan, RPM counting and readout from the fan’s sensor wire). Like the original, the new design is also based around the Atmel ATMega168 AVR microcontroller and the board has a programming header for in system programming.
Step 1 Gathering the Parts
The parts list is essentially the same as before.
For the 5-port FanBus to Serial board:
1x MAX232 (I recommend a socket too)
1x 1K Ohm Resistor
4x 1uF Capacitor
6x 4-pin header (1 for power, up to 5 for FanBus devices)
1x 3-pin header
For one FanBus RGB Fan Controller:
1x ATMega168 (I recommend a socket on this as well)
1x 4-pin header
2x 3-pin header (or one 2×3 header, for ISP connector)
12x 300 Ohm Resistor
1x 1uF Capacitor
2x 10K Ohm Resistor
3x 1K Ohm Resistor
1x 1116 Transistor (or equivalent)
1x 1616 Transistor (or equivalent)
2x Jumper (I just used clipped resistor leads)
For one RGB Fan:
1x 4-LED PC fan with sensor (yellow or white) wire
4x 4-pin common-cathode RGB LED (diffused)
4x Length of 4-conductor ribbon cable
1x Roll of transparent tape to hold it together
A 6×6 inch, single sided copper clad board should be plenty. I used one 6×6 board to make 3 FanBus controllers, one FanBus adapter, my original RGB Fan Controller, and a LocoNet to Serial adapter for a train set. One piece of PCB goes a long way!
You will also need a laser printer to do toner transfer (I used my HP LaserJet 5M, got it for $10 at a university garage sale and it’s perfect!). I recommend glossy or semi-glossy paper. I used the back of some newspaper ads, save the ones that are already 8.5×11″ size paper as you don’t even have to cut them to size, just feed it into the printer and go. You will also need a clothes iron (preferably one you don’t use for clothes anymore) and a bottle of etchant (I used ferric chloride, $10 at RadioShack for a pretty large bottle that will last you a while). To cut the boards down to size I used a Dremel with cut-off wheel.
Step 2 The Board: Printing and Transferring
To make the boards, I used the common laser printer toner transfer method. It produces decent quality boards from CAD files and is easy enough to do yourself without buying much. You need a laser printer (I used an HP LaserJet 5M) and paper that is smooth enough for the toner to transfer from.
The Eagle files as well as PDFs of the boards will be available on my Google Code project page:
Getting the right paper can be tough, you want something thin and glossy but not so thin it jams the printer (this happened with really thin newspaper). I used a thicker paper often used for advertisements, it sometimes even comes as standard 8.5×11″ paper so if you get these in your junk mail save them! Just stick one in the printer (print on the least-printed side, though if it was printed in ink it will still work, ink does not transfer). I used Eagle to print the boards (not mirror imaged or upside down, the transfer mirrors it already).
After printing, cut out the design and clean your PCB with an abrasive pad until it is shiny, wipe it off so that no dirt or residue affects the transfer. Preheat the iron (I put mine on HIGH but mine is a small travel iron) and then set it down on the board (copper side up) to warm up the board. Wait 5-10 seconds if your iron is hot and then remove it. Let the board cool a bit until it is warm but not so hot you can’t touch it. Then lay the paper face down on the copper and press the iron down with force. Hold it for 5-10 minutes, adjusting your position to evenly heat the entire paper. After this, the board should be too hot to pick up, so let it cool down (and if it is cool already, put the iron back on as it should get hot to transfer properly).
Fill a container with steaming hot water (I found it works best) and then submerge the board with the paper attached into the water. The water will soak into the paper and you should be able to see the traces through the paper. Once it is completely soaked, wait a minute or two and then slowly start peeling the paper away. The traces should remain on the board. If the paper splits, just pull it off in pieces until all the gaps between traces are clear. Don’t scrub too hard on the traces themselves, when you take it out of the water there will probably be paper threads still attached to the traces, just trim them with a sharp knife if they hang off the traces.
If there are any breaks, take a black Sharpie (I used a blue one before and it didn’t work very well, black seems to work better) and draw over the breaks. The black ink from permanent markers is strong enough to resist toner so you can use it to touch up small flaws. If the breaks are too large, you can use Acetone (nail polish remover) or an abrasive pad to clean the toner off and start over.
Step 3 The Board: Cutting, Etching, and Cleaning
After transferring and touching up the traces, I cut the PCB out of the larger sheet with a Dremel. After cleaning the board up, drop it in the etchant solution and let the etchant eat away the copper until only the traces are left.
Once etched, wash the board in warm water to clean the etchant off and then use acetone (nail polish remover) to remove the toner and expose the copper traces. I also used Goo Gone because the acetone was leaving black streaks on the board. Once the board is clean it should be a bright copper color again.
Next, the board needs to be drilled. I used a drill stand and a regular single-speed drill with a small drill bit to drill the tiny holes. Drill out each hole and make sure to leave a ring of copper to solder to, don’t drill the hole too big or it will be harder to solder.
Leave a Comment
You must be logged in to post a comment.