Author Topic: Why do real IR remotes work so well compared to my experimental device?  (Read 11896 times)

0 Members and 1 Guest are viewing this topic.

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
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);
  }
}
« Last Edit: February 21, 2015, 05:48:58 pm by dentaku »
 

Offline Mechanical Menace

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: gb
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #1 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.
Second sexiest ugly bloke on the forum.
"Don't believe every quote you read on the internet, because I totally didn't say that."
~Albert Einstein
 

Offline Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3491
  • Country: ca
  • Place text here.
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #2 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.
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #3 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

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
 

Online mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13995
  • Country: gb
    • Mike's Electric Stuff
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #4 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
 
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #5 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.
 

Offline electr_peter

  • Supporter
  • ****
  • Posts: 1419
  • Country: lt
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #6 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?
 

Online tom66

  • Super Contributor
  • ***
  • Posts: 7043
  • Country: gb
  • Electronics Hobbyist & FPGA/Embedded Systems EE
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #7 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.
 

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #8 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.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8550
  • Country: us
    • SiliconValleyGarage
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #9 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
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline dentakuTopic starter

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: ca
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #10 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.
 

Offline Alex Eisenhut

  • Super Contributor
  • ***
  • Posts: 3491
  • Country: ca
  • Place text here.
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #11 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.
Hoarder of 8-bit Commodore relics and 1960s Tektronix 500-series stuff. Unconventional interior decorator.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10233
  • Country: nz
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #12 on: February 22, 2015, 05:29:03 am »
N channel mosfet will be in order
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7549
  • Country: 00
  • +++ ATH1
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #13 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.

Offline coppice

  • Super Contributor
  • ***
  • Posts: 9521
  • Country: gb
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #14 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.
 

Online hexreader

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: england
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #15 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.


« Last Edit: February 22, 2015, 07:19:40 am by hexreader »
 

Offline DavidDLC

  • Frequent Contributor
  • **
  • Posts: 755
  • Country: us
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #16 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.
 

Online hexreader

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: england
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #17 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.
 

Offline DavidDLC

  • Frequent Contributor
  • **
  • Posts: 755
  • Country: us
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #18 on: February 22, 2015, 08:12:42 am »
Great, I didn't check the code.

David.
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 9521
  • Country: gb
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #19 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.
 

Online hexreader

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: england
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #20 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 :)
« Last Edit: February 22, 2015, 08:52:05 am by hexreader »
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #21 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.
 

Online hexreader

  • Frequent Contributor
  • **
  • Posts: 269
  • Country: england
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #22 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:
 

Online PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5213
  • Country: nl
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #23 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?  :-//
Keyboard error: Press F1 to continue.
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: Why do real IR remotes work so well compared to my experimental device?
« Reply #24 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/

I especially liked the Banana experiment.  >:D
my random ramblings mind-dump.net
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf