pwm non linear outputs

:frowning: im using a 12v power supply
when
pwm is 0 - 0v output
pwm is 255 - 12v output
but
when pwm is 1 - 9.15 v output!
why is this happening? pls Help.
im using a mosfet irf1404 and cross checking the voltage output on my voltmeter.

A circuit diagram would enable us to understand what you are talking about.

Allan

If you just use the PWM pin of the Arduino to drive a mosfet and you measure that your DMM is simply fooling you :wink: The mosfet still outputs PWM but most DMM's can't measure that :wink:

septillion:
The mosfet still outputs PWM but most DMM's can't measure that :wink:

Yeah you need a 'scope.

And that's not a logic level mosfet, so it might not be switching nicely.

Can't trust your meter. It's like trying to measure light level in a room while a man with Parkinson's works the light switch.

Apples & Oranges.
9V is analog, PWM is digital (high/low).
Treating the PWM as a DAC does not make it a DAC. If you need a DAC, get a DAC, if you can't do tha try an RC LPF using a 4.7k ohm resistor and a 4.7uF cap. with the resistor connected to the PWM output and the output taken from the cap.

What frequency is the PWM operating at? You can imagine that ..... if the PWM frequency were (for example) 0.05 hertz, then your multimeter would be reading maybe 12 volt for 10 seconds, followed by 0 volt for 10 seconds, then 12 volt for 10 seconds etc. This would be for 50% duty cycle.

As somebody mentioned already..... see what your waveform looks like.... with an oscilloscope.

Also, PWM is not 'digital'. If PWM is used for switching a DC motor (to make the motor respond to an averaged value) for speed control, then it's not 'digital'..... it is 'just plain old switching'.

You can imagine that … if the PWM frequency were (for example) 0.01 hertz, then your multimeter would be reading maybe 12 volt for 10 seconds, followed by 0 volt for 10 seconds, then 12 volt for 10 seconds etc.

Your arithmetic needs some honing, I believe.
0.01 Hz (10 mHz) would be one complete cycle every 100 seconds, so 50 seconds high, 50 seconds low.

GrooveFlotilla:
Your arithmetic needs some honing, I believe.
0.01 Hz (10 mHz) would be one complete cycle every 100 seconds, so 50 seconds high, 50 seconds low.

My point was to indicate PWM frequency can make a difference. Regardless of what values I put, you understand what my point was, right? Choice of PWM frequency should be considered.

What you believe is actually wrong. Look again. I changed 1 value to 0.05.

Also, PWM is not 'digital',

Yes, I did not mean communications , I meant digital in the sense that there are TWO discrete VOLTAGE levels , and NOTHING in between, therefore , it is NOT analog.

I am aware what PWM is used for and it is NOT for generating ANALOG voltages (UNLESS you add a Low Pass Filter)

I'm not going to get into a "PWM is not digital debate". Suffice it to say, it is not analog and it has two discrete voltage levels , HIGH and LOW.

HENCE the name "PULSE width modulation."
You know what PULSE means , right ?

Loads of speculation on an unknown circuit.

So.

I reiterate

A circuit diagram would enable us to understand what you are talking about.

Allan