[Solved]PWM voltage output is only 0.5v

Hello everyone,

When I output a pwm signal from my Arduino Mega 2560 rev 3, the square wave only has a Vpp = 0.5v. How do I get the pwm voltage Vpp = 5V? I been looking around and many articles say its automatically has a Vpp=5 so I don't understand why my is giving 0.5v. I am using a pin with 490Hz and using an analogWrite statement with duty cycle 50%. thank you for your help!

For the pwm pin, do you have this in setup?
pinMode (pwmPin, OUTPUT);

@CrossRoad Yes, I do have pinMode in the set up

The attached o'scope screen shot doesn't help you fix things, but it does at least validate your thinking of how it ought to be. My sketch used both a 490 and a 980 PWM pin at 50%, and both channels do indeed show 5V.

Have you tried other pins?

Maybe post your code....

pwm hi and low freq with labels.jpg

If you post your code I'll run it on my Uno (I don't have a Mega) and 'scope it for you....

When I output a pwm signal from my Arduino Mega 2560 rev 3, the square wave only has a Vpp = 0.5v. How do I get the pwm voltage Vpp = 5V?

Is anything connected to the pwn pin, and if so, what is it?

Hi, how are you measuring Vpeak, not Vpeaktopeak as it is pulsed DC.
Also which pin areyou using to PWM output?

Tom.... :slight_smile:

thank you for the replies! my code :

int pin2 = 2;
void setup() {
Serial.begin(9600);
pinMode(pin2, OUTPUT);

}
void loop()
{
analogWrite(pin2,128);
delay(100);

/*
digitalWrite(pin2,HIGH);
delay(100);
digitalWrite(pin2,LOW);
delay(100);

*/

}

I have tried outputting the PWM automatically and manually, thus the commented out portion.

Yes, I have tried other pins but yield the same results of 0.5V unfortunately.

I am measuring Vpeaktopeak by connecting the pwm output pin to an oscilloscope.

Thank you all for your help!:slight_smile:

Hey guys, I figured out the problem, the probe we were using was 10:1, which is why the magnitude was off. Thank you for all your help! :smiley:

Oops, so when you put the scope in the walloutlet you measure something like 30 volts max, wow lucky you are alive.

hihi, always nice if the stupidity is solved so easy, it depends on how you ask the question.

The moral here is when ever you get an unexpected reading, measure something that you know the voltage of, like the supply rail.
It can happen to the best of us, lead on the wrong setting, like you had or channel switched to zero or the wrong voltage or even a faulty scope lead. I have had the lot but by measuring something you know is right you can eliminate this sort of mistake.