Shop OBEX P1 Docs P2 Docs Learn Events
Those little IR receivers — Parallax Forums

Those little IR receivers

LoopyBytelooseLoopyByteloose Posts: 12,537
edited 2012-08-27 19:47 in General Discussion
I've been trying to get a universal remote to operate with Sony 12 bit code and a 37.9Khz IR receiver.

So far I am sinking in PDFs. And I must say it might be far easier to buy Parallax's proven IR remote with the right component.

The thing is that not all these tiny IR receivers do the same job. I had one labled N3 and the PDF for that claims that if it receives a pulse over 1.2ms long, it blocks reception for 4 times that. Needless to say that will never work with the Sony 12 bit code that starts with a 2.4 long pulse. Whatever follows is ignored. (Actually, Vishay mentions in the same document that the N3 is best suited for the Sony 12 bit, so I am quite confused)

So I went into what I happened to be able to buy locally.

I ended up with 4 different devices that all that the Pin 1 for Vout, Pin 2 for Ground, and Pin 3 for V+ and all will operate at 5 volts.

But the documentation is quite different.

A. PIC-26043SM Seems to only want pulses between 400uS and 800uS - no good for Sony, have tested.
B. PIC-37043TM2 Documentation is a bit vague about limits on pulse width, will have to test
C. FM-6038LM-5CN Claims to work with all three Sony formats, but less happy with Sony 12bit
D. FM-8038lm-5DN Claims only to work with Sony 12bit format, and not at its best.

I also have a Vishay PDF about that N3 device and it seems that the N1, or N7 marked ones will work with Sony, but not the N3. (correction, the Vishay document claims the N3 is best for Sony 12bit).

There are an awful lot of different IR receivers out there and that seem to buffer the incoming signal with a variety of schemes that ignore various remotes. To make matters more difficult, all of these that I have on hand look the same once removed from their little packages that indicate which is which - no marking in most cases.

This has been an old project that I got stuck on because I obviously didn't dig deep enough for the right info. The 'myth' is that all these IR receivers can work if they are close to the right modulated frequency. It just ain't so. They have logic inside that is doing some rather mysterious things. If you don't believe me, you can read my growing library of PDFs for them.

Comments

  • localrogerlocalroger Posts: 3,451
    edited 2012-08-09 09:43
    Odd. I've used half a dozen or so randomly acquired receivers removed from dead or repurposed equipment with a variety of remotes, including a WebTV full keyboard, and never had a problem with any combination.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-08-09 09:55
    This comes up from time to time, and in fact there was a thread just a few days ago regarding Vishay modules that were proven to work with SIRC. There are many modules out there, each defined for a particular type of application -- as I noted there were some cheaper Vishay versions that don't work under 4.5v. The Vishay docs are pretty clear which ones will not work with Sony codes. The issue here, as I understand it, is that the Sony format introduces more chance for error under "noisy" conditions, so there are versions of the module made from the start to reject the moist common types of noise. I've had good results with the TSOP4838, which you can get here in the states for something like 80 cents each in single quantities.

    -- Gordon
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-09 10:06
    First off, SIRC is IRDA, not IR Remote. The data rates are much higher and the engineering is quite different.

    I have been trying to implement Parallax's code for a BS2 and cannot seem to get a good solution. I now see that one PDF does recommend a 10K pullup resistor to the data line. I have already added .1uf and 10uf filtering of the power as suggested.

    I mentioned the N3 in the Vishay document was no good, but a re-read actually shows it on a chart to be optimal for Sony 12bit. I guess I am getting a bit bleary eyed and muddle minded by all these PDFs and having not been able to get the remote to produce any reliable results on the BS2 homework board.

    I have been reading at Linux's LIRC site and built a tiny serial port device that should also test these IR receivers. They list quite a few as no good and seem to think it is an issue. I now have 3 devices that should operated with Sony 12bit, so I will continue to try to get something.

    It certainly doesn't help that there are 3 different options for pin allocation. Without keeping my old IR receivers well documented, they are rather useless trash.

    And of course, it could be that universal programmable remote that I have is just no good. If only the instructions were not in Chinese.
  • ercoerco Posts: 20,256
    edited 2012-08-09 10:29
    XLNT point, Loopy. I have a huge variety of these things and they are not necessarily interchangeable. Besides being optimized for noise, sunlight different frequencies and protocols, a few can receive a continuous unmodulated 38 kHz signal (the old tin cube modules were good at that).

    I just went to Radio Shack last night to buy two new, standard modules so I knew "exactly" what I had. Naturally they only had two, and they were wildly dissimilar, although in identical blister packages with the same part number. :(

    Apparently the "Shack" still sells whatever they get their hands on, not exactly mil spec stuff. Seconds, overruns, whatever.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-08-09 11:51
    First off, SIRC is IRDA, not IR Remote.

    12-bit SIRC is what you're looking for -- seems logical as SIRC stands for Sony Infrared Remote Control. Don't know where you got the idea it's related to IrDA. There are tons of Web pages that describe the protocols, in the various bit lengths.

    I'm not sure of the usefulness of testing old receivers from the junk bin, as new ones cost less than a soda at McDonald's. The newer ones have better performance, though you do have to tailor their use. As nearly all remotes mimic other protocols, if a receiver isn't well suited for one, just try another code setting on the remote. Maybe there are BS2 examples of decoding RC5 or something?

    -- Gordon
  • ercoerco Posts: 20,256
    edited 2012-08-09 14:05
    I'm not sure of the usefulness of testing old receivers from the junk bin, as new ones cost less than a soda at McDonald's.-- Gordon

    Hey wait, all McDonald's sodas are a buck now. But Radio Shlock charges $4.19 for an IR receiver! http://www.radioshack.com/product/index.jsp?productId=2049727

    But yes, 99-cents on Ebay: http://www.ebay.com/itm/IR-Receiver-Module-38-kHz-TSOP4838-FREE-SHIPPING-/260837712263?pt=LH_DefaultDomain_0&hash=item3cbb23a187

    Just saw these, different form factor, 10x $5.57: http://www.ebay.com/itm/10-x-Reception-Distance-15-18M-Infrared-IR-Receiver-Modules-PIC-0038N-/180925978382?pt=LH_DefaultDomain_0&hash=item2a2007570e
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2012-08-09 14:21
    I'd trust Mouser:

    http://www.mouser.com/ProductDetail/Vishay-Semiconductors/TSOP4838/?qs=yGXpg7PJZCjhoGceAOFssk1x7usw5mNL

    Seventy-seven cents each for 10, and while you pay shipping, you'll get them faster, and you know they'll be prime.

    -- Gordon
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2012-08-09 17:50
    A little more.. but you can get them with your other Propeller stuff.

    http://propellerpowered.com/shop/?page_id=464

    Jeff
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-10 01:05
    @Gordon
    Sorry, but those abbreviations are confusing. IRDA uses SIR and FIR protocols. The SIR is the standard data rate, FIR is the faster data rate. Your mention of SIRC was close enough to get confused.

    I see from reading on the web that many newbies cannot see the difference between IRDA and IR remote control. This is important.

    @Erco
    This IR receivers are indeed optimized for different codes these days as the PDFs will indicate. There may be a 'universal receiver', but that is not generalized case.

    Radio Shack has a very long tradition of procurment of parts that are not fully documented and that they don't fully understand how to procure in order to satify customer needs. There are no Radio Shack's in Taiwan, so it is not an issue with me. But they still hold on to the attitude of Tandy Leather Company (which bought Radio Shack back when Allied Radio was the best mail order parts house in the USA). The Tandy Leather Company attittude is that they really don't need to keep up with what the industry and hobbyist are doing in order to maintain their retail presence. This has been an error that has come back regardingto haunt them again and again.

    ~~~~~~~
    What is really the problem?
    I re-read the Parallax IR remote presentation again and it seems that there are several software tricks that are required to get the Sony 12bit code to be readable in the BS2 due to its slower speed. Mainly, the code just reads 7 bits and not the full 12bit (which I was trying to get with modified code). Even using the VCR codes does NOT bother to detect the last 5 bits as that time is needed to migrate data into the DEBUG display.

    So having added a 10k pull up resistor and having added .1uf and 10uf filter caps to the power -- I will return to the original bare-bones code and see if this is all about not understanding how to program the remote. I have 5 Sony choices on the remote, but documents don't clarify which is the 12 bit Sony.

    From there, I can play with the remote AND the three IR receivers that supposedly do work with Sony code.

    I am just surprised that this is taking me 20 or more hours when it was supposed to be a simple bench test.

    Linux's LIRC support a wide variety of remotes and provides details of the code required by such with a large data base. It is good, but I suspect that the BS2 may only handle Sony 12 bit as other codes are longer and at different rates. Using a Propeller, I imagine I could do any code I wanted. But this is a Homework board project for a student.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-10 01:37
    Everything is working correctly now. It seems that a combination of factors had me blocked.

    1. For the BS2, you have to rely on the specific code as ONLY 7 bits are processed due to limitations of the uC in PBASIC.
    2. My Chinese was just not good enough to follow programing directions for the universal remote. I change my proceedure by one detail and the first Sony code seems to be the Sony 12bit.:thumb::thumb:

    So, I am now good to move on with this project :thumb:

    Thanks to all. I will report back if I do discover exotic IR receiver quirks.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-10 06:02
    Dumbo arises from the ashes...
    This was all about not programing the IR remote correctly due to poor vision confusing the characters for "power on" with the characters for "TV".

    Seems that the sensors I have work fine with Sony 12bit. I should just get a new pair of glasses and accept the reality that I now need bifocals.

    There is a certain amount of irony in the fact that I have to struggle in a 2nd language for this hobby. We have a lot of other people that do as well.
  • ercoerco Posts: 20,256
    edited 2012-08-10 19:56
    I just got a variety of these sensors (epoxy case, metal case, noise immunity, sunlight, continuous signal) to evaluate on a mobile bot. I'm going to install them in 3-pin sockets so I can swap 'em out quickly for field testing.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-11 02:57
    Since these IR sensors have 3 pins, there are 3 possible pin out arrangement. My Vishay document makes clear that all three pin outs are available.

    So it is wisest to create a dongle for the IR remote that can be reconfigured rather than soldering a 3 pin socket and finding it not appropriate for whatever is available. These may be more important if you want to fool around with codes other than Sony.

    Besides, there is a real advantage in creating a dongle that can be located where the IR receiver can do its best reception. The board can be hidden inside the chassis and just the sensor exposed to 360 degree reception.
  • ercoerco Posts: 20,256
    edited 2012-08-11 07:49
    All of my Waitrony sensors have identical pinouts and should be happy with simple, lowly sockets. But when you get that dongle sorted out, I wanna hear all about it! :)
  • bill190bill190 Posts: 769
    edited 2012-08-11 07:53
    FYI - The various Vishay IR receivers will only receive signals within a narrow carrier frequency range. If your sending frequency is not in that range, you will get nothing.

    30 kHz TSOP34830
    33 kHz TSOP34833
    36 kHz TSOP34836
    38 kHz TSOP34838 *Most common*
    40 kHz TSOP34840
    56 kHz TSOP34856

    But there is one which will receive a wide range of frequencies...
    30 kHz to 50 kHz TSOP98238

    http://en.wikipedia.org/wiki/Consumer_IR

    http://www.sbprojects.com/knowledge/ir/sirc.php
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-11 22:15
    Nothing much to sort out about a dongle. I just have 3 pins on the circuit board and create a 3-wire plug with about 12 inches of wire and another 3 wire plug at the other end. The fact that this can be altered to any of the 3 possibilities means is handy. Over the years, I have learned that one can use a wire harness in lieu of making a circuit board to move from an existing pin out to what one actually needs at the other end. Quicker, easier, and handy.

    So far, I have experiences at least one switch in the pin outs of IR receivers that are available locally - Vss and Vdd were switched.

    I am uncertain that a wide range receiver is a good thing as it allows for more interference. Ideally, I don't want the remote control for my robot to mess with my air conditioner or TV. So far, the Sony 12bit TV code is okay for that.
  • ercoerco Posts: 20,256
    edited 2012-08-22 00:47
    Just received some small 5mm LED-shaped IR receivers and thought I'd report in. Heck, the Ebay China seller didn't even know the pinout, so I had to figure that out for myself. One brave soldier gave up its magic smoke as I tested tonight, so maybe this info will help someone (or save a part) downstream. Here's the seller:
    http://www.ebay.com/itm/10-x-Reception-Distance-15-18M-Infrared-IR-Receiver-Modules-PIC-0038N-/170893650857

    Part is called PIC-0038n, couldn't find any reference to it on the web. Pins are, in order, starting from the flat side: signal out, ground, V+. Not continuous signal (drats, that's what I'm after these days) but they work fine for receiving standard Sony SIRC IR codes on 38 kHz. FYI.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-22 08:15
    Very nice little item, but they should give you a commission for finding the pin out. You had a 33% chance to get it right on the first try, and would have been very unlucky to not get on the 2nd try.

    Years ago, I decided to save shipping an buy a parallel LCD locally. Everything 'seemed' the same, but I immediately destroyed it as the Vdd and Vss were inverted.

    The reality is that there are almost no reliable standards of pin outs as the manufacturers are willing to accomodate the big buyers with anything they want.

    By the way...
    I am enjoying using an universal remove and ir sensor with Sony 12 bit. Even the BS2 will receive and decode this and can directly drive 240VAC solid-state relays all the way to 30amps.
  • ercoerco Posts: 20,256
    edited 2012-08-22 08:53
    I make 6 possible combinations of 3 pins plugged into 3 holes: ABC, ACB, BAC, BCA, CAB, CBA. So worse case, I could have made 5 bad combinations (half of my bag of 10 parts could have fried). Although there was no visible smoke, I heard sad sizzling screams from the part and there was a certain aroma. After that, I used a 330 ohm resistor to make the final connection to Vcc, which worked fine.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-08-23 03:02
    Interesting, Vishay claims to sell only 3 pin outs. But 3! is indeed 3 x 2 x 1 = 6. I was thinking that the formula for a ring permutation applied.
  • ercoerco Posts: 20,256
    edited 2012-08-27 19:47
    FYI, I've been doing some testing using these modules for tracking to IR beacons made from simple 556 timers. Finding an IR module that can detect and track to a minimally modulated 38 kHz signal is tough, they are in the minority. They need to be "continuous signal acceptable".

    I'm waiting on some from Ebay China to test to make specific recommendations. Meantime, I have determined that Radio Shack part 276-640 ($4) works, but only if it comes with a metal frame around it. Looks like they are switching to a black epoxy part (no metal frame) which does NOT work in this application. It works fine to receive Sony IR signals, but not a 556 signal. FYI.

    http://www.radioshack.com/product/index.jsp?productId=2049727 The part illustrated is the one that works.
  • erco wrote: »
    I just went to Radio Shack last night to buy two new, standard modules so I knew "exactly" what I had. Naturally they only had two, and they were wildly dissimilar, although in identical blister packages with the same part number.

    Apparently the "Shack" still sells whatever they get their hands on, not exactly mil spec stuff. Seconds, overruns, whatever.
    Just received some small 5mm LED-shaped IR receivers and thought I'd report in. Heck, the Ebay China seller didn't even know the pinout, so I had to figure that out for myself. One brave soldier gave up its magic smoke as I tested tonight, so maybe this info will help someone (or save a part) downstream. Here's the seller:
    http://www.ebay.com/itm/10-x-Reception-Distance-15-18M-Infrared-IR-Receiver-Modules-PIC-0038N-/170893650857

    Part is called PIC-0038n, couldn't find any reference to it on the web. Pins are, in order, starting from the flat side: signal out, ground, V+. Not continuous signal (drats, that's what I'm after these days) but they work fine for receiving standard Sony SIRC IR codes on 38 kHz. FYI.
    I'm waiting on some from Ebay China to test to make specific recommendations. Meantime, I have determined that Radio Shack part 276-640 ($4) works, but only if it comes with a metal frame around it. Looks like they are switching to a black epoxy part (no metal frame) which does NOT work in this application. It works fine to receive Sony IR signals, but not a 556 signal. FYI.

    I know this is an old post but I found a lot of useful wisdom from erco. The RS part (276-640) I recently purchased is deplorable compared to a prime Vishay part from a real distributor. But fiddling with it did teach me an interesting lesson about continuous signalling. Apparently the RS part I have derives its AGC signal from measuring the duty cycle of the demodulated data. If it sees a high duty cycle (anything around 50%) it starts cranking the gain down until it chokes off reception entirely. But if I maintain a duty cycle around 20 or 30%, it's happy as a clam, indefinitely.

    OTOH, it is a vastly inferior part compared to a legitimate Vishay TSOP38238 from Mouser ... inferior in practically every metric you care to name. I mean if RS is going to purchase Chinese knock-offs, at least they could have purchased the good Chinese knock-offs. :)

  • jmgjmg Posts: 15,173
    edited 2015-11-04 20:48
    bill190 wrote: »
    But there is one which will receive a wide range of frequencies...
    30 kHz to 50 kHz TSOP98238

    Mouser now tags TSOP98238 Lifecycle: Obsolete

    However Vishay do have some active parts designed for Code Learning, and those trade off some operate distance for broader bandwidth.
    These have much faster Rx responses, and will track the carrier frequency, which means they can be used for Serial Data transmission too.

    These parts are Code Learning, 20~60KHz, 5m distance
    TSMP77000
    TSMP6000
  • ercoerco Posts: 20,256
    edited 2015-11-05 21:26
    A most interesting observation, User Name. So you're saying that even a non-continuous-signal compatible IR receiver can receive a continuous signal as long as the duty cycle is 20-30%? Will have to test that when I get a chance.

    Per my post at http://forums.parallax.com/discussion/142217/ir-receivers-hoarding-time/p1 , I use the continuous-signal compatible TSSP4038 receivers a lot. I often swag relative distance with these. As opposed to the usual off-center-frequency sweep (like 34-42 KHz), I keep 38 kHz and vary the PWM, which dramatically reduces the sensitivity of these fixed-gain (non AGC) modules.

    There are a lot of subtle variations among these identical-looking IR modules. They all have lots of internal circuitry, amps & filters & such. Some are optimized for sunny locations, some for noisy environments, etc. I find that nearly all of them are suitable for receiving standard IR signals (Sony SIRC and RC5 protocol). Further, even most non-continuous-signal compatible types (including the one Parallax sells and includes with BoeBot & such) can receive a simple continuously-modulated 38 KHz signal. That is, a signal produced by a 556 dual timer. One timer generates the 38 kHz carrier which is modulated at a 50% duty cycle by the other timer, but the modulation must be in a narrow range suitable to the IR receiver. I use the attached design for simple IR beacons, which emit a steady modulated signal most receivers can detect. Further, multiple beacons can have unique modulation frequencies within the acceptable range and a robot/micro can discriminate between beacons by counting pulses.

    Edit: I have never used (nor seen an IR receiver module that requires) a pull up resistor, filter/decoupling caps, nor series resistor to the micro input.
    630 x 550 - 48K
  • Loopy, I designed a 3-wheeled bot that I controlled with a SONY remote. It has differential steering but no encoders. I had to write an offset in the pwm to get it to track straight. It's probably not what you're talking about but I'd be glad to post the code.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-11-06 08:12
    Well, a bit of time has passed since I posted this.

    KEYES has an Arduino remote with IR sensor that are sold together and use a 32bit code, not the Sony 12 bit code.

    The Sony 12 bit code is almost a necessity with the BasicStamp, but the Propeller has IR code in OBEX that handles the KEYE 32bit code very nicely and you have an much cleaner remote control that doesn't have a ton of extra TV and VCR related buttons.

    I too had a Sony 12bit on a Universal Remote rolling bot via BasicStamp that I set up for one of my younger students. No encoders, and it worked fine until the student destroyed the litium ion batteries by running them too low.

    IR remotes work great for indoors use in one room with direct line of sight.
  • ercoerco Posts: 20,256
    IR remotes work great for indoors use in one room with direct line of sight.

    Also amazing range outdoors at night!

  • User NameUser Name Posts: 1,451
    edited 2015-11-12 23:02
    erco wrote: »
    A most interesting observation, User Name. So you're saying that even a non-continuous-signal compatible IR receiver can receive a continuous signal as long as the duty cycle is 20-30%? Will have to test that when I get a chance.

    Per my post at http://forums.parallax.com/discussion/142217/ir-receivers-hoarding-time/p1 , I use the continuous-signal compatible TSSP4038 receivers a lot. I often swag relative distance with these. As opposed to the usual off-center-frequency sweep (like 34-42 KHz), I keep 38 kHz and vary the PWM, which dramatically reduces the sensitivity of these fixed-gain (non AGC) modules.

    Thanks for providing that link again (to the TSSP4038). I remember reading that post but could not find it when I went to look for it last week. Alas, your prediction was correct. It is no longer available. So I don't have it to compare against the various receivers I do have. OTOH the 5mm LED-shaped "PIC-0038n" that you referenced in 2012 arrived today and seems to work great.

    Anyway, yes, it seems conclusive that the Vishay TSOP38238 can receive continuous data so long as the IR illumination is reasonably strong and the duty cycle is within the "right" range which, atm, would seem to have to be determined empirically. I need to do the same testing with the various Chinese IR receivers that have just arrived.

    BTW, the Propeller makes a pretty great tool to drive IR LEDs for such testing. There are almost too many good ways to accomplish it. The most obvious is to use one of the counters of one of the cogs to create a 38 kHz signal to drive the anode continuously, and then use code in the same cog to create data pulses to drive the cathode. It gives tremendous flexibility to vary practically every parameter, on-the-fly. (And of course another cog can be tied to the IR receiver to decode or analyze the signalling and report the results via PST to the laptop/desktop computer. Even if you're going to use a PIC [or even a 556] in the final product, the Prop shines as a test vehicle!)
  • ercoerco Posts: 20,256
    Thanks Jim/Publison. It's the TSOP4038 which is discontinued and hard to find.
Sign In or Register to comment.