Constant current IR LED circuit

An area for more general discussion by the user community for topics not covered elsewhere
Post Reply
User avatar
AnalysIR
Site Admin
Posts: 390
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Constant current IR LED circuit

Post by AnalysIR » Fri Nov 22, 2013 3:55 pm

We recently publish a blog post about a constant current IR LED circuit.

See http://www.analysir.com/blog/2013/11/22 ... d-circuit/

If you have any questions about the article or circuit or enhancements, please comment here.

User avatar
AnalysIR
Site Admin
Posts: 390
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Constant current IR LED circuit

Post by AnalysIR » Fri Nov 22, 2013 5:22 pm

Sample code used in sketch to generate a circa 37kHz modulated signal @ 50% duty cycle is below:

Code: Select all

/*
  Sample modulation signal
  Turns on an Pin 7 on/off for 13 uSecs, repeatedly.
  This example code is in the public domain.
 */
 
int led = 13;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
  pinMode(7, OUTPUT);   //modulated signal is on Pin 7  
}

// the loop routine runs over and over again forever:
void loop() {
 while (true){   
  digitalWrite(7, !digitalRead(7)); 
  delayMicroseconds(6);  //also allows for delay/ovehead caused by all of the code in this loop             
 }
}
Note: if you are sending IR use IRremote, IRLib or PWM to generate your modulated infrared signal. This code is for testing and measurement purposes only.

mruttmann
Posts: 5
Joined: Tue Mar 20, 2018 2:07 pm

Re: Constant current IR LED circuit

Post by mruttmann » Wed Mar 21, 2018 3:35 pm

Currently I'm using just one IR LED I'm my project, but it is supposed to be applied to a classroom (measuring circa 5x5 meters). My professor advised me to use 3 IR LEDs in order to achieve a better range.

My current circuit have a 2N2222 transistor connected to the Arduino port through a 470R resistor. The IR LED is connected to transistor's emitter (anode) directly to GND (cathode). It works well for residential applications (I could activate devices from 3 to 4 meters, but had to point the LED to the device).

What changes I should made to your 2 LED circuit in order to add one more IR LED? The MEGA 2560 digital ports supply 5V, right?

Thanks!

User avatar
AnalysIR
Site Admin
Posts: 390
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: Constant current IR LED circuit

Post by AnalysIR » Wed Mar 21, 2018 11:00 pm

The circuit on our blog should be enough as is.

All you need to do is to use any 2 from tsal6100, tsal6200 & tsal6400. (all have different angles from narrow to wide)

Mixing the LED angle gives you better coverage, particularly when combined with increased current.

If you calculate the IR current to be up to 300MA (Peak), you effectively have 600mA IR current from the 2 LEDs, which is more than enough.
Light & IR will reflect off most surfaces! walls, windows , ceilings etc

If you really think you need more LEDs, then just duplicate the emitter circuit.

You may also be able to get 3 leds in series with a 5->5.5V supply - if you keep the current lower(=higher value resistor).

Bottom line is that your 'professor' probably wants you to try out all of the variations yourself, as a very good way to learn.

mruttmann
Posts: 5
Joined: Tue Mar 20, 2018 2:07 pm

Re: Constant current IR LED circuit

Post by mruttmann » Thu Mar 22, 2018 10:10 am

Understood.

Thank you very much!

Post Reply