trying to make led to blink

Status
Not open for further replies.

Manchested

Member level 5
Joined
Apr 25, 2011
Messages
87
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
0
Hi all,

I am trying to make an LED blink using atmega8 and calculate the resistor needed. To draw 30mA, the vo will be at 4.3V, and vf is 2.1V, should I use 4.3v or just 5v to calculate?

 

You should use 4.3v since the voltage of the pin will be at that level when you have the led consuming 30mA.
30mA is kind of high for a led, it is usually 10-15mA but the AVR can provide the current if this is what you want so there is no problem.

Note that the chip max current is 300mA so I hope you don't intend to drive many leds.

Alex
 

Hi Alex,
Say if resistance is (4.3 - 2.1)/0.03 = 73.3 ohms
if using 73.3ohms, (5-2.1) / 73 ohms = 39.5mA, and vo will be at 3.9V
this is where I am confused :-?
 

As soon as your led starts to sink current the output voltage of the pin will start dropping, you can't use 5v to calculate this, you are ignoring the voltage drop.

Alex
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…