Shop OBEX P1 Docs P2 Docs Learn Events
Remote Control via Infrared based remotes — Parallax Forums

Remote Control via Infrared based remotes

Hello!I have here the remote control kit that Sparkfun sold, https://www.sparkfun.com/products/13235 (Although mine is a different remote.)
And a generic remote from Target. (Which oddly enough isn't even sold by them anymore. It looks rather like the one sold by Parallax.)
What I'm looking for are suggestions for using the receiver parts to communicate with a BS2 device to enable the flow of information the remote is sending it to be easily translated into something that I can deliver to one of my later creations.
That whole business from Sparkfun was originally aimed at the Ard*****  users to enable it to be used to control stuff. Before finding the code examples for the BS2 to confirm that it works, I originally thought of having one of those things receive the remote's data bursts, and then send it along via an ordinary IRLED to a matching detector of some sort. Probably one of the TAOS sensors that are (or were) sold via the Parallax site. That's where theory and common sense broke down. How to write the BS2 code to do the whole business. And of course how to gimmick up the code on the other guy.

Comments

  • From what I was able to gleen from user comments on the Sparkfun link, the Ir Remote they provide uses the NEC protocol. Looking at it using a Vishay decoder like the one provided, it is comprised of a very long low sync pulse followed by a positive start pulse of about 4400 microseconds followed by a set of 4 8-bit codes ( device code, device code inverted, command code, command code inverted.  The positive pulse lengths vary slightly from remote to remote but on average a logic 1 is about 1600 microseconds and the logic 0 pulse is around 470 microseconds.  The 0 volt gap between positive pulses is the same length as a logic 0 pulse.  The decoder will output a steady hi when not receiving Ir pulse streams.  The NEC protocol specifies MSB first out.
    Using a BS2 you can use the PULSIN command to read and decipher the data stream.  PULSIN resolution is 2 microseconds so just look for corresponding measurements such as 2200 for the start pulse and 800 for logic 1 and 235 for logic 0.  You can safely discard the first two bytes since they never change with the same remote, capture the the third byte which is the button pressed and, if you wish, capture the fourth and exclusive OR them to verify data valid.
    I had earlier cobbled a Vishay decoder and hooked the output up to a Saleae logic analyzer and with two different NEC protocol remotes got the following measurements.

    Per Saleae, Toshiba Start pulse is about 4370, 0 is 460 - 490, 1 is 1588 - 1615
    Kenwood Start pulse is about 4450, 0 is 500 - 501, 1 is 1610 - 1634


    Hal





  • ercoerco Posts: 20,254
    edited 2015-08-01 15:08
    Sony TV is the most popular hobby protocol AFAIK. Parallax publishes a software routine which is very solid and of course, universal TV remotes can be configured to send any protocol. Many of those have Sony TV as the default format.
    I still use IR remotes a lot. They work great indoors, have lots of control buttons, and since you probably already have one or more IR remotes, the only cost is the IR receiver on the project, as cheap as 15 cents each:


    http://www.ebay.com/itm/10-Pcs-Reception-Distance-15M-VS838-IR-Receiver-Modules-Black-PS-/221809726748

    BTW  I posted about a nice $2 IR remote at


    http://forums.parallax.com/discussion/161085/solid-2-tv-remote
  • I don't think the Taos sensors Parallax sells/sold would work well to detect the IR from the remote. As has been suggested, you need want an IR receiver intended to be used with these sorts of remotes. The IR transmissions are modulated and the special receivers will only recognize the modulated light. As erco points out these receivers are inexpensive.
    As Hal shows, it's possible to decode just about any remote. However decoding some random protocol can take a lot of work so by far the easier route is to do as erco suggests and use a remote with the Sony protocol. I'm pretty sure there's BS2 code to read the Sony protocol.
  • I don't think the Taos sensors Parallax sells/sold would work well to detect the IR from the remote. As has been suggested, you need want an IR receiver intended to be used with these sorts of remotes. The IR transmissions are modulated and the special receivers will only recognize the modulated light. As erco points out these receivers are inexpensive.
    As Hal shows, it's possible to decode just about any remote. However decoding some random protocol can take a lot of work so by far the easier route is to do as erco suggests and use a remote with the Sony protocol. I'm pretty sure there's BS2 code to read the Sony protocol.

    Duane, as it happens you're quite correct. It seems the first couple of times I tried to use one of the TAOS ones that did understand IRLED bursts, there was too much of a <DELETED!> fudge factor involved.
    It wasn't until I tracked down the other materials on the thing that I realized why. 
    It was never designed for that kind of action.
    Hal? You've just gotten a good recommendation on things concerning the Vishay decoders which are the chosen receivers and everything else involved.
    Erco your post, with its links suggests something. I'll have a photo up RSN regarding my remote and what else.
    There are several others we need to hear from next.
    And what's that bigfoot doing in your yard there Erco? He's got an entire boring mountain chain to guard.
  • However....I've decided that however lofty my goals were for this project, I can't complete it.
    Neither the Basic Stamp or the Ard***** have the I/O or the methods to properly translate and implement the functions that the codes would mean.
    Sadly this is a constant with many of my projects. This was a good discussion. We can now move onto other things.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2015-08-11 13:01
    I am sorry to hear you have been having difficulty.

    Part of this may be actually the wrong choice of remote devices. The device for Ard***** appears to require a 32bit code to operate. To work at all on a BS2, it has to be a much more complicated reception program.

    The BasicStamp2 is an 8bit device and it does well with the Sony 12bit code by ignoring 4 bits of info.

    You can program a universal remote to provide a Sony 12bit format and it will work nicely with the BS2 examples -- very reliable. Or you can use your 32bit device with a Propeller and that will work nicely.

    You just have to realize that the BS2 doesn't work with all the available IR remote codes that are out there (and there are hundreds that fit roughly into 4 groups of processing).

    I believe the IR receiver you got with the Ard****** will work with a Sony 12bit code, or just about any device. Most are a modulated 38500Hz IR
Sign In or Register to comment.