Hi Sayzer,
I'm just learning about driving LEDs & PWM here.
I want to be able to have numerous LED patterns (hence the individual PIC connections to the LEDS, but also a 'common' dimming ability (hence the PWM to the, tranny controlling the supply to all the anodes).
What I was ideally after was to connect the 'common' supply (controlled by the transistor) for all the LED anodes to 9V. This would save some heat losses, whereby the 9V gets regulated down to 5V first, & then feed the anodes.
the problem of course with using an unregulated power source, is that when the voltage starrts drooping (as the battery life fades), then the current through the LEDS will be less.
9V battery = plenty of LED brightness
7.8V battery = less LED brightness.
My idea was to monitor the voltage level of the battery within the PIC and then have an adjustable PWM ' maxceiling' to suit, therefore....
Fresh 9V battery = PWM value of 220 *max*
7.8V battery = PWM value of 255.
In other words I get the PIC to regulate the 'effective' voltage as presented to all the common anodes based on the battery voltage its monitoring.
Bookmarks