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

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.

 

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.

https://www.youtube.com/watch?v=fBUGTRK97Ag

Interesting stuff
What sensor is used in the project? THe Panasonic PNA4602? Have the variables been pretty consistent with the button pushes?

I updated my post to include

I updated my post to include a link.Eventually I am going to add to this post when I work on it some more. When I start my robot I want an LED by the fron tot blink and the next button push would be assigned to make it go forward. Then the same process for backward, left,right, etc. This way when it starts you program what button does what. All I have to do is throw the decoded IR number into a variable and do a case statement. More on my project later. I hope to finish the build tonight and work on the circuit boards tomorrow. The problem is I have to make two for the purpose I want it to serve. I’m excited :slight_smile:

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

good stuff`

This is great. I’m excited to get some IR action for my bots.

A few noobish questions, though:

1- If i’m connecting this the 28x project board, do i still need the 4k7 resistor? Or is that built into the board?

2- This is a digital input, not analogue?

3- Has anyone used the radioshack reciever module/

Thanks!

A 4k7 resistor is built in
A 4k7 resistor is built in going from voltage to the chip, but not from voltage to the pin you will be using to get voltage to the sensor. You still need one that goes between 5volts and the sensor.

ummm
so, lets say that MY FRIEND didn’t read any schematics and just hooked it up to the 5v. Lets pretend he didn’t get any reading from it. Does that mean that MY FRIEND fried it already?

Considering it is usually
Considering it is usually within the same amp requirements as a LED, it could be fried. To be sure hook one up properly and ensure it is working. Then swap the sensors and see if the fried one is fried. I burned one before I hooked it up properly. It happens quickly.

Variables
So I’ve recreated the circuit as you do it, but my variables aren’t in any way consistent. The same buttons can yield dozens of different variables. Any ideas?

Sounds very odd. My buttons
Sounds very odd. My buttons always gave the same results. Maybe the wavelength the remote uses is on the edge of what the sensor can recognize? Just to ensure the easy problems aren’t the issue post a pic of the circuit.

hi, i just ripped a receiver

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
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

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
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.

well i have connected it and

well i have connected it and it seems like the wiring is good, cause it does send something that changes with the remote’s buttons.

i just think i dont know enough about what i should be getting and how the whole reading of it should be done.

i have a feeling ill make it work somehow.

thanks for the advice!

Try removing the 4k7
Try removing the 4k7 resistor. It may be that the IR sensosr you have does not need a pull-up, and can operate directly to make a digital voltage signal.

is the 28x1 the smallest
is the 28x1 the smallest chip that can receive ir singnals ?

technically every chip can
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

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
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.

only 28 and 40x
In the manual, it only shows the icons for the 28x and 40x …