EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: dentaku on February 21, 2015, 05:44:12 pm

Title: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 21, 2015, 05:44:12 pm
Lately I've been learning about IR remotes. I have a few dark bleu-ish IR emitters and receivers in my bins of stuff so I captured all the codes from a Sony remote control and made a little single pushbutton device with my Arduino UNO that can turn the volume up on a Sony TV using the IRemote Arduino library.

I see that real remotes work MUCH better than my makeshift device. I even unsoldered the clear not blue-ish emitter from a real remote (the TV it goes with is dead so I didn't care about it) and it works a bit better but you still have to point it at the TV perfectly and it doesn't work more than about 3 meters away.

Question...
What makes official remote controls work so much better? I can point an official Bell expressVu remote away from the TV and it still works.

here's the code if anyone's interested. I have a 100ohm resistor on the IR LED. Sony's send all commands three by the way.

Code: [Select]
//*
 * IRremote: IRsendDemo - demonstrates sending IR codes with IRsend
 * An IR LED must be connected to Arduino PWM pin 3.
 * Version 0.1 July, 2009
 * Copyright 2009 Ken Shirriff
 * [url]http://arcfn.com[/url]
 Sony codes I captured from the TV's remote
 290 - mute
 A90 - power
 10 - #1
 810 - #2
 410 - #3
 C10 - #4
 210 - #5
 A10 - #6
 610- #7
 E10 - #8
 110 - #9
 910 - #0
 2F0 - up
 AF0 - down
 2D0 - left
 CD0 - right
 490 - vol+
 C90 - vol-
 90  - ch+
 890 - ch-
 */

#include <IRremote.h>
const int buttonPin = 2;     // the number of the pushbutton pin
int buttonState = 0;         // variable for reading the pushbutton status
IRsend irsend;

void setup()
{
  Serial.begin(9600);
  pinMode(buttonPin, INPUT);     // initialize the pushbutton pin as an input
}

void loop() {
 buttonState = digitalRead(buttonPin);
  if (buttonState != LOW) {
      irsend.sendSony(0x490, 12); // Sony TV vol+ code
      delay(40);
      irsend.sendSony(0x490, 12);
      delay(40);
      irsend.sendSony(0x490, 12);
      delay(40);
  }
}
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: Mechanical Menace on February 21, 2015, 05:50:57 pm
2 guesses here. You're not supplying as much power to the LED as an official remote does or the LED you're using has a narrower beam.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: Alex Eisenhut on February 21, 2015, 05:57:04 pm
I don't know. What is the IR emitter datasheet? Is it known good?

Is the Arduino IR library known to work with Sony? Sony *always* has to be different somehow, remember.

And your 100 ohm resistor to what? In series with the LED? Directly from a 3.3V IO pin? That's a lot of current for a single IO pin to supply, IR LEDs have a low Vf and typically need more current than visible LEDs.

Point your remote to a video camera/cell phone, you should see how "bright" your remote is compared to a "real" one.

I'd bet a dollar you simply don't have enough electron juice going through your LED, you're going to either need to parallel a few IO pins or make a transistor amplifier.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 21, 2015, 06:29:02 pm
I don't know. What is the IR emitter datasheet? Is it known good?

Is the Arduino IR library known to work with Sony? Sony *always* has to be different somehow, remember.

And your 100 ohm resistor to what? In series with the LED? Directly from a 3.3V IO pin? That's a lot of current for a single IO pin to supply, IR LEDs have a low Vf and typically need more current than visible LEDs.

Point your remote to a video camera/cell phone, you should see how "bright" your remote is compared to a "real" one.

I'd bet a dollar you simply don't have enough electron juice going through your LED, you're going to either need to parallel a few IO pins or make a transistor amplifier.

They're just random IR LEDS that look like they are from old RadioShack stock.
I actually have the original packaging form one of them and it says

Maximum voltage and currents
Reverse voltage:                    5V
Continuous forward current:   150mA
Forward voltage: 1.3V typ., 1.7V max
Radiant power output:    15 -1 15mW
Wavelength at peak emission: 950nm

I tested one with my little transistor/diode/cap etc. tester and Uf is 1.33V so it matches the datasheet. A green LED was closer to 2V for example.
I'm just powering it directly from the 5V of the Arduino.
http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html (http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html)

Maybe I should try using a transistor to switch the IR LED and use an external power supply like a 9V battery through a 180ohm resistor instead of powering the emitter from the 5V of the Arduino?

This page also says IR LEDs usually require more current that regular ones.
http://www.learningaboutelectronics.com/Articles/What-is-the-forward-current-of-an-LED (http://www.learningaboutelectronics.com/Articles/What-is-the-forward-current-of-an-LED)
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: mikeselectricstuff on February 21, 2015, 06:38:35 pm
IR remotes use short duty cycles with peak currents up to half an amp. You will typically find a cap of several hundred uF in a remote to supply the brief high current, and a switching transistor. For a 3V supply, a series resistor below 10 ohms is typical
 
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 21, 2015, 07:01:16 pm
IR remotes use short duty cycles with peak currents up to half an amp. You will typically find a cap of several hundred uF in a remote to supply the brief high current, and a switching transistor. For a 3V supply, a series resistor below 10 ohms is typical

So since the pulses are usually so short you can use them with rather high currents?

I just pointed my brother's phone at a real remote and then at mine and the difference in brightness is noticeable.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: electr_peter on February 21, 2015, 07:11:26 pm
Other than current/brightness, there can be timing issues in your IR output. Arduino may not provide the timing you want - you have to check and adjust/optimise it. Have you checked with a scope?
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: tom66 on February 21, 2015, 07:44:21 pm
So since the pulses are usually so short you can use them with rather high currents?

I just pointed my brother's phone at a real remote and then at mine and the difference in brightness is noticeable.

I have worked on a product which uses 1.2A per IR LED, with two IR LEDs. (It's an IR blaster which controls other devices, not battery powered.) The ripple current was high enough that we needed to put an LC filter onto that portion of the circuit as otherwise our 5V rail would drop out under load causing the MCU to reset.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 22, 2015, 02:37:59 am
I just used a 2N2222A and a 180ohm current limiting resistor to switch the IR LED using it's own 9V battery and now I can turn the volume up even with the device facing backwards so I guess 50mA is about right for this device.

It's a ridiculous looking remote considering it's an UNO with a tiny breadboard, a big yellow pushbutton and two 9V batteries and all it can do is control one function on nothing but Sony TVs :)
I've got a nice 4X6 keypad from an old marine GPS that I should hook up so I can control more stuff.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: free_electron on February 22, 2015, 02:42:16 am
Random ir leds ? They may be the wrong wavelength
Or you are not pumping enough juice through tem
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 22, 2015, 04:03:34 am
Random ir leds ? They may be the wrong wavelength
Or you are not pumping enough juice through tem

Yes, like I said in my last post it works well now that I tried controlling the IR LED with a transistor and a 9V battery instead of just powering it directly from the 5V of the Arduino which couldn't safely supply the needed current anyway.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: Alex Eisenhut on February 22, 2015, 05:12:55 am
Random ir leds ? They may be the wrong wavelength
Or you are not pumping enough juice through tem

Yes, like I said in my last post it works well now that I tried controlling the IR LED with a transistor and a 9V battery instead of just powering it directly from the 5V of the Arduino which couldn't safely supply the needed current anyway.

Well hold on there, the Arduino IO *pin* might not be able to supply the current, but what is providing the 5V to the system? Are you saying that can't supply about a 100mA more? You could clean up the whole thing by just using the available 5V supply rail.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: Psi on February 22, 2015, 05:29:03 am
N channel mosfet will be in order
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: BravoV on February 22, 2015, 05:43:49 am
Although its not an accurate or the "right" method, a quick & dirty way to see if the IR is working is to see through you digital camera or cell phone's camera.

See if your IR led is "bright" enough compared to other one.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: coppice on February 22, 2015, 05:55:48 am
How close to 38kHz is your modulation? Most receivers don't lose much sensitivity until you are a couple of kHz off, but some are quite narrow band.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: hexreader on February 22, 2015, 07:09:50 am
I have tested your code on my arduino and if you remove one of the two "/" characters on the first line, it works perfectly.

It gives an accurate 40kHz modulation and the correct output for vol+

I suspect that the problem lies with IR LED drive current as others have suggested. 39 Ohms using +5V and driver transistor is a good, safe combination for reasonable range. Most IR LEDs can handle 100mA continuously.

I use two IR LEDs each with its own 10 Ohm resistor. Each LED can handle 100mA average, and 1A for very short duration. Your program outputs a 1/3 duty cycle, so I am able to drive 30mA per LED and still stay within 100mA average spec. This may be a risky thing to do in an experimental environment, as a permanent high will overload the IR LEDs.

What you can achieve depends on the spec of the IR  LEDs that you are using.

In summary, use a transistor, 5V supply, 39 Ohms (or less if you dare) and maybe multiple IR LEDs.


Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: DavidDLC on February 22, 2015, 07:42:02 am
Some remote controls will send the same information several times with some delay between them, in case the receiver does not get the correct information the first time.

At least I saw that behavior with a Sony remote control when capturing the waveform using a oscilloscope, then I read about this method.

David.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: hexreader on February 22, 2015, 07:50:36 am
Some remote controls will send the same information several times with some delay between them, in case the receiver does not get the correct information the first time.

At least I saw that behavior with a Sony remote control when capturing the waveform using a oscilloscope, then I read about this method.

David.
Yes, the OP has already covered that in his code. He sends the same command three times with 40mS gap between messages.

The code is just fine.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: DavidDLC on February 22, 2015, 08:12:42 am
Great, I didn't check the code.

David.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: coppice on February 22, 2015, 08:34:21 am
I have tested your code on my arduino and if you remove one of the two "/" characters on the first line, it works perfectly.

It gives an accurate 40kHz modulation and the correct output for vol+
40kHz is far enough off frequency to substantially desensitive the receiver. You don't need to be super close to 38kHz, but 2kHz off really starts to affect results.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: hexreader on February 22, 2015, 08:50:17 am
40kHz is far enough off frequency to substantially desensitive the receiver.
Sorry to disagree, but 40kHz is exactly on frequency for Sony protocol :)
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: miguelvp on February 22, 2015, 09:09:06 am
Not sure why all the disagreements

but the OP got it working but adding more juice.

Yes, like I said in my last post it works well now that I tried controlling the IR LED with a transistor and a 9V battery instead of just powering it directly from the 5V of the Arduino which couldn't safely supply the needed current anyway.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: hexreader on February 22, 2015, 09:13:38 am
Not sure why all the disagreements

but the OP got it working but adding more juice.


Doh !   ....     :palm:
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: PA0PBZ on February 22, 2015, 09:40:24 am
Why is it that OP posted that he solved it in reply #8 and then the thread goes on suggesting the same and other solutions over and over again? Does anyone actually read the thread before posting?  :-//
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: AndreasF on February 22, 2015, 01:17:07 pm
Why is it that OP posted that he solved it in reply #8 and then the thread goes on suggesting the same and other solutions over and over again? Does anyone actually read the thread before posting?  :-//

This: http://blog.codinghorror.com/because-reading-is-fundamental-2/ (http://blog.codinghorror.com/because-reading-is-fundamental-2/)

I especially liked the Banana experiment.  >:D
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: SeanB on February 22, 2015, 01:42:43 pm
Bananas, I just finished the last one in the bunch.

Back to the OP consideration, I have often seen IR transmitters with limited power using a very nice trick, having a local RC circuit with a typical value 10R resistor and a 1000uF capacitor feeding the LED power, so that you can have a very high transmit power, but the current drawn from the supply is limited by the resistor, so it is low enough not to reset the MCU because of the high internal resistance of the main supply. You do need though to keep duty cycle low, which is easy on an IR transmitter as there even with a key pressed continuously most IR transmitter protocols are going to have a low sub 10% duty cycle.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 22, 2015, 02:04:27 pm
Random ir leds ? They may be the wrong wavelength
Or you are not pumping enough juice through tem

Yes, like I said in my last post it works well now that I tried controlling the IR LED with a transistor and a 9V battery instead of just powering it directly from the 5V of the Arduino which couldn't safely supply the needed current anyway.

Well hold on there, the Arduino IO *pin* might not be able to supply the current, but what is providing the 5V to the system? Are you saying that can't supply about a 100mA more? You could clean up the whole thing by just using the available 5V supply rail.

You're right, it doesn't matter how much current the IO pin can safely supply anymore because it's just connected to the base of the transistor. I don't know why I didn't think of that. An UNOs 5V rail can safely supply 200mA according to http://playground.arduino.cc/Main/ArduinoPinCurrentLimitations (http://playground.arduino.cc/Main/ArduinoPinCurrentLimitations)
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 22, 2015, 04:00:16 pm
I've done some testing and a 12ohm resistor works well when powering the IR LED from the +5V rail of the Arduino.
The TV picks up the signal just fine without having to point the emitter perfectly in the right direction.

I would have never dared to use a 12ohm resistor on an LED before reading some of your answers but I guess IR LEDs pulsed very quickly are quite different than just constantly lighting regular LEDs.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: Alex Eisenhut on February 22, 2015, 05:12:49 pm
I've done some testing and a 12ohm resistor works well when powering the IR LED from the +5V rail of the Arduino.
The TV picks up the signal just fine without having to point the emitter perfectly in the right direction.

