Pages: [1]   Go Down
Author Topic: Arduino PWM only putting out 3.6Volts  (Read 546 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using the command

analogWrite(ledManual, 255);

and have the pins connected so they attach to the led positive in, a series 20ohm resistor, and then ground on the Arduino MEGA board. When I read the voltage from pin 2 to ground directly I get 5volts but when I connect them to the resistor, I only get 3.6 volts. Approximately 0.7 over the led and 2.9V over the resistor. Does anyone know why this is happening?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8661
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your series resistor is WAY too small.  You are drawing 145 mA (2.9 Volts / 20 Ohms) from a pin that has an absolute maximum rating of 40 mA!
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
a series 20ohm resistor,

You probably want to read the datasheet.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33292
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Approximately 0.7 over the led
Are you sure of that? Most visible light LEDs have a minimum voltage of at least 1.2V. Is it an IR LED?

If you need to drive your LED that hard you need a transistor.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your series resistor is WAY too small.  You are drawing 145 mA (2.9 Volts / 20 Ohms) from a pin that has an absolute maximum rating of 40 mA!

Thank you! I didn't even think of that, the LED isn't even in the final project. I was just using it for testing of code, I grabbed a resistor out of the network and put it in series without even thinking about it but yes that was the reason.


On a note of the voltage, your right. I reversed them. The resistors only dropping 700-800mV, and the LEDs dropping the rest. I'm not sure why the led is dropping so much, perhaps because the resistor was so low.
 
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'm not sure why the led is dropping so much, perhaps because the resistor was so low.

Perhaps it's the color of the led you are using as they have very different Vf ratings between the color choices.

So what kind of led are you using?

Lefty
Logged

Pages: [1]   Go Up
Jump to: