| ||
The idea for this project came from Viktor's site, a guy that has some interesting projects in his DIY subdirectory. He cloned a HDD spindicator with 10 LEDs driven from a 4017 chip. I liked the idea but the implementation was kinda... sterilized. So, i decided to make one for my PC, but spice it up with PWM control... The problem is that... No, it is not a problem, it is the way that someone faces a problem. What i mean is that, the PICs that i use have only 4 PWM outputs. I could buy some others with 12 PWM outputs, but this is not the way i faced this problem. I could also use an I/O expander with PWM control, but this is definitely not the way i face problems. Instead, i chose to implement software PWM for the 12 LEDs that i will use. The only thing that the PIC will do is this: control the LEDs. An asynchronous edge-triggered interrupt will be generated whenever a pulse is detected from the HDD LED output of the motherboard, and this will be the only (short) routine that will run except the PWM routine. So the implementation was not that hard. As a matter of fact, i think that any other solution such as an external driver chip or a more expensive PIC with more PWM outputs would be somewhat an overkill... The Circuit The circuit is very simple:
Here is how it works. First of all, the HDD LED output of the motherboard is connected to the bi-directional LED of the optocoupler (IC2). I chose a bi-directional optocoupler so that the polarity that the LED is connected wont matter at all. A friend of mine (Hercules, AKA Herctrap) gave me an H11AA1 from Vishay which works just perfect. The outputs RC4-RC7 and RD0-RD7 drive the 12 LEDs of the spindicator. A small resistor is used to limit the current of the LEDs. Since i use a PIC 16LF, these outputs have 3.3 volts, so the resistors i use are rather small. The other LED driven from the output RC3 indicates the HDD operation. You may wanna use this output for a center 10mm LED which flashes every time a pulse is detected from the software. Remember that the PIC i use is an LF series and has maximum VDD of 3.6 volts. Order the 16F1937 PIC instead if you wan to power it from the 5V supply. The software Here are the assembly listing files if you wish to change the program and recompile it:
And here is the Hex file that you can directly upload to your PIC without compilation;
You will find some constants in the assembly listing that you can play with and have different effects of the spindicator: Bill Of Materials [BOM] For the LEDs, any type of LED with max forward voltage (Vf) of 3.6V and max forward current (If) of 20mA is acceptable. If you do not really know how to calculate the limiting resistors for the LEDs, then you may wanna read the LED driving and controlling theory. Continue reading. Click here to view the references. Comments
|
|
Contact
Forum
Projects
Experiments
Circuits
Theory
BLOG
PIC Tutorials
Time for Science
RSS
Site design: Giorgos Lazaridis © Copyright 2008 Please read the Terms of services and the Privacy policy |