IR demodulator circuit

Everything related to protocols and IR codes
Post Reply
david656
Posts: 9
Joined: Sat Jul 31, 2021 9:03 am

IR demodulator circuit

Post by david656 »

Hi All,

Short question: Simplistically, I want to demodulate (I think) an IR signal.

Longer question:

Say for example I use a TSOP38238, connected to an arduino, connected to the PC and fire up AnalysIR. I can push the down key on a remote pointed at it and on AnalysIR see the hex code 0008A857 - which is correct for the device.

If I then move over to my Bang and Olufsen TV, setup the STB-C on the TV to be the device (Humax Foxsat-HDR), and then plug a STB/PUC IR blaster into the TV, and place that infront of the TSOP, press down. I now see hex code 0008A857 again - which is very good!

Moving on from that, say I don't want IR LEDs and TSOPs all over the place, say I just want to run a cable from the output of the TV to the arduino. Looking on a scope I can see this signal looks nothing like the former, I assume this is due to it being modulated. So the question is, how do I demodulate that IR signal that should be going to an LED and simply read it on the Arduino?

I wasn't sure of where to ask, so hopefully you guys have come across this? Thanks,

User avatar
AnalysIR
Site Admin
Posts: 703
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR demodulator circuit

Post by AnalysIR »

I would need to see the hardware circuit first to be 100% of how to make a connection to the arduino.

But lets assume you are getting a 5V modulated output on your TV.

Just write a sketch to capture all the pulses (ignoring any pulses less than say 200uS.....the longest modulated pulse will be <50uSecs).

That will give you the raw pulse timings to store in a buffer.

Any gap of circa 100mSecs should indicate the end of the signal.

This post on our blog provides a similar sketch, which you could leverage. Poor maker’s Infrared receiver #2

You would then have to decode the IR protocol to get the HEX value. (You can see some code examples of this decoding in the IRremote or IRLib2 libraries on GitHub.)

Note: IR receiver output is inverted logic (High is idle). Your direct TV tap may not be.

david656
Posts: 9
Joined: Sat Jul 31, 2021 9:03 am

Re: IR demodulator circuit

Post by david656 »

Hi, Thanks for the reply.

I'm quite new to IR and trying to understand it, I'd also not used a scope before 2 days ago! I've posted a picture below of what the signal seems to look like. hopefully it's useful?

Image

If i reuse the sketch on that blog post would that get me out the raw pulse timings? or would I get the same effect if i fed this signal into the arduino/the AnalysIR software?

When you say I would have to decode the IR protocol to get the Hex value, can you give more information on how i'd do that please. I had a look at the IRremote library and it was interest, but i couldn't quite see what you were referring to.

Thanks again,

User avatar
AnalysIR
Site Admin
Posts: 703
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR demodulator circuit

Post by AnalysIR »

Maybe study this site

Code: Select all

https://www.sbprojects.net/knowledge/ir/index.php
Also look at all of the Ir protocols via the menu on the page.

After that you may have a better understanding.

User avatar
AnalysIR
Site Admin
Posts: 703
Joined: Sat Aug 31, 2013 3:51 pm
Location: Dublin, Ireland
Contact:

Re: IR demodulator circuit

Post by AnalysIR »

Also, if you change the timebase on your scope to 1mSec or less you nay see greater detail.

As it is it looks like 3V3 non-inverted logic....So set your scope trigger to 2 Volts (instead of 440mV)

Post Reply