Let me preface that I am very much an electronics noob. I am decent with programming.

I have an RCA L40FHD41 HDTV that I bought in 2010. I have tried using many universal remote with this TV, but after trying hundreds of codes, nothing works. I bought a cheap replacement remote (RCA 276045 TV Remote Control) but it is hit and miss when it decides to actually work. I was hoping I could use an Arduino with an IR receiver to get all the IR codes for the remote when it is behaving, then try to make an Arduino IR transmitter to control the TV.

I had a piece of code that would basically take a raw IR input, and output it via an IR LED. To test, I pointed the IR LED at my PCs media remote receiver, and pressed some buttons on the PC media remote. That worked. But when I pointed the IR LED at the TV, and hit buttons on the TV remote, nothing happened. I think that the TV uses a difference modulation. I have read that most standard IR uses 38Khz. I want to find out what modulation the TV remote uses. Is there anyway to get that info using an Arduino and a IR receiver?

Edit: Someone said it might be a decode issue. That cannot be the case, cause I used another piece of example code to get the timings and HEX codes for all the buttons, and when I pressed the same button multiple times, it got the same results, consistently. Here is an example of the output of that piece of sample code: POWER BUTTON

Code : 6A68351E (32 bits)


 +4050, -3400     + 800, -1650     + 800, -1600     + 850, -1600
 + 800, -1600     + 800, - 650     + 800, - 650     + 850, -1600
 + 800, - 650     + 800, -1650     + 750, - 700     + 750, -1650
 + 750, - 750     + 700, - 750     + 750, - 700     + 750, - 700
 + 750, - 750     + 700, -1700     + 700, -1700     + 700, - 750
 + 700, -1750     + 650, - 800     + 600, -1850     + 600, - 850
 + 600, -1800     + 600

unsigned int rawData[51] = {4050,3400, 800,1650, 800,1600, 850,1600, 800,1600, 800,650, 800,650, 850,1600, 800,650, 800,1650, 750,700, 750,1650, 750,750, 700,750, 750,700, 750,700, 750,750, 700,1700, 700,1700, 700,750, 700,1750, 650,800, 600,1850, 600,850, 600,1800, 600};

EDIT: I got a piece of code working to turn the TV on/off. Not sure what is different between the code that simply took a raw input and broadcast it.

  • 1
    \$\begingroup\$ If it is hit and miss when it works then you may have other interference, likewise with the universal remotes. It is a commercial product it is not going to be so sensitive that it hardly works. Looking at the modulated frequency isnt going to help. Using a demodulated receiver to pull out the lower speed signal is good enough, then if you can re-create it (maybe/maybe not with an arduino) you can try the various common frequencies with various frequency IR LEDs... \$\endgroup\$
    – old_timer
    Jul 5, 2017 at 10:19
  • 1
    \$\begingroup\$ you are not going to be able to "see" the modulated IR with an arduino, I dont think you can poll/receive fast enough. You can do an experiment though, make a tight loop that does a sample of a pin, saves it in ram, repeat, run that loop a million times and time it, can you get to 80Khz or faster? maybe try a raspberry pi or something...that might not work either... \$\endgroup\$
    – old_timer
    Jul 5, 2017 at 10:24
  • 1
    \$\begingroup\$ note it is very very hard to generate a proper modulated signal from a microcontroller, slightly off or not a perfect square wave going into the led, and it will be worse than your replacement remote. and thats just the modulated clock, the timing of the underlying signal being modulated is also going to affect how far/close you have to be from the tv for it to work, there will be a sweet spot and the rest of the distances wont work. using a common demodulated IR receiver to decode might leave you with the wrong timing (go with the standard timing not what you see). \$\endgroup\$
    – old_timer
    Jul 5, 2017 at 10:27
  • 1
    \$\begingroup\$ www.sbprojects.com/knowledge/ir/index.php if they were all 38Khz then why such a (frequency) range of ir receivers and transmit leds? I would expect one vendor to use the same frequency if they are using the same codes, perhaps forever use the same frequency and encoding scheme (although I have/had an RCA that was pretty much the first IR television on the market, and it didnt conform to any of the modern/known standard protocols, but that is not surprising since there wasnt a market for IR yet). \$\endgroup\$
    – old_timer
    Jul 5, 2017 at 10:33
  • 1
    \$\begingroup\$ Check out EEVBlog video where Dave does exactly this: captures the IR packet and reproduces it on Arduino youtube.com/watch?v=BUvFGTxZBG8 \$\endgroup\$ Jul 5, 2017 at 12:21

1 Answer 1


You can't do it with a common IR receiver like TSOP4840 or CHQ0038 because those already have a demodulator built in (see the block diagram in the datasheet).

You need an AC coupled sensor like the TSMP58000.

The IRLib2 Arduino infrared library has an example sketch that determines the modulation frequency. The procedure is described in more detail in the manual.

By the way, in my opinion it's more likely that you have some timing, decoding or range problem than that the TV uses something other than 38 kHz. Do you have an oscilloscope/logic analyzer and a second IR receiver?

  • \$\begingroup\$ No, I do not have an oscilloscope, I am a noob tinkerer. I know it wasn't the range. I was holding the IR LED like 1 foot from the TV's IR receiver. I know it wasn't a decoding issue, because I used another piece of example code to get all the IR codes. When I pressed the same button repeatedly on the TV remote, I got a consistent signal decode every time. As to timing, I cannot say. \$\endgroup\$
    – YoItsTrev
    Jul 5, 2017 at 4:05
  • \$\begingroup\$ Do you have the necessary hardware to record what your IR LED is sending, so you can compare that to what the TV remote is sending? \$\endgroup\$
    – AndreKR
    Jul 5, 2017 at 6:13
  • \$\begingroup\$ @YoItsTrev - You said: "I know it wasn't a decoding issue [...] I pressed the same button repeatedly on the TV remote, I got a consistent signal decode every time." I can see why you think you have eliminated incorrect decoding, but FYI it's not necessarily true. The decoding by the Arduino is limited by whatever is received from the IR receiver. You can get a consistent decoding which is wrong e.g. if the s/w on the Arduino is being "misled" by its input. This is part of what old_timer is saying in his comments on your question. Therefore I suggest you still consider that possibility. \$\endgroup\$
    – SamGibson
    Jul 5, 2017 at 10:52

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.