IR Emitter on 3.3V Pro Mini

Hi Everyone,
I have a quick question. I'm hoping to create a small IR emitter (and detector) board using the Arduino Pro Mini 3.3V 8MHz board driven by a 3V CR2032 coin cell battery. I'm trying to make this as small as possible, which is why I went with the Pro Mini and coin cell battery. However, my concern is the current draw from a typical IR LED. As far as I can tell, this will draw around 50mA from the Arduino... which is more than each pin can handle. It's a better idea to use a transistor circuit (maybe something like this: SparkFun Max Power IR LED Kit - KIT-10732 - SparkFun Electronics) but that product says it's rated for 5V input. Is there any problem running that breakout board off of 3V input? Also, will there be any problems with the 8MHz clock in sending out a standard 38KHz frequency and also decoding the message on the other end? Thanks in advance for your help.
Cheers,
Andy

That may be more than the battery can cope with :wink:

You have around 200mAh, so it can provide 200mA for one hour, or 50mA for 4 hours. Then it'll be dead.

Typical standard discharge current of 0.2mA.

I'd think of something else if I were you :wink:

That's true... a coin cell may not be appropriate... but the form factor will be important here, plus this is just for an initial prototype. I can always jump up to a Lipo or some other battery source if power consumption becomes an issue. But, are there any issues running the transistor breakout board off of 3V? And do you think there will be any clock issues with 8MHz resonator to control a 38KHz blinking IR LED?
Thanks,
Andy

andyopayne:
Hi Everyone,
I have a quick question. I'm hoping to create a small IR emitter (and detector) board using the Arduino Pro Mini 3.3V 8MHz board driven by a 3V CR2032 coin cell battery. I'm trying to make this as small as possible, which is why I went with the Pro Mini and coin cell battery. However, my concern is the current draw from a typical IR LED. As far as I can tell, this will draw around 50mA from the Arduino... which is more than each pin can handle.

No need to worry, the pins of your Arduino Pro Mini 3.3V are perfectly safe... a CR2032 will never be able to provide that much current. :slight_smile:

Ok. So, do I even need a transistor circuit? Will the CR2032 not be able to provide enough current (ever) to power a single IR emitter? I only need this first prototype to run for 1 hr max... so I was hoping a small battery could work. Plus, the LED wont be on the whole time (small pulses is all I'll be sending... and not incredibly frequently). I can jump up to a larger power supply if necessary...

If you need to provide more than 40mA from a pin then you need a transistor.

There's no grey area there.

andyopayne:
Ok. So, do I even need a transistor circuit? Will the CR2032 not be able to provide enough current (ever) to power a single IR emitter? I only need this first prototype to run for 1 hr max... so I was hoping a small battery could work. Plus, the LED wont be on the whole time (small pulses is all I'll be sending... and not incredibly frequently). I can jump up to a larger power supply if necessary...

The way I interpret the datasheet is that the LED will work fine at 20mA. A CR2032 should be able to light your LED but maybe not at full brightness. Whether it will work or not depends on distance to receiver, ambient light, etc. The only way to find out is to try it and see.

Do you need a transistor? Not really. If you're worried about your Arduino you can always connect the LED to three pins and turn them on simultaneously (=120mA). Whatever you do, be sure to use a suitable resistor.

Thank you for the clarification. It is very much appreciated.
Best,
Andy

"you can always connect the LED to three pins and turn them on simultaneously (=120mA). Whatever you do, be sure to use a suitable resistor."

I am confused to read this ,

Is it right to connect three pins to one output :~(will it not burnt arduino pro mini 3.3v?) and if yes then is that current limiting resistance will run through each pin to output.Please clarify it?

Is it better alternative for transistor to amplify current to IR LED output from arduino?

As long as all three pins are set to the same level at the same time then there is no danger. The danger comes when you have one or more pins HIGH, and the other(s) LOW - then you get a dead short across the pins and you can burn them out.

You should only ever do this with pins that are all on the same PORT, and then only when doing direct port manipulation so all the pins are changed with the same instruction.

Also, please note that 40mA per pin is the absolute maximum for a pin. It is OK to use 40mA for very very short bursts. The data sheet recommends you should not exceed 20mA per pin under normal operation. Also there is a total limit for a whole I/O port of 150mA.

Although each I/O port can source more than the test conditions (20mA at VCC = 5V, 10mA at VCC = 3V) under steady state conditions (non-transient), the following must be observed:
ATmega48A/PA/88A/PA/168A/PA/328/P:
1] The sum of all IOH, for ports C0 - C5, D0- D4, ADC7, RESET should not exceed 150mA.
2] The sum of all IOH, for ports B0 - B5, D5 - D7, ADC6, XTAL1, XTAL2 should not exceed 150mA.
If IOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition.

jeny:
Is it right to connect three pins to one output :~(will it not burnt arduino pro mini 3.3v?) and if yes then is that current limiting resistance will run through each pin to output.Please clarify it?

This is possible as long as you are careful to get the software right. You need to choose 3 pins on the same physical port (B, C or D) of the mcu (see http://arduino.cc/en/Hacking/PinMapping168) and you need to use direct port manipulation so that you can simultaneously change the state of all 3 pins in the same instruction. However, if you do get it wrong and accidentally set one pin high and another low for a short while, then if you are running from 3V you are unlikely to damage the pins because the current will probably barely exceed 40mA.

jeny:
Is it better alternative for transistor to amplify current to IR LED output from arduino?

Using a transistor will save on Arduino pins and probably provide more current than you can get from 3 output pins, because of the output resistance of the pins. Also, it is best to generate the 38kHz IR signal from a PWM pin, in which case you can't drive the LED from multiple pins. Choose a transistor with a low saturation voltage at the highest LED current that you might want to use, such as BC337.

btw you can get IR emitters with various beam angles. A narrower beam angle will allow a greater range at lower LED current - provided you aim the LED sufficiently accurately at the detector.

andyopayne:
That's true... a coin cell may not be appropriate... but the form factor will be important here, plus this is just for an initial prototype. I can always jump up to a Lipo or some other battery source if power consumption becomes an issue. But, are there any issues running the transistor breakout board off of 3V? And do you think there will be any clock issues with 8MHz resonator to control a 38KHz blinking IR LED?
Thanks,
Andy

Two alkaline LR44's in series might be a better battery? If you want more current to the IR diode drive it from several
pins on the same port in parallel, and use direct port manipulation to ensure they switch together?

If you must use a coin cell, connect a 1000uF or greater capacitor in parallel with it. The capacitor will be able to supply the LED current if you only transmit in short bursts.

A single small resistor between the LED and ground should limit current to reasonable levels... is a resistor really going to make your project too big and bulky?