Author Topic: How do these IR receivers work internally ?  (Read 1321 times)

0 Members and 1 Guest are viewing this topic.

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1512
  • Country: ca
How do these IR receivers work internally ?
« on: May 27, 2024, 01:00:44 am »
I'm making a remote control, for a stereo that has a motorized volume control (but never had a remote it seems).

And I'm trying some TSOP-1156 IR receiver modules, and I see that you have to have special timings to do anything. So I'll have to try it with an MCU. And I see the block diagram, but how do they do all that, and make it any good ?? Is it all digital circuits and timer's, and is there some really special purpose MCU in there ??

I'm also playing around in LTSpice with making an RF remote, with BJT's, and Colpitts oscilators, for 2 different frequencies for volume up/down. And just with the basic circuits I'm trying, I'll probably want quite a frequency separation, like 3MHz and 30Mhz, just to get 2 nicely separated voltage levels.
 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1515
  • Country: ca
Re: How do these IR receivers work internally ?
« Reply #1 on: May 27, 2024, 05:23:00 am »
Look into the RECS-80 protocol mentioned in the datasheet or others. It explains how this is typically done with IR remotes.
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1910
  • Country: au
Re: How do these IR receivers work internally ?
« Reply #2 on: May 27, 2024, 05:50:38 am »
I'm making a remote control, for a stereo that has a motorized volume control (but never had a remote it seems).

And I'm trying some TSOP-1156 IR receiver modules, and I see that you have to have special timings to do anything. So I'll have to try it with an MCU. And I see the block diagram, but how do they do all that, and make it any good ?? Is it all digital circuits and timer's, and is there some really special purpose MCU in there ??


It looks to be straight analog, just amplitude modulation/on/off keying of a carrier frequency.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: How do these IR receivers work internally ?
« Reply #3 on: May 27, 2024, 06:56:33 am »
I have played with these in the past. Be aware that they are designed for a certain carrier frequency (38 Khz?) so you have to stick to that. The receiver demodulates the signal from the carrier so you have a clean signal at the output.

If all you need is two codes, up/down, then it should be extremely easy to do with just a little hardware, no need for MCU. I can think of several simple ways. By signal duty cycle, by signal frequency, etc. If you want something more complex then an MCU is the way to go. In that case you could use a remote sender from any other device. Note that the codes they send are complex. My TV remote sends 27 bits.

I have a crate full of old remote controls and of devices with receivers waiting for projects to use them in. :)

As an

All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: How do these IR receivers work internally ?
« Reply #4 on: May 27, 2024, 11:45:34 am »
Another thought to make it as simple as possible is to have a single signal, only on/off, and the receiver toggles each time up / down / up / down. You can have LEDs of different colors to show if it is going up or down. If you send and the receiver is going in the opposite direction to what you want you just stop and push again.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1512
  • Country: ca
Re: How do these IR receivers work internally ?
« Reply #5 on: May 27, 2024, 03:18:17 pm »
Yeah I downloaded the RECS-80, I should try something without a MCU for now, like maybe some 555 timer circuits and binary counter/logic circuits.

But for now I'm going to try a 2MHz and 10MHz RF signal, and see if I can get 1V and 4V from 1 detector diode circuit like in the sim. I could try adding amplitude modulation and just use 1 osc. frequency too.



It looks to be straight analog, just amplitude modulation/on/off keying of a carrier frequency.
So what analog circuits would reliably count 6 cycles of the carrier ? I'm guessing they have their own internal clock source, are their logic gates tho, and then maybe they compare and count what comes in vs it's clock? Or do they use integrator's and some logic for that too ?
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 3624
  • Country: us
Re: How do these IR receivers work internally ?
« Reply #6 on: May 27, 2024, 03:42:18 pm »
Easily done with a pair of 555's or a 556.  One section for the carrier  (56 kHz in your case?) and one for the on/off modulation.  The pass band for the carrier is typically quite wide.
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1910
  • Country: au
