Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

led on/off function problem

Status
Not open for further replies.

gauravkothari23

Advanced Member level 2
Joined
Mar 21, 2015
Messages
527
Helped
3
Reputation
6
Reaction score
3
Trophy points
18
Activity points
4,862
hi friends.
i need a help for 89s52. i have made a small project using 4x4 keypad, 10mm led, and 89s52. it has nothing to do but only on the led and also off the led on specific key press from keypad. i want to know that is it possible if i connect my 10mm led to directly to output port of 89s52. to get the output. or have to place any IC between led and 89s52 to control my led.
 

esp1

Advanced Member level 1
Joined
Sep 4, 2007
Messages
401
Helped
139
Reputation
278
Reaction score
139
Trophy points
1,323
Location
England
Activity points
3,373
hi,
What is the forward voltage and operating current of the 10mm LED.?
E
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,726
Helped
4,344
Reputation
8,697
Reaction score
4,304
Trophy points
1,393
Activity points
130,563
Hi,

Indeed it has nothing to do with 89s52, any other microcontroller will act the same.

It is a problem of voltage, current and ohm's law.

So as esp1 wrote, but additionally your Vcc is of interest.

Maybe you use 5V as Vcc, and the LED is built for 5V. But this is not very likely.
Usually LEDS have a forward voltage of 2.3V. If VCC is 5V and dropout voltage of microcontroller is 0.2V, then you need a resistor in series with the LED.
5V - 2.3V - 0.2V = 2.5V across the resistor.
If you now want 0.015A through LED = through resistor, then the resistor value is 2.5V / 0.015A = 167 Ohms.
A deviation of -10%...+20% should be no problem.

Klaus
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,274
Trophy points
1,413
Location
Southwest, USA
Activity points
62,510
One of the major limitations of the AT89Sxx series is its limited current sourcing capabilities, Port 0 is open drain therefore can only sink current and although Ports 1, 2 and 3 have internal pullups, their IOH is limited to a few uA before the respective VOH drops significantly.

AT89S52DCCharacteristics.JPG

Therefore, unless you wish to employ a BJT to drive the LED to sufficient current level and brightness, it would be advantageous to sink the current, rather than attempt to source it.

Also be aware, the IOL is limited to 10mA per port pin, 26mA total for Port 0, 15mA total for PORT 1, 2, 3 and 71mA total for all output pins.


BigDog
 

1101287021

Newbie level 6
Joined
Jul 9, 2014
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
101
Hi,

you should be connect led on port 1,2,3 . In this port pull-up register is their .but port 0 is open drain
 

SunnySkyguy

Advanced Member level 5
Joined
Sep 26, 2007
Messages
6,744
Helped
1,675
Reputation
3,348
Reaction score
1,644
Trophy points
1,413
Location
Richmond Hill, ON, Canada
Activity points
50,737
The brightest, most efficient LED is the best one to choose to operate at low current.

The best output is active low on port is 0 an ESR of 0.45V/3.2mA = 140 Ω. Use the voltage drop from Vcc to 3V if it is a White LED and compute the current limiting R including the driver internal 140 Ω. The LED ESR is around 10~15Ω for a 10 mm. LED when saturated.

Thus if using choosing 10 mA, (5V-3V)/10mA = 200 Ohms - 140-10 = 50 Ohms external series R.
If choosing 0 Ohms for Rs the typical White LED driver current is limited by (5V-3V)/(150Ω) ~13 mA on Port 0 by the internal open drain RdsOn.
 

SunnySkyguy

Advanced Member level 5
Joined
Sep 26, 2007
Messages
6,744
Helped
1,675
Reputation
3,348
Reaction score
1,644
Trophy points
1,413
Location
Richmond Hill, ON, Canada
Activity points
50,737
I think one LED needs minimum forward current to light-up is (If) 10milli ampere .
76/10 ~== 7 LED can light up clear Isn't it ?

LED's typically only need 2 ~3 mA to operate reliably of course at a fraction of power capacity.

10mm LED's offer no improvement in power capacity over 5mm due to the thermal insulation of epoxy and typically old technology.

ESR is 10~15 Ohms.
If max is 20 mA.continuous.

You could use all the available CPU ports 1,2,3 to combine max current (70mA) but this is rather primitive way to drive an LED.

For example this 10mm LED is an example of old technology used
https://www.digikey.com/product-sea...=1&stock=1&quantity=0&ptm=0&fid=0&pageSize=25

It is only 60mcd at 20mA, green

Whereas this green LED is almost 20,000 mcd at 30 deg at 20mA, same price, so would be over 2,000 mcd at 2mA and significantly brighter than the above 10 mm LED at 20mA.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top