I would have never dared to use a 12ohm resistor on an LED before reading some of your answers but I guess IR LEDs pulsed very quickly are quite different than just constantly lighting regular LEDs.

Well you can't *see* what's going on, you can't tell if it's working, not working, or if you just blew it up. Radio Shack, RIP, used to sell this

(http://techniek.flipperwinkel.nl/wpc/wpcopto2.jpg)

it's magic, you charge it up with visible light from a fluorescent or sunlight, then that pink strip lights up in the presence of IR. I can't find a picture of it glowing.

But now that electronic cameras are everywhere, you just use that. When I bought that strip, the only video camera I had was a B/W Panasonic tube camera hooked up to my Amiga...

I'm old.
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: dentaku on February 22, 2015, 09:55:54 pm
I've done some testing and a 12ohm resistor works well when powering the IR LED from the +5V rail of the Arduino.
The TV picks up the signal just fine without having to point the emitter perfectly in the right direction.

I would have never dared to use a 12ohm resistor on an LED before reading some of your answers but I guess IR LEDs pulsed very quickly are quite different than just constantly lighting regular LEDs.

Well you can't *see* what's going on, you can't tell if it's working, not working, or if you just blew it up. Radio Shack, RIP, used to sell this

(http://techniek.flipperwinkel.nl/wpc/wpcopto2.jpg)

it's magic, you charge it up with visible light from a fluorescent or sunlight, then that pink strip lights up in the presence of IR. I can't find a picture of it glowing.

But now that electronic cameras are everywhere, you just use that. When I bought that strip, the only video camera I had was a B/W Panasonic tube camera hooked up to my Amiga...

I'm old.

I pointed my brother's Samsung Galaxy phone at it and compared it to a Bell remote.

I guess I'm old too because I've had a Vic-20, C-64 and Amiga 500 :)
Title: Re: Why do real IR remotes work so well compared to my experimental device?
Post by: Wim_L on February 22, 2015, 10:24:57 pm
I've done some testing and a 12ohm resistor works well when powering the IR LED from the +5V rail of the Arduino.
The TV picks up the signal just fine without having to point the emitter perfectly in the right direction.

I would have never dared to use a 12ohm resistor on an LED before reading some of your answers but I guess IR LEDs pulsed very quickly are quite different than just constantly lighting regular LEDs.

It's not specific to IR LEDs. Regular visible or UV LEDs can also be used with short high-current pulses.