Re: How do these IR receivers work internally ?
« Reply #7 on: May 27, 2024, 07:08:54 pm »



It looks to be straight analog, just amplitude modulation/on/off keying of a carrier frequency.
So what analog circuits would reliably count 6 cycles of the carrier ? I'm guessing they have their own internal clock source, are their logic gates tho, and then maybe they compare and count what comes in vs it's clock? Or do they use integrator's and some logic for that too ?

The AGC needs time to respond, just RC of some sort, and for the logic level to settle, just a delay, and the 6 cycles is just the worst case response time.
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: How do these IR receivers work internally ?
« Reply #8 on: May 27, 2024, 09:52:40 pm »
Yeah I downloaded the RECS-80, I should try something without a MCU for now, like maybe some 555 timer circuits and binary counter/logic circuits.

But for now I'm going to try a 2MHz and 10MHz RF signal, and see if I can get 1V and 4V from 1 detector diode circuit like in the sim. I could try adding amplitude modulation and just use 1 osc. frequency too.


It looks to be straight analog, just amplitude modulation/on/off keying of a carrier frequency.
So what analog circuits would reliably count 6 cycles of the carrier ? I'm guessing they have their own internal clock source, are their logic gates tho, and then maybe they compare and count what comes in vs it's clock? Or do they use integrator's and some logic for that too ?

Either I am misunderstanding you or .... I thought we were talking IR sender and IR receiver?

An IR receiver is tuned to a certain carrier frequency, normally in the 38KHz vicinity and they will demodulate signals from the remote control sender which are in the range of 110 bits per second.

If you just want to use radio you can save a lot of time and effort by just buying a commercial module and sender which you can get for very little.

https://www.amazon.com/fushionsea-Universal-Wireless-Receiver-Transmitter/dp/B08BNJDFSM/ref=sr_1_5

All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1646
  • Country: gb
Re: How do these IR receivers work internally ?
« Reply #9 on: May 27, 2024, 10:00:12 pm »
I'm not sure hat the confusion is here - those TSOP IR reciever modules are purely analog, but have restrictions on timing based on the time constants used in the AGC and to a lesser extent, filters.  They're justy photo diodes with transimpedance amplifiers, filters, and an AGC.

The actual protocol, and the data sent is all done on an ASIC or MCU - the common ones are NEC and Sony's RC-5 but you could roll your own.  The downside of doing that is you're effectively doing your own bit coding, where-as the standards have libraries that'll work on any micro with a half decent timer module.

The trouble with doing things with "dumb" circuits like the 555 is lack of versatility.  Sure you could make one button with a fixed on/off rate, modulating the 36-40kHz IR carrier so the reciever can demodulate it, and the reciever just looks for a pulse train of a fixed frequency, but.. what happens when you want two buttons? or three?  You end up with quite a large circuit woth lots of timers and logic, where-as a 6/8 pin MCU will allow for several buttons.  And these IR modules are designed to work with the above standards, thus the min/max pulse widths (and also why the NEC protocol packet starts with a fixed mark space pattern).
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: How do these IR receivers work internally ?
« Reply #10 on: May 27, 2024, 10:33:01 pm »
I'm not sure hat the confusion is here - those TSOP IR reciever modules are purely analog, but have restrictions on timing based on the time constants used in the AGC and to a lesser extent, filters.  They're justy photo diodes with transimpedance amplifiers, filters, and an AGC.

The actual protocol, and the data sent is all done on an ASIC or MCU - the common ones are NEC and Sony's RC-5 but you could roll your own.  The downside of doing that is you're effectively doing your own bit coding, where-as the standards have libraries that'll work on any micro with a half decent timer module.

