--- alan smith wrote: > OK...this is some random thoughts... > > Using the PWM of the PIC, you can 'dim' an LED by > modulating the on/off time and ramp it up and down, > etc. > > Now, what if you have a string of LED's that you want > to do this to. > > Putting in series of course, you add up the voltage > drops and it really doesn't do the trick. > > Putting in parallel gives a constant voltage but then > you need a current limiting resistor for each LED, and > not sure driving it from a PIC output, still limited > on the number of LED's based on the ability of the PIC > to either sink or source that current. > > But what about driving the parallel string with just a > simple transistor? Since the LED's are being > modulated of sorts by the PWM signal, the transistor > should just act as a driver? > > Late night thoughts....think its time to sleep and > wake up later and relize I've answered the obvious? > Well you can do this many ways :) 1) 75hc595 you bit bang the outputs you want on into the device. Load them into the output latch. Then run the PWM signal (inverted) into the Output Enable input. You might need to invert the PWM output though :) You don't need to use individual resistors to keep the current down. Putting some the LED's in series and using a Resistor pack works just fine with this method. You can easily drive 16 LED's this way. I've driven as many as 48 individually with 150 ohm resistor packs (9 resistors with a common type). 2) Use an appropriately sized MOSFET like a 2n7000 with a stable power supply. If you know the current you wish to drive the LED's at then you can place them in series so that the RDS on of the FET acts as the current limiting resistor you need for the chain of LEDs. The 2N7000 is rated at 75ma drive current at a VGS of 4.5V and an RDS of 6 ohms. With some tweaking you should be able to adjust the RDS to what you need by messing with the gate voltage. Since this device is rated to 60VDC you can string QUITE a few LED's on this with a 24VDC supply. Typical forward voltage is 1.85V for an GaAlAs LED at 20ma. This means you can drive 12 to 13 LED's as the voltage drop across the FET is likely to be negligable at 20ma. However playing with the gate voltage can get you better regulation. Anyhow I hope that gives you something to work with! Have fun Stephen R. Phillips __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist