Arduino Forum

Using Arduino => LEDs and Multiplexing => Topic started by: lRaHl on Oct 03, 2011, 02:10 am

Title: Blinking IR LEDs in the car
Post by: lRaHl on Oct 03, 2011, 02:10 am
I have 6 IR LEDs that I want to run off a cigarette lighter outlet in a car. (High output infrared LED 5mm 1.2VDC 100mA 940nm)

I'm going to be using the Arduino Uno with the blink program.

How do I use the Arduino for timing? and how should the schematic look?
Title: Re: Blinking IR LEDs in the car
Post by: johnwasser on Oct 03, 2011, 02:40 pm
Parallel LED's: 12 V - 1.2 V = 10.8 V, 10.8 V / 0.100 A = 108 Ohms in series with EACH LED.

Series LED's:  12 V - (6 * 1.2 V) = 4.8 V, 4.8 V / 0.100 A = 48 Ohms in series the string of 6 LED's.

You'll need a transistor to switch the 100 mA power because the Arduino can only source 40 mA.
Title: Re: Blinking IR LEDs in the car
Post by: lRaHl on Oct 03, 2011, 10:38 pm
What kind of transistor would I need? I'm going to be using pin 2.

Code: [Select]
int led = 2;

void setup() {
  pinMode(led, OUTPUT);     
}
void loop() {
  digitalWrite(led, HIGH);
  delay(35);
  delayMicroseconds(544);
  digitalWrite(led, LOW);
  delay(35);
  delayMicroseconds(552);
}
Title: Re: Blinking IR LEDs in the car
Post by: dc42 on Oct 04, 2011, 02:26 am
A BC337 with a 1K resistor from the Arduino pin to the base will do the job nicely, but there are many other suitable types.

If you will be running the LEDs with the car engine running, then I suggest you design for maximum current at 13.5v instead of 12v, to avoid driving the LEDs above their rated current. If you want close to 100mA whether or not the engine is running, use a constant current source such as I have shown in the image. If necessary, put a larger value resistor in parallel with the 6.8 ohm resistor to bring the current up to 100mA.
Title: Re: Blinking IR LEDs in the car
Post by: macegr on Oct 04, 2011, 02:46 am
14 Hz, eh? MIRTs are illegal, prepare for some jail time and hefty fines.