1
\$\begingroup\$

I need to transmit infra red signals using IR LED from my Arduino device. The IR signals consist of PWM 40 kHz periods and "silence" periods of various length (typical IR remote signals).

I know there is IR remote library that uses internal clock registers, but unfortunately, my device has all PWM pins already used.

I need to power the IR LED with a regular PIN. As far as I know it's not possible to achieve exact 40 kHz on digital output PIN with software only. So I would like to include 555 circuit between Arduino digital output PIN and the IR LED so that the high state of digital PIN caused blinking of the LED at 40 kHz.

I'm not sure how the wiring should look like.

I was thinking of using this schematic:

Schematic

(Source)

And attaching +5V to Arduino output PIN, but I feel this solution is not perfect. Is there any better way to connect 555 to Arduino output pin?

Update: I used solution described by akellyirl below and it works perfectly. I used R1=1000Ohm, 2000Ohm potentiometer as R2 and C1=C2=10nF. Pulses triggered by arduino pin connected to Reset pin of 555 of length between 400 and 1600 microseconds are properly interpreted by my Technics HiFi.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ I would leave the 555 always powered and clocking, and then gate the LED signal with a transistor controlled from the Arduino. \$\endgroup\$
    – Majenko
    Oct 1, 2014 at 10:43
  • \$\begingroup\$ @Majenko , sorry for basic questions but how exactly the transistor should be wired to led and arduino output PIN? \$\endgroup\$
    – PanJanek
    Oct 1, 2014 at 11:03
  • \$\begingroup\$ PNP (or P-channel logic level MOSFET) between 5V and R1 is the simplest layout. You may want to invert your control signal with an NPN from the PNP's base to ground, otherwise a HIGH will turn if off, and a LOW will turn it on (fine if you remember it's that way round ;) ) \$\endgroup\$
    – Majenko
    Oct 1, 2014 at 11:04
  • \$\begingroup\$ @Majenko: It's easier to simply connect the Arduino pin to the 555's reset input (pin 4). \$\endgroup\$
    – Dave Tweed
    Oct 1, 2014 at 11:31
  • \$\begingroup\$ True, though what kind of startup delays do you get from the reset pin? (less than controlling the power I'd guess). \$\endgroup\$
    – Majenko
    Oct 1, 2014 at 11:38

2 Answers 2

2
\$\begingroup\$

That schematic is poorly drawn and hard to understand. See here for a good tutorial.

enter image description here

Anyway, you should use Arduino to control the RESET pin (pin4). High enables the Oscillator , Low disables it.

Also, it would be far better not to drive the LEDs directly from the 555.

See this related question for more info on how to do that.

\$\endgroup\$
2
  • \$\begingroup\$ Ok, so I should connect PIN 4 to Arduino output PIN directly instead of +5V right? I use one IR LED on 5V with 100Ohm resistor so it takes less than 50mA, NE555 should manage to drive it without transistor on PIN 3 I think? \$\endgroup\$
    – PanJanek
    Oct 1, 2014 at 11:48
  • \$\begingroup\$ @PanJanek Yes. You got it. A quick look at the NE555 datasheet shows +/- 200mA capability on the Output. \$\endgroup\$
    – akellyirl
    Oct 1, 2014 at 13:42
1
\$\begingroup\$

The frequency doesn't need to be very accurate for IR. I found that even 10% error works just fine.

So delayMicroseconds should do nicely, as long as you don't need your arduino to do something else at the same time, to directly drive the leds (using a transistor, since the arduino pins can't deliver enough current) at 38kHz.

About those leds : they should have each their own current limiting resistor. Since two leds won't have the exact same forward voltage (and since the current varies with the voltage more or less exponentially) parallel LEDS may see a very different current (which impacts efficiency and ageing).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.