Let's Make Robots!

Infrared with PICAXE (tested with 28x1 and 40x1)

When a button is pushed on an infrared remote it makes an LED blink

irreceiverhookup.jpg

Infrared Sensor (LED020) from the PICAXE store was used.

http://194.201.138.187/epages/Store.storefront/?ObjectPath=/Shops/Store.TechSupplies/Products/LED020

 

I realize this looks really basic but it cant be added to so that your robot does a certain action when a certain button is pushed. For example channel up makes it go forward, channel down makes it go backward, the volume buttons make it go left, or right, and other buttons make your robot do whatever. This is a simple how to set up the IR sensor so all it does is make it blink.

From a 5 volt power source tie a 4k7 ohm resisor to pin 1 and from the resistor to an input pin on your microcontroller.

Take pin 2 and connect it to ground.

Take pin 3 and connect it to a 330ohm resistor and to a 4.7 uF capacitor. Connect the other end of the capacitor to ground.

 

100_0993.JPG100_0994.JPG

I used a $5 universal remote, but you could also make your own remote using another IR sensor and some buttons. Notice at the end of the video the button pushes are stored in a variable and sent to the debug window. To determine which button was pushed just have your code look at the variable and do whatever action was pushed. If you want your bot to stop when a button isnt pushed just put the IRIN in a for loop. Have it kick out of the loop after 50 miliseconds if nothing was pushed. Then clear the variable and go back to the irin loop. 

 

The code I used:

SYMBOL IR_PIN  = pin0
SYMBOL LED_PIN = 0
symbol infra = b14

HIGH LED_PIN
pause 250
LOW LED_PIN

WaitForSignal:

irin 0, infra
debug infra
HIGH LED_PIN
PAUSE 250
LOW LED_PIN

GOTO WaitForSignal   

I'll add more to this once I am done with my next bot. I want to eventually make my own remotes as well.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
is the 28x1 the smallest chip that can receive ir singnals ?
technically every chip can receive it, if you're using the SERIN method. If you are using the infrain method then only some chips can receive it. You should check the pinouts of the picaxe chips on your manuals to see whether they have a pin labelled "infrain".

I am trying this technic with a picaxe 08M witch does have a pin labeled "infrain", 

but everytime i try and download your code it says " unknown symbol - pin0" and it does the same for b14.

any idea why?  

Not sure I havent done much with the 8m. I would assume b14 memory address doesnt exist on th e8m since it has less memory. Check the debug window to see if it is there. It likely also doesnt support pin0 as a command. Check the manual to see if it lists 8m as being able to use it. It may not be supported.
In the manual, it only shows the icons for the 28x and 40x ...

It works with a 18x too, i used it in my SillyWalkBot.

The Infrared is also treated in that thread,  in which i discovered that you can actually get rid of the 330ohm resistor... i did, and it works...

hi, i just ripped a receiver from an old computer tv card ( its still working with the remote i have)

its a black square with a black led and 3 legs, looks really simmilar to the led020 for the picaxe

i hooked it with the resistor and the capacitor just like you said and its not working

im trying to see any varible change in the dubeg window but nothing apears just says "waiting"

my code was

main:

irin 0, b0

debug b0

 goto main

i also tried to give b0 a value (50) before the irin but it still had no value in the debug mode

 

if you have any idea, or you think it wont work (because i just used something that LOOKED like the led020)

please let me know, thanks.

It could require a completely different circuit to work. You need to find its part number and look for a datasheet.

ok a little update.

while the picaxe and the circuit get about 4.3 volt (same source)

i tried to read to voltage on  the 4.7k resistor:

while no button is pressed it shows 1.59 volt

and when i push a button on the remote it changes to about 1.8-1.7 volt (depends on the button i push)

so something is working here, i just thought if you could tell me what that  voltage reading is supposed to be , ill try to change the 4.7k resistor so it will take more or less voltage and change the signal to what it needs to be.

 

thanks!

I dont have the circuit built anymore so I cant measure voltage. If you are using s different sensor you may need to wire it differently. Please find a part number and see if it has a datasheet. Just because it is an IR sensor and has 3 pins doesnt mean it is wired the same. Wiring it incorrectly can burn the sensor and possibly cause damage to the batteries or a fire. That sounds a bit dramatic but always wire things according to the datasheet. In this case I have no idea what part you are using.