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.

For remote control I don't really think it's a problem that the infrain command is blocking. When you receive a command you would normally set some state for the motors - for example set it to turn or to go forward, and then you would wait for another command. Remote control doesn't normally invoke behaviour that requires continous processing.

I am planning on making it so when you hold down an up arrow on the remote it goes forward. When you let go it stops. Same for right, left and backward. Maybe another button that does something else. As long as it does nothing when a button isn't pushed I'm fine. This fits the contraint of infrain. It doesn't need to think for itself, only do what it is told to do when I tell it. If I wanted a sensor to avoid letting me mash it into the wall we would have problems.

I'm assumign the code will be

main:

infrain

select infra:

case 1:

blah blah blah

case 2:

blah blah

....

end select

goto main:

 

That is done quite easily, no prob if it is not going to think. The SONY protocol for IR is used with INFRAIN, and I think you have some 127 different commenads. I made something similar, remoted a bot with a TV-style remote control. THe Picaxe shop has one "all round" that is quite handy, easyly configured and stuff. (cheap, and I think it can also be included in a.. KIT!)

- ANd btw; My robot never worked well, because I did not know of the motor drivers and stuff, so it was really slow adnd crap, driving on the pins from the chip directly :D (But that is another story - before I got the 28 KIT)

 

Oh.. my reason for writing; TheCowGod's bullybot-project would not have a good time with INFRAIN - that was my point initially! 

I think you'd be easier off if it didn't have to stop when you let go of the button. How do you detect when the button is not pressed when the infrain doesn't time out? Maybe use a timer to generate an interrupt and then check some state variable that says if you detected button down previously or something like that - just thinking out loud :-).

Would be much easier to do if the robot was set to go forward when pressing one button and was set to stop when pressing another and so on - also that wouldn't wear so much on your thumb ;-).

I'm looking forward to seeing this guy in action!

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

I broke down and ordered some off the picaxe site. It is my second order form them in the last week ;) I will try to get it working as I want to know why it isn't working. I just can't walk away without fixing something or proving why it won't work.

could this be of help?

irreceiverhookup.jpg 

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.

I think this may help :

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

 

I eventually bought these sensors, but they are very different from the ones I was trying to get working in this post.