The trouble with doing things with "dumb" circuits like the 555 is lack of versatility.  Sure you could make one button with a fixed on/off rate, modulating the 36-40kHz IR carrier so the reciever can demodulate it, and the reciever just looks for a pulse train of a fixed frequency, but.. what happens when you want two buttons? or three?  You end up with quite a large circuit woth lots of timers and logic, where-as a 6/8 pin MCU will allow for several buttons.  And these IR modules are designed to work with the above standards, thus the min/max pulse widths (and also why the NEC protocol packet starts with a fixed mark space pattern).

The confusion is that the OP is now talking MHz and the IR modules work at 38 KHz so I assume he's talking about radio and about IR simultaneously.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14907
  • Country: fr
Re: How do these IR receivers work internally ?
« Reply #11 on: May 27, 2024, 10:36:43 pm »
If the OP's idea is to use a carrier of a few MHz with an IR LED/photodiode pair, then for sure they'll have to forget about these standard remote receivers which are indeed made for a 38kHz carrier. Transmitting a signal with a few MHz of bandwidth over IR is going to be pretty challenging. Not a weekend project using ready-made modules.
 
The following users thanked this post: RJSV

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 258
Re: How do these IR receivers work internally ?
« Reply #12 on: May 28, 2024, 12:45:38 am »
I gave it a shot with a Pi Pico a while back. The source code has a C and MicroPython example:

C example: Prints on the USB serial console the received button value. Requires Pi Pico C/C++ SDK to build the code.
MicroPython example: Operates a servo using the left/right buttons. It is in a single file (main.py) that is installed in the normal method for MicroPython.

It uses Sony SIRC 20-bit protocol, there are small remote controls (for instance camera remotes, either Sony brand or lower-cost clones) or normal TV/DVD remotes etc if they use Sony SIRC. The code is not heavily battle-tested so I can't guarantee it will work with all such remotes.

The IR sensor connects to GPIO15.

If OP doesn't mind using a microcontroller, then I've quickly modified the MicroPython code to approximately do what he wishes. It controls two LEDs, depending on what button is pressed. The code is crude, just proof-of-concept.
I've noticed that Sony TV remotes allow buttons to be held down indefinitely, whereas the camera remotes seem to require pressing the button repeatedly.

I don't know what microcontroller experience the OP has, but maybe it's a good opportunity to try the Pico if it's not been used before, because the steps to use MicroPython are written for newcomers on the raspberrypi website and needs no compiler (or use C if preferred, but that will require the Pi Pico C/C++ SDK to be installed).


 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: How do these IR receivers work internally ?
« Reply #13 on: May 28, 2024, 07:08:39 am »
I've noticed that Sony TV remotes allow buttons to be held down indefinitely, whereas the camera remotes seem to require pressing the button repeatedly. 
It is very common for remote control senders to toggle a bit or two each time you press a key. That way the receiver knows if you are holding the same key continuously or if you let go and pressed again. In my example above it was bits 4 and 5 IIRC.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 

Offline jpanhalt

  • Super Contributor
  • ***
  • Posts: 3624
  • Country: us
Re: How do these IR receivers work internally ?
« Reply #14 on: May 28, 2024, 08:34:39 am »
Small detail:  The TSOP1156 is center tuned to 56 kHz, not 38 kHz.  Typically, the last two digits of the TSOP part number are the frequency in kHz.
 

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 258
Re: How do these IR receivers work internally ?
« Reply #15 on: May 28, 2024, 01:34:21 pm »
It is very common for remote control senders to toggle a bit or two each time you press a key. That way the receiver knows if you are holding the same key continuously or if you let go and pressed again.

You're correct, the code does detect that.

