IR Remote Control Issues


Closed Thread
Results 1 to 21 of 21
  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429

    Default IR Remote Control Issues

    Hi All,

    I'm currently making a PIC controlled Infrared Remote Control so that I can control all the various components of my home entertainment setup from a PIC. So far i've been concentrating on my TV.

    I have attached an image of the circuit i've made.

    The point marked PIC(PWM) is connected to the PICs hardware PWM output, and generates a constant PWM or 48khz at 50% duty cycle.

    The point marked PIC(I/O) is connected to one of the PICs digital I/O pins.

    I use the PIC to turn on and off that I/O pin to output the correct sequence to turn on my TV.

    And it works. However, the range is quite poor. It only works up to 2m away from the TV and only when the IR LED is pointed directly at the TV, whereas my regular TV remote works from anywhere and even if its not pointed anywhere near the TV.

    The IR LED's specs are the following: 1.2V typical (2v max), 20mA typical (50mA max), 14-28 mW/cm2

    Anyone have any ideas on what may be wrong?
    Attached Images Attached Images  
    Last edited by Kamikaze47; - 27th August 2007 at 12:06.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What is the angle of the IR? The wider the angle the less range.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    specs say viewing angle 20 degrees

  4. #4
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default Is it?

    Is it the correct wavelength? 950 nm is popular but so is also eight-hundred something and so on..... less correct -> less sensitive receiver

    Is it the correct frequency? 40? 48? 56? kHz there are plenty to choose from.... pick the wrong one and you loose performance

    Do you provide enough current thru the LED? Even if the LED is specified 50 mA MAX that usually means that it can handle 50 mA constantly. Since you have a 50 % dutycycle and then send bursts out it can take much more. There is a chart in the datasheet that shows max current for different dutycycles. Now you have 30-40? More is better...... many receiver datasheets mention distance when the LED currenct is 100 mA.

    I am happily running my IR led's at 700 mA and that is more than enough to change channel for the whole apartment area.

    Of all these questions the easiest to solve is frequency (if you have a scope). The others are more or less up to trial and error...

    Break open the TV and see if the receiver chip has any markings, then you might get both FQ and wavelength.

    /me

  5. #5
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    These are the specs on my IR LED:

    Code:
    Parameter                   min    typ    max   unit     test conditions
    ---------------------------------------------------------------------------------
    radiant power               14     -      28    mW/cd2   If=20mA
    peak emission wavelength    -      -      940   nm       If=20mA
    spectral line half width    -      -      50    nm       If=20mA
    forward voltage             -      1.2    2.0   V        If=20mA
    reverse current             -      -      100   uA       Vr=5V
    rise time                   -      -      200   nS       PW=10uS DC=10% Ifp=20mA
    fall time                   -      -      500   nS       PW=10uS DC=10% Ifp=20mA
    power dissipation           -      -      150   mW       Vr=5V
    continous forward current   -      -      50    mA       -
    peak forward current        -      -      1     A        PW=10uS DC=10% Ifp=20mA
    reverse voltage             -      -      5     V        -
    viewing angle               -      20     -     deg      -
    operating temp range        -45    +25    +100  degC     -
    storage remp range          -45    +25    +100  degC     -
    lead soldering temp         -      -      +250  degC     5 Sec 1.6mm from base
    
    PW=Pulse Width
    DC=Duty Cycle
    The frequency of 48khz i found by trial and error. It def works best at 48khz.

    How could i get 700mA with this LED? Pref with 5v only?

  6. #6
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    Hi All,

    I'm currently making a PIC controlled Infrared Remote Control so that I can control all the various components of my home entertainment setup from a PIC. So far i've been concentrating on my TV.

    I have attached an image of the circuit i've made.

    The point marked PIC(PWM) is connected to the PICs hardware PWM output, and generates a constant PWM or 48khz at 50% duty cycle.

    The point marked PIC(I/O) is connected to one of the PICs digital I/O pins.

    I use the PIC to turn on and off that I/O pin to output the correct sequence to turn on my TV.

    And it works. However, the range is quite poor. It only works up to 2m away from the TV and only when the IR LED is pointed directly at the TV, whereas my regular TV remote works from anywhere and even if its not pointed anywhere near the TV.

    The IR LED's specs are the following: 1.2V typical (2v max), 20mA typical (50mA max), 14-28 mW/cm2

    Anyone have any ideas on what may be wrong?
    Couple of things.....

    1. The schematic for your LED driver has the IR LED the wrog way round !!

    Assuming your switching transistors have a Vsat of 0.2V each and the IR LED has its lowest possible Vfwd of 1.2V then the resistor will be dropping 3.4v giving a current of 22.6mA.

    2. Even if your TV is using a carrier frequency of 48KHz, its almost certainly wrong for most of your other kit. The three main families of IR codes are

    Philips (RC5, RC6, RCMM) @ 36kHz
    NEC and Vairiants @ about 38kHz
    Sony @ 40kHz

    Generally 38kHz is a good "catch all" frequency as 36 and 40k systems will still have pretty good reception.

    You may find that you need to set your PWM to different values for different devices.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  7. #7
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    I've never heard of a 48kHz carrier. 32-40kHz is common and there are some that use ~56kHz What is the make/model of the TV?

  8. #8
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Ok, I just tried it with a 10 ohm resistor, so 340mA through the LED. It only seems to have made a very small difference to the range, and I still have to point the LED *directly* at the TV for it to work - Even a few degrees make a difference.

    I will try playing with the frequency again.

    Also, do you think 50% duty cycle is the best bet? I wasn't sure what to use, and 50% seemed logical, but now i'm considering a lower duty cycle as that means the LED should theoretically be able to handler a higher peak current.

    *edit* My TV is a Samsung LA40R71BDX

    *edit2* Fixed mistake in schematic (thanks keithdoxey)
    Last edited by Kamikaze47; - 27th August 2007 at 12:07.

  9. #9
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default What protocol do you use?

    http://www.sbprojects.com/knowledge/ir/nec.htm

    Someone said Samsung uses NEC code 38 kHz with a dutycycle around 0.25 to 0.33

    HOW IS YOUR TIMING?

    Increasing IR current that much would have made a difference if that was the true problem.

    Do you have a scope so you can meassure the output of the TV remote control LED? (and if you have a nice digital one you might even post the pic)


    /me

  10. #10
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    I dont have scope unfortunately. So what I did was hook up an IR receiver to a PIC, and had it sample it every 10uS and output it to my PC which I then put into excel and made a graph. The pic attached has the signal from my TV's remote at the top, and the signal from my home made remote below. The scale on the bottom is in 10's of uS.

    As you can see, the timing is pretty close. I would have thought if it was a timing issue, it simply wouldn't work at all instead of bad range?

    I'm going to try 38khz at 25% and see how that goes.
    Attached Images Attached Images  

  11. #11
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Samsung uses 38kHz and sends a 32-bit code similar to the NEC protocol but with a shorter lead-in pulse and with the bits interpreted differently. Samsung uses a 4.5mS start pulse followed by a 4.5mS space. Your example appears to be for the "1" key.
    Last edited by dhouston; - 27th August 2007 at 14:17.

  12. #12
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dhouston View Post
    Samsung uses 38kHz and sends a 32-bit code similar to the NEC protocol but with a shorter lead-in pulse and with the bits interpreted differently. Samsung uses a 4.5mS start pulse followed by a 4.5mS space.
    Sounds exactly like what i've observed. Do you know of a page on the net somewhere that has more detailed info on the protocol they used? I havn't been able to find any info on it.

  13. #13
    Join Date
    Mar 2006
    Location
    China
    Posts
    266


    Did you find this post helpful? Yes | No

    Default What IR receiver did you use?

    When you PIC-scoped the remote what receiver did you use? What is the range and sensitivity using the standard tv remote control and this receiver?

    Then we can get an idea of the FQ used. If you have good distance with the remote then it must be your LED that has a major output power problem. It might be burnt due to over current along the evolution chain.

    Have you tried to move one thansistor to the base of the other, so you do all the mixing on the base.

    Maybe just loose both transistors and sink current with the PIC and make a software mixer by turning on and off HPWM (and connect the led there with a resistor)

    what partnumber is the led?
    what part number is the receiver you have used?

    /me
    Last edited by Jumper; - 27th August 2007 at 15:04.

  14. #14
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    Sounds exactly like what i've observed. Do you know of a page on the net somewhere that has more detailed info on the protocol they used? I havn't been able to find any info on it.
    I don't recall seeing any detailed description. There is a simple description at http://www.techdesign.be/projects/011/011_waves.htm and there are CCF codes on RemoteCentral.com and at http://ir.premisesystems.com/. There are a few detailed descriptions of the NEC protocol. It was the first and was copied with minor changes by many others. Here's a datasheet for an early NEC encoder chip - http://davehouston.net/Nec6121.pdf

    EDIT: BTW, I find it easier to record the codes as .wav files using a soundcard. This way you can use a wave editor to view them. See http://davehouston.net/learn.htm

    OTOH, if you sample with a PIC using a phototransistor, you can get the carrier frequency and eliminate any guesswork.
    Last edited by dhouston; - 27th August 2007 at 15:48.

  15. #15
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Hi,

    This technique should help you get a substantial improvement; instead of gating the LED using HPWM and a data pin, use the data pattern to control the HPWM pin itself (keep the HPWM running all the time, and just turn the HPWM pin to an input wherever you dont want a transmission); Darrel had suggested this during an earlier post pertaining to X10 transmission and it worked like a charm.

    If nothing else, it would at least eliminate the drop across one transistor, and you would save a pin as well. You would also find the waveform far more consistent with the original remote.

    Regards,

    Anand

  16. #16
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Ok, here's what i've done since the description in my original post:

    - Changed the LED's resistor to 10 ohm
    - Removed one transistor, turning on and off PWM to control the LED
    - Changed the frequency to 38kHz
    - Changed the duty cycle to 25%
    - Improved the timing using TMR0 for timing instead of PAUSEUS

    The end result is an improvement, but not spectacular. The range is improved, however I still need to point the LED pretty much directly at the TV for it to work - Whereas i can point my normal TV remote anywhere in the room and it will work (even pointing directly away from the TV).

    Perhaps I need some kind of diffusing material in front of the LED? I'm not sure what to use tho. Or maybe I need to get an LED with a better viweing angle, but i'm not sure that this is the case, unless my tv's remote has a 360 degree viewing angle - lol. I assume that my tvs remote is simply powerful enough to bounce off the walls and eventually find its way to the tv no matter what direction i point it.

  17. #17
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Looking at the schematic again, I dont think you are getting enough drive to the transistors.

    Either change the transistors to PNP types and invert your gating signal or put the transistors where the LED is and the LED where the transistors are so that the transistors are sinking current rather than sourcing it.

    You may also need to reduce the value of the base resistors to get more drive.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  18. #18
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post

    Perhaps I need some kind of diffusing material in front of the LED? I'm not sure what to use tho. Or maybe I need to get an LED with a better viweing angle, but i'm not sure that this is the case, unless my tv's remote has a 360 degree viewing angle - lol. I assume that my tvs remote is simply powerful enough to bounce off the walls and eventually find its way to the tv no matter what direction i point it.
    I dont think any external diffusing material would help. A lot of remotes have the LED body itself sticking out of the remote. You're right about the signal bouncing off objects; IR does tend to reflect well, although the signal strength must be dropping signaificantly after every refelction.

    I suspect now its just a matter of getting the frequency and/or duty cycle right. You could also try 2 LEDs in series, pointing in a slightly divergent manner to give you a wider coverage.

    Regards,

    Anand

  19. #19
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Kamikaze47 View Post
    Ok, I just tried it with a 10 ohm resistor, so 340mA through the LED.

    Just realised; if my math is right, you are *not* getting 340 mA thru' the LED with a 4.7K bias resistor; I would reduce that to 1 K; at the most 2.2 K.

    Regards,

    Anand

  20. #20
    Join Date
    Dec 2005
    Posts
    1,073


    Did you find this post helpful? Yes | No

    Default

    Are you sending single or multiple copies of the IR? Most of the receivers need to see multiple copies to set their AGC and receive threshold so most protocols send more than a single copy.

  21. #21
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Excellent! Working perfectly now

    Switching the transistor and LED around so that the transistor is sinking current, and changing the bias resistor to 1k did the trick (Thanks keithdoxey and ardhuru)

    It now has pretty much the same range and capability as my regular TV remote.

    Thanks very much to all for your help.

    My next step is to get it working with my Receiver. Getting that working should be much smoother now tho. I can actually change the PWM frequency on the fly by writing to the appropriate registers, so even if my other equipment works on different frequencies it shouldn't be a problem.
    Last edited by Kamikaze47; - 28th August 2007 at 19:32.

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. Plz help in completing RC-5 IR remote lamp dimmer project
    By vu2iia in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2008, 08:44
  3. No one-way approach to learning ir remote control frequencies
    By selbstdual in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd June 2007, 13:26
  4. IR Remote Control
    By mychangl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th March 2007, 07:01
  5. Digital Camera Controller
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th October 2005, 01:08

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts