Let's Make Robots!

IR Detector (How do I hook it up)

jklug80's picture

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.
CaptainTuna's picture

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

CaptainTuna's picture
ah ok i got it...i was thinking about using a slave microcontroller for receiving.

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

CaptainTuna's picture

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)

CaptainTuna's picture

could this be of help?

irreceiverhookup.jpg 

mark's picture

I think this may help :

www.rev-ed.co.uk/docs/AXE040.pdf

 

jklug80's picture
I eventually bought these sensors, but they are very different from the ones I was trying to get working in this post.
jklug80's picture
I found that same diagram. This is different that the sensor I got from Radioshack that I was trying to use before I broke down and ordered that one.
TheCowGod's picture

I rediscovered these webpages I had found during my search, thought they might be useful for you.

http://hackedgadgets.com/2007/11/10/ir-detector-circuit/

http://www.tkk.fi/Misc/Electronics/circuits/irdetector.html

Looks like it' sjust a matter of using the phototransistor to bias the base pin of a regular NPN transistor. Hope that helps.

Dan