I mean that some Sony SIRC remotes (or maybe some buttons not all on some SIRC remotes) do not appear to send the 'repeat' code forever (whereas with a TV SIRC remote volume buttons, it's a long indefinite stream of 'repeat' codes as expected). I didn't observe in any detail so perhaps I'm wrong, but just wanted to mention it as a possible thing to watch out for if it affects the use-case (e.g. holding down a button while the motor continuously advances the potentiometer, versus repeatedly pressing the button to advance in increments).
 

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: How do these IR receivers work internally ?
« Reply #16 on: May 28, 2024, 04:02:46 pm »
With the info we have so far I would say:

If you just want to solve the problem in the simplest, cheapest and most practical way then get a wireless thingy from eBay or wherever. Simple, fast, cheap.

If you want to tinker with IR in the very simplest way you can get some old device and use that. It would be extremely simple to send a modulated 38 KHz carrier modulated with two different duty cycles, say 25 and 75 %. That would be very easy to detect with simple hardware and activate one of the two outputs. I would say this is very simple, almost trivial.

The most complex way is to use MCU and you can use as many different codes as you like.
All my posts are made with 100% recycled electrons and bare traces of grey matter.
 
The following users thanked this post: MathWizard

Offline tooki

  • Super Contributor
  • ***
  • Posts: 12040
  • Country: ch
Re: How do these IR receivers work internally ?
« Reply #17 on: May 28, 2024, 06:10:46 pm »
I'm making a remote control, for a stereo that has a motorized volume control (but never had a remote it seems).
What stereo? Maybe it has an unpopulated IR receiver footprint which you can simply install the correct receiver into. Then use a universal remote with it, or build a tiny one using an Arduino Pro or Nano, or even something smaller like one of the Beetle series of boards.

And I'm trying some TSOP-1156 IR receiver modules, and I see that you have to have special timings to do anything. So I'll have to try it with an MCU. …
That’s a very old part. I’d recommend using a modern part, since newer ones have been designed to reject interference from Wi-Fi, Bluetooth, and PWM-dimmed LED lighting, giving more reliable results. Note that Vishay has a dizzying array of receiver modules, each optimized for different situations (environments) and IR codes. (Yes, they optimize the filtering for the actual code formats.) But they also have excellent documentation to help you choose. They have a number of white papers and overviews as well as info on the mechanical aspects (e.g. IR window design).

I'm also playing around in LTSpice with making an RF remote, with BJT's, and Colpitts oscilators, for 2 different frequencies for volume up/down. And just with the basic circuits I'm trying, I'll probably want quite a frequency separation, like 3MHz and 30Mhz, just to get 2 nicely separated voltage levels.
Isn't this risky, in terms of regulatory compliance?

Also, what’s to stop spurious signals within your detector bandwidths from triggering unwanted commands? There’s a reason remote controls (both IR and RF) use both carrier frequencies and digital codes with redundancy and/or checksums, and won’t act on a code until it’s been repeated a few times.
 

Offline MathWizardTopic starter

  • Super Contributor
  • ***
  • Posts: 1512
  • Country: ca
Re: How do these IR receivers work internally ?
« Reply #18 on: May 29, 2024, 06:56:11 pm »
Ok so inside the TSOP11xx device, is just analog circuits, no MCU. Yeah I would just like to see the internal circuit, thats all. So it does have clocks and counters though right, and not just some passive or active filter trying to tell if 6 or 7 pulses came in right? But then again, maybe with good parts on a chip, it's not as hard I think.

I have some in my junk box, so I'll use one for making an IR remote control receiver.

I think this stereo is a 1980's Sansui R-7, I mapped the whole circuit, there's just the up/down push button volume control, controlling an H-bridge for the motor/volume pots.

For fun, I'm trying to make a suitable IR TX, using a 555 clock signal, 3x 7-bit binary counters, some S-R latches made from BJT's. I almost have it working in LTSpice. For lower part count I should try mainly with 555 timers.


Yes for fun I am also trying to make an RF remote RX/TX. For just up/down volume, I shouldn't waste an MCU on the stereo.
« Last Edit: May 29, 2024, 07:01:37 pm by MathWizard »
 

Offline shabaz

  • Frequent Contributor
  • **
  • Posts: 258
Re: How do these IR receivers work internally ?
« Reply #19 on: May 29, 2024, 08:08:14 pm »
So it does have clocks and counters though right, and not just some passive or active filter

The internal circuit can be assumed to be an AC-coupled light amplifier, followed by a diode and capacitor performing demodulation like a simple AM receiver, and an output transistor with on-off output. There is a filtering action, so that extremely short bursts will not be output, but even if some slightly longer bursts make it through, the external circuitry (e.g. logic, microcontroller) can usually clean further since in a system, usually a protocol like RC-5, SIRC, etc is used.

There's more to it in terms of sophistication, as can be seen in the datasheet block diagram, but in a nutshell, even a black-box assumption is sufficient to work with it, namely, that it simply removes the carrier frequency from the infra-red signal, and isn't so fast-responding that it will output the shortest of bursts . No other logic, state-machine or otherwise, is inside there.

The easiest way to see what is going on, is simply apply power to it, and look at the output using an LED (connect the LED cathode to the output, and the anode to +ve), if not a 'scope. You may rarely see the occasional flicker on the LED, that's some ambient burst of flickering light level (or, possibly more likely, some electrical noise very close by) making it's way through the AC-coupled amplifier, but you won't see the LED turn on much unless a real burst is sent (from a remote control, or a 555 attached to an LED, etc).

In a normal home environment, you probably won't see the LED visually flicker at all, the output is very clean. You'll only see the LED turn on in a sustained way when using the 555+LED or normal remote control.
 
The following users thanked this post: MathWizard

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1646
  • Country: gb
Re: How do these IR receivers work internally ?
« Reply #20 on: May 30, 2024, 01:43:40 am »
.. So it does have clocks and counters though right, and not just some passive or active filter trying to tell if 6 or 7 pulses came in right?

No, no counters, as has been stated a couple of times - the number of pulses it needs to stabilise are somewhat irrelevant - there are no counters, no logic, all it does is pass a demodulated carrier - in your case 56kHz.  Because of the AGC it requires a certain period of carrier to train the AGC, if that periods happens to be 6-7 cycles of the 56kHz carrier then so be it - its for how long the carrier is present, not how many pulses/clocks/cycles it counts. The whole part is purely analogue, and digital decoding is done elsewhere.

For a two channel IR remote transmitter you would need to generate the carrier - 56kHz for that module - and modulate it (logical AND in your case) with a bit stream, or at least two different signals that your reciever circuit can differentiate between.  For just two channels could be an interesting exercise - perhaps some kind of low frequency tone decoder?  But if you're just making this for convenience, throw a micro at it.

 
The following users thanked this post: MathWizard

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14487
  • Country: de
Re: How do these IR receivers work internally ?
« Reply #21 on: May 30, 2024, 09:33:57 am »
The simple of the receivers have no counters, just analog filtering and AGC. The 6 cycles for the min pulse length are just limits for the performance of the analog circuit, e.g. reflecting RC time constants or similar. The numbers are also no strict limit, more the limits when the performce gets worse and different chips may be different in the details ( some can handle longer pulses a little better than others).

The details of the protocol are decoded in a separate chip / µC. The part would likely be the one to build, typical with a µC.

For the sender side, one probably has some old remote around anyway that one could reuse. The sender than may determine what code to use.
 
The following users thanked this post: MathWizard

Offline soldar

  • Super Contributor
  • ***
  • Posts: 3505
  • Country: es
Re: How do these IR receivers work internally ?
« Reply #22 on: May 30, 2024, 10:27:20 am »
Ok so inside the TSOP11xx device, is just analog circuits, no MCU. Yeah I would just like to see the internal circuit, thats all. So it does have clocks and counters though right, and not just some passive or active filter trying to tell if 6 or 7 pulses came in right? But then again, maybe with good parts on a chip, it's not as hard I think.

The block diagram is posted in the OP by you.

All my posts are made with 100% recycled electrons and bare traces of grey matter.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf