Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Drive a LED from Atmega168 without RES

Status
Not open for further replies.

Scarr

Member
Hi,

Is there any issues with driving a OPB710F LED directly from a I/O PIN of the Atmega168 without a limiting resistor? I want to drive it at it's MAX power (50ma)

Thx
 
Scarr said:
Hi,

Is there any issues with driving a OPB710F LED directly from a I/O PIN of the Atmega168 without a limiting resistor? I want to drive it at it's MAX power (50ma)

Thx


well im not sure what a Atmega168 is, but im pretty sure you will need a resistor there, the LED would probably have a voltage drop of 2.6 to 3.6V and the output is likely to produce more than that, minimum 5V i would assume, put a multimeter across the output and see what the output voltage is, if its in between 2.6 & 3.6 then you wont need the resistor, but the output will probably be whatever your input supply is?
 
Last edited:
There might be problems with direct-driving. The AVR in general is only rated to sink up to 25mA per I/O. With resistors, you may be able to use 2 or 3 pins to sink the full 50mA. But the safest bet is to have a transistor or some other buffer drive the LED.
 
shaneshane1 said:
the LED would probably have a voltage drop of 2.6 to 3.6V and the output is likely to produce more than that

The OPB710 is an infra-red LED and phototransistor housed inside one package. The IR LED has a max forward voltage drop of 1.5V so a resistor will be required for that reason, if not to limit current as well. 50mA is a lot to draw from a Microcontroller so a driver will be required anyway.

My feeling is that if you connected the IR LED directly to the output pin of a Microcontroller, it probably wouldn't light at all. It would try to draw too much current, which would drop the output voltage below the required forward voltage drop of the LED. It might even destroy the Micro.

Brian
 
Last edited:
Brian Hoskins said:
The OPB710 is an infra-red LED and phototransistor housed inside one package. The IR LED has a max forward voltage drop of 1.5V so a resistor will be required for that reason, if not to limit current as well. 50mA is a lot to draw from a Microcontroller so a driver will be required anyway.

My feeling is that if you connected the IR LED directly to the output pin of a Microcontroller, it probably wouldn't light at all. It would try to draw too much current, which would drop the output voltage below the required forward voltage drop of the LED. It might even destroy the Micro.

Brian

didnt know it was infra-red LED, as for the 50mA been alot for a microcontroller is that common for all?

my PIC can draw 800mA at any given output X8 is that common among PIC's?
 
It might be possible if the Vcc of the ATmega168 matched the forward voltage of the LED. It's still a reckless thing to do. What is the objection to using a resistor. A little bit of insurance goes a long way.
 
shaneshane1 said:
didnt know it was infra-red LED, as for the 50mA been alot for a microcontroller is that common for all?

my PIC can draw 800mA at any given output X8 is that common among PIC's?


800mA per output? At 5V, that's 4W per output pin. Are you sure??

Brian
 
Thanks for all the replies

I was thinking about using a PIN to "sink" the current, put 5v on Anode and sink cathode via AVR PIN, as it can only sink XXma I thought I would not need a resistor or if I put a resistor on it would note drive it sufficiently?

Thx
 
Brian Hoskins said:
800mA per output? At 5V, that's 4W per output pin. Are you sure??

Brian


yep, have a look at the picture
 

Attachments

  • 800mA.PNG
    800mA.PNG
    52 KB · Views: 270
Ahhhh, so now it is clear where your confusion is coming from. Your project board does indeed supply 800mA per output - via a darlington driver IC. The PIC itself is probably rated at 25mA per output.

Brian
 
Brian Hoskins said:
Ahhhh, so now it is clear where your confusion is coming from. Your project board does indeed supply 800mA per output - via a darlington driver IC. The PIC itself is probably rated at 25mA per output.

Brian

yes i just confused the hell out of myself then, for a second there i was thinking that the PIC was outputing 500mA to my servo motor, but the power for the servo comes from a different supply, and i just use the output for the signal.
 
shaneshane1 said:
yes i just confused the hell out of myself then, for a second there i was thinking that the PIC was outputing 500mA to my servo motor, but the power for the servo comes from a different supply, and i just use the output for the signal.
Ya shaneshane1, your Picaxe PIC is a 16F88. Standard max output per pin is 25ma.
 
My post went off on a different course :eek:)

Hi, just thought I'd re-post this as my post had a mind of it's own :eek:) and I didn't get a reply to my last post.

I was thinking about using a PIN to "sink" the current, put 5v on Anode and sink cathode via AVR PIN, as it can only sink XXma I thought I would not need a resistor or if I put a resistor on it would note drive it sufficiently?

Thx
 
Scarr said:
Hi, just thought I'd re-post this as my post had a mind of it's own :eek:) and I didn't get a reply to my last post.

I was thinking about using a PIN to "sink" the current, put 5v on Anode and sink cathode via AVR PIN, as it can only sink XXma I thought I would not need a resistor or if I put a resistor on it would note drive it sufficiently?


ALWAYS, ALWAYS use a current limiting resistor! - don't think about it, do it properly!.
 
Hi Nigel

OK get the message, your saying use one anyway

But I don't understand if the PIN can only sink 40ma then is this not just like a limiting resistor, how can it possibly damage the LED unless it was a fauly PIN/MCU, if you still say "use a resistor" what size should it be? bearing in mind my I want to drive it at 50ma? 82R (43ma) or can I get away with 68R (52ma)

P.S. 5v supply

Thx
 
Scarr said:
OK get the message, your saying use one anyway

But I don't understand if the PIN can only sink 40ma then is this not just like a limiting resistor, how can it possibly damage the LED unless it was a fauly PIN/MCU, if you still say "use a resistor" what size should it be? bearing in mind my I want to drive it at 50ma? 82R (43ma) or can I get away with 68R (52ma)

The pins aren't 'current limited' at 40mA, it's specified as it's maximum safe capacity. It's not the LED it might damage, it's the chip.

If you want to run the LED at 50mA, which is more than the safe rating of the pin, either use a driver transistor, or parallel two pins to double the safe capacity - and still use a resistor.
 
ah it's starting to make sense

OK, I prefare the resistor route as it's less hassle, I have placed a 82R and the current was low so I tried a 39R and it measured 54ma, it is only on for 50ms whilst I detect then off for a seconds.

Does using a 39R %5 resistor sound OK?

Thansk for all your help as usual
 
The datasheet quotes 50mA as a maximum rating for the device, but it doesn't quote a typical value. 50mA doesn't sound unreasonable for an IR LED though.

Brian
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top