View Full Version : IR for Advanced Beginners

01-28-2008, 01:39 AM
There are two IR receivers in the Education Kit. There is ample documentation how to work them; but nevertheless - if someone needs some easy Sunday occupation here it goes:

(1) Connect the IR-Receiver. This is extremely simple, as it is not just an IR-diode but a quite complex chip! The leads are, looking at its "eye":
left = 1 = data output (there are sometimes marks on it, looking like a "3"... very confusing!)
middle = 2 = ground
right = 3 = power supply, nominally 5 V, but 3.3 V does fine!
Now chose any pin (I recommend 15) for connecting the Propeller.

Thats all!

(2) I enclose a small part of a diagnostic program that shows you what is going on with your IR RC. The program works with Andy's PropTerminal, but you can readily change the object to TV_TEXT. There are different carrier frequencies (36 and 38 kHz is standard) , but the hardware is a very complient type..

(3) Have a look into some more advanced explanations and make your own IR keyboard from an old zero cost remote control! I had no problem decoding RC5 and Sony protocol types...

users.pandora.be/davshomepage/index.htm (http://users.pandora.be/davshomepage/index.htm) is an instructive link

Edit: I was not aware of the work of Bob Belleville obex.parallax.com/objects/37/ (http://obex.parallax.com/objects/37/) This virtually parallels my activities as ever could be http://forums.parallax.com/images/smilies/smile.gif .. Have a look there, he also explains the most important protocols in an accompanying PDF

Post Edited (deSilva) : 3/1/2008 7:56:18 AM GMT

01-28-2008, 02:12 AM
Wow. I didn't know they were capable of doing this.
I bought an IR reciever at what you call "the wrong place".
Think it was this one: http://www.conrad.de/goto.php?artikel=156406
I used IR kit from the object exchange·to figure out the code for my digital camera and "Sony Send Test" to remote control the Camera (Casio Exilim P700).
Works very nicely but it is very dirty so I can't post it until I've cleaned it up... http://forums.parallax.com/images/smilies/lol.gif I more or less destroyed the objects instead of using them.

But your code looks very comprehensive, so I'll try to understand it as soon as I got my DOGM figured out some more.
Spin wouldn't be fast enough to transmit IR signals though, would it?


01-28-2008, 02:16 AM
deSilva, I've wondered how that IR receiver works. I hooked the output up to my scope, and it seems the output is always at discrete levels and never in between, even if you vary the IR intensity. I suppose when you say it's a complex chip, you mean it converts the analog signal from the eye, into a digital signal on the output? I see now why parallax sells if for something like $3-4 dollars when I can get a simple IR transistor for pennies... I'd much rather pay for this package.

01-28-2008, 02:29 AM
That was not such a bad buy, Clemens http://forums.parallax.com/images/smilies/smile.gif Very popular are TSOP17NN receivers, where "NN" is the carrier frequency they work best with, e.g. 38. About 65 cents @ Reichelt, I think.

Which brings us to spin.. 38kHz is the Carrier needed, which is close to the limit of SPIN's capabilities

!OUTA[ pin]

will need around 20 µs which results in 25 kHz. Unrolling the loop will bring you into that region, but witout any flexibility, unless you choose a very specific crystal.

But there come the TIMERs for rescue. They are absolutely easy to control from SPIN, so your only concern is the "RC protocol", which needs setting HIGH or LOW for 500µs to 700µs (dozens of SPIN instructions!) depending in the protocol; RC5 is most simple to do.

I am just trying to scroll a longer text downloaded from the PC through the DOGM display using your tiny font! I control it by IR, of course http://forums.parallax.com/images/smilies/smile.gif.

If needed I can rewrite the driver in PASM, but at the moment this is not the bottleneck, and it would need a seperate COG then...

Post Edited (deSilva) : 1/27/2008 7:35:59 PM GMT