# Variable Voltage Using PWM and Low Pass Filter

I am trying to control a steady DC output voltage using a Micro controller with a PWM duty cycle. With the current schematic, the Voltage on Vout is pulsing along with the Mosfet at what ever the duty cycle is. I know that this is the result of Load being grounded only when Mosfet is "on", but can not figure out how to get around this. I want a smooth, controllable Vout that uses the same ground as the Fet. I know this is a noob question but any help will be appreciated. Also, I don't want to be picky but for me pictures really do speak a thousand words.

Current Schematic

Simulation

EDIT

What I'm really looking for is a way to use a low-pass filter to smooth a PWM voltage. This smoothed out voltage will then be used to power a 1 ohm load. I know how to create a PWM voltage and a low pass filter, but not how to implement both to power something. Since I'm new to circuits, a simple schematic drawing will be very helpful.

• You're measuring the voltage at Vout rather than across the load. – Spehro Pefhany Jul 22 '14 at 2:08
• The only way I could get the simulation to work was to put the load there. I just want a smooth Vout that powers the load. – Wallace Jul 22 '14 at 2:12
• I want be able to change the load on the devise I am designing. It has to be 1 ohms. I just need a way to ground it so that it want pulse. – Wallace Jul 22 '14 at 2:25
• I appreciate the help, but I'm having a hard time explaining what I want. Your solutions are noted, but not what I'm looking for. I need a different design, not a change values. – Wallace Jul 22 '14 at 2:32
• Yes it will create heat as dissipation at the filter resistors, capacitors that should support the high RMS current you want. For that application you use LC filters (inductor/capacitor) not RC (resistor/capacitor). If the voltage output you want is lower than the input I suggest you read about buck converters. – Diego C Nascimento Jul 22 '14 at 2:49

you have to read theory of DC/DC (buck or boost) converters. http://www.learnabout-electronics.org/PSU/psu31.php

Here's one viable approach.. the buffer simulates the micro output. The output in this case is 0-Vdd = 0-5V and that is filtered and buffered and amplified by 1.6 to give 8V. I used 1kHz for this, but you can adjust resistor and cap values to suit. For precision, you can use an actual buffer and give it a separate reference supply. The op-amp type will depend on your requirements, but probably would be a rail-to-rail in and out capable of handling the desired output voltage.

Edit: If you're actually wanting a 1 ohm load, you'll also need a hefty power stage followingt hte op-amp. This is a separate question, really. The PWM gets you the analog voltage, but you want a really high current, so that voltage requires a power analog buffer stage.

P.S. You should be able to run the simulation on this.

simulate this circuit – Schematic created using CircuitLab

• Yes, note that the low-pass filter uses quite high value resistors to get the time constants and the op-amp does not load it. There are other possible approaches such as an LC filter that could run cooler and avoid the op-amp (in place of it would be a half-bridge power driver) but this is the one from me tonight that more closely follows your question. – Spehro Pefhany Jul 22 '14 at 2:55
• I do not need to amplify the voltage, just adjust it variably. The devise is going to be high amps using high drain batteries. – Wallace Jul 22 '14 at 2:58
• You have an 8V source in your simulation. That is higher than most microcontroller PWM outputs (usually 3.3 or 5V). – Spehro Pefhany Jul 22 '14 at 3:02
• I know that, I'm using the microcontrollers 5v output to control a 8v duty cycle. – Wallace Jul 22 '14 at 3:04
• And thus amplifying it, so you do need an amplifier. – Spehro Pefhany Jul 22 '14 at 3:05