Loading...
Pages: [1]   Go Down
Author Topic: Arduino PWM only putting out 3.6Volts  (Read 299 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: 97
Posts: 6376
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

Offline Offline
Edison Member
*
Karma: 114
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: 277
Posts: 25522
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: 279
Posts: 15314
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
Print
 
Jump to: