>Hi All, >I'm in need of some help. I have a PIC that produces PMW >output hooked up to a resistor and a cap. The problem is that >I need to control an external power source (a 9v batte >ry) and >be able to adjust its voltage. I thought of using a >transistor but what part # should I use to get the best >results? Also is there anything else I'm missing? The output, >once filtered, gives 0-5v. Thanks in advance. Here is a >proposed diagram: > > > +9v >PWM output (0-5v) 4.7k (tranistor?) [ >_[~]_[~]_[~]__-----<><><>--------------------------[ > ] [ > ] [ > --- 0.47uF (ground) > --- > ] > ] > ---- (ground) > -- > What is the frequency of the PWM? The 3dB cutoff frequency of your 4.7K, .47uF components are 1/(2 PI R C) = 72Hz. So if your rate isn't fast enough, the transistor (common collector/emitter ?) will just amplify your pulses/ramp. What resistants/type of load do you have? Someone posted a SPICE faq on sci.electonics, which may help in simulating your application.