Remote Control via Infrared based remotes
Buck Rogers
Posts: 2,187
in BASIC Stamp
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.
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
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
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
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.
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.
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.
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