Let's Make Robots!

IR Detector (How do I hook it up)

http://www.radioshack.com/product/index.jsp?productId=2049723&cp=&sr=1&origkw=ir+detector&kw=ir+detector&parentPage=search

 

I wanted to get an IR detector that would be able to read commands from a TV remote (think VERY cheap remote control robots). How do I wire this thing up? I read about infrain commands and I understand how it works, but does the IR detector get hooked up to ground and the picaxe pin infrain/in? I am using it on an 8m chip but I have a 40m at my disposal as well as a 28x1.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I would like to make a receiver like a TSOP (with integrated demodulator = basically 1s and 0s come out of its output pin) feed a signal to the microcontroller it is attached to. This is more a problem of Programmin actually.... oh yeah, and i do not want to use SERIN, i know it can be done like that but it has limits i don't like.

 Example of what i want to do:

receiver+demodulator(Infrared) receives data, 1s and 0s come out of it. How to combine those 1s and 0s into, say, a variable on the picaxe? (other microcontrollers would also do)

Mine is wired as in the example that CaptainTuna posted above.  I'm using a PICAXE 28X1 and the IRIN command, which has a timeout.  For me, using a 100 ms timeout, but calling the routine very often, works well.

I was amazed that it was so easy.  For less than $15, including the infrared receiver chip, the resistors, capacitors, and a universal TV remote, I had remote control capability.  (I set the remote up as  Sony code 00.) 

IRIN reads a number from the infrared receiver chip, and places it into a variable of your choice.  Each button of the TV remote will send a different value.  I experimented a bit (using DEBUG) to map out what button transmitted what number.  You then use the value of the variable in your code to call the actions that you want.

It's so easy, a caveman could do it.

Duane S

Wilson, North Carolina  USA

i don't really get what is a timeout for (be advised that i'm not an expert). Why to keep calling the routine often instead of making a longer timeout? What's the gain? 

 Thanks for the answer :) I'm gonna try IRIN! 

As I understand it, during the timeout period, the PICAXE is waiting for a signal from the IR reciever.  During this time, it will stop execution of the program.

By using a short timeout, but calling the routine often, program execution can continue, yet you get qucik responses when you press a button.  At least that's what works for me.  Others may have better strategies, and I'd enjoy hearing about them. 

Duane S

Wilson, North Carolina  USA

ah ok i got it...i was thinking about using a slave microcontroller for receiving.