PWM and Voltage measurement DMM

Working with my Fez panda, I recently found a behavior that was unexpected for me. I had thought that when PWM is being used, the voltage will be stable, and it is the duty cycle that changes. Thus if I measure the voltage with a DMM, it will see the peak voltage. Instead what I have found is that the DMM will see a different voltage when a port is switched from 30% duty cycle to 100% duty cycle.

is this a side effect of PWM and as such a DMM just won’t be accurate? Or is there really a voltage changing going on?

The reason why I’m so curious is that I used the total output voltage to calculate proper resistor sizes, and if I find it is moving around, that will influence those calculations.

Digital multimeter’s will display the RMS voltage on a PWM signal… I have also used PWM as an alternative analogue output… It’s quite crass but it works very well (slightly non linear…well bit more than slightly)…

Cheers Ian

So for example. With a PWM pin being used which has a 3.3v output driven as PWM at 30K frequency and 100% duty cycle, what v should I expect to see?

[quote]So for example. With a PWM pin being used which has a 3.3v output driven as PWM at 30K frequency and 100% duty cycle, what v should I expect to see?
[/quote]

Uh, 3.3V :smiley: (100% duty cycle is always on, 50% is 1/2 of the time on the other half off, so you would get 50% of 3.3V)

If you use a decent quality true RMS volt meter this type of measurement works out pretty well, with a cheap meter you’ll see the voltage change but you won’t get an accurate reading.

Jeff… That’s when it gets a bit non linear 50% duty cycle isn’t 1.65v it will be more like 1.8v it depends on the frequency used… However 3.3v at 100%.
Using PWM as a analogue out largely depends on the circuit your driving as well.

Cheers Ian

Next Step. if the meter is seeing a voltage at 50% duty cycle of 1.8v, what is the actual voltage you should use when calculating things like transistor bias voltage? 3.3, or 1.8?

A transistor only requires about 0.67v to switch on…But if you use PWM directly to drive a transistor, the transistor will not switch clean… You will have to smooth the voltage with a decoupling cap and resistor circuit.

I need to know the application as the cap and resistor must be tuned to the frequency in order to get a smooth reading.

Cheers Ian