I'm working on a circuit where I'm taking a PWM input from a Arduino and amplifying it to an arbitrary voltage between 25v and 10v, I need to then smooth it out to get the average voltage and then feed that final voltage into a 20mA load.
So far I tried using a BJT to amplify the PWM signal, but when I fed it into the filter, it would charge and discharge the filter asymmetrically due to the need for a resistor between the emitter and ground.
So I tried using an opamp as a comparator, as the voltage from the arduino for pwm is between 5 and 0v, I used a voltage divider and fed 2.5v into the inverting, and fed the pwm into the non-inverting, and let it swing between the arbitrary voltage and ground. the only problem with this is that the filter I have designed draws 0.5ish amps. Which the Opamp does not like one bit.
Arduino PWM sits at around 500Hz, so I made a 3 stage 50Hz low pass filter using 22uF cap and a 160ohm resistor.
So, where do I go to from here?