3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Color Changing Digital PC Fan Controller

Step 6Prototype the circuit (Optional)

Prototype the circuit (Optional)
«
  • IMG_2212.JPG
  • IMG_2150.JPG
  • IMG_2151.JPG
If you like using a breadboard to test things before making the PCB, now is your chance.  Stick your Mega168 and MAX232 in a breadboard, put the 2 1uF capacitors on the MAX232, hook the MAX232 to a serial port and the microcontroller's Tx/Rx pins, hook up a 5V regulator and power the two chips, and then follow the LED wiring pinout below to hook the AVR to the LED's:

Pin 14 (PB0):  Red 1
Pin 15 (PB1):  Green 1
Pin 16 (PB2):  Blue 1

Pin 17 (PB3):  Red 2
Pin 18 (PB4):  Green 2
Pin 19 (PB5):  Blue 2

Pin 23 (PC0):  Red 3
Pin 24 (PC1):  Green 3
Pin 25 (PC2):  Blue 3

Pin 26 (PC3):  Red 4
Pin 27 (PC4):  Green 4
Pin 28 (PC5):  Blue 4

Hook each connection through a 300 ohm resistor, and connect the 4 LED ground pins to ground.

Connect the fan motor by putting a 1K Ohm resistor from Pin 5 (OC2B) to the base of the NPN transistor.  Connect the middle pin of the transistor to a 10K Ohm resistor which then connects to the base of the PNP transistor.  Connect the remaining pin of the NPN to ground, the middle of the PNP to the fan motor, and the remaining pin of the PNP to your 12V (or whatever you're using for a power supply, I breadboarded mine with a 9V because I had one lying around, still good enough for a test).  Connect the fan's ground to the breadboard ground, connect the yellow wire to a 10KOhm resistor and also to a 1KOhm resistor.  The 10KOhm goes to +5V while the 1KOhm goes to AVR pin 11 (T1).  Also put a 1uF between pin 11 and ground to smooth out the signal.

Hook up your programmer to the AVR and download the code onto it (the code is at the end of this Instructable).  See Step 11, you have to set the fuse bits on the AVR to disable the internal clock divider.  The clock/8 bit is turned on by default and needs to be disabled before the code will work.  After installing the AVR code onto the updated AVR, open up the client app and try turning on the fan.  It should light up and spin perfectly.  At this step you can either just shove your breadboard in your PC and call it done, or you can do it right and make a PCB.
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
52
Followers
9
Author:CalcProgrammer1
I'm attending Missouri University of Science and Technology for Computer Engineering. I like working with electronics, and I'll post instructions on projects. I also like the Nintendo Wii and the Xb...
more »