IR help required, please

MatthewMorris

New Member
Hi to all!
I'm an A-level student, studying electronics and have ran into a problem with my work. My project is a laser-quest style game using IR.
At the moment I have been using the remote supplied with the PICAXE IR kit to experiment with.
My problem is that having built up a PCB for the sensor, which has been double checked, my ciruit will not detect a 'hit'. I have been using a very simple test code just to prove functionality of the circuit, but is seems not to work. Can anyone spot a mistake in this code, or suggest other areas to investigate? At present Output 3 is an LED indicator.

Below is my simple test code.
main:
infrain
if infra = 1 then hit
goto main

hit:
high 3
pause 1000
low 3
goto main

Your help would be very much appreciated.

Thanks,

Matt
 

Michael 2727

Senior Member
You need to test each step along the way-

First check the battery/s in the IR Remote.
Verify the remote actually works, a mobile phone or video,
security or web cam will usually detect IR as a white or pink light.

Put a piezo sounder element (not a piezo siren) across the IR detector output
to see if it is detecting any pulses (you should be able to hear them).

Then change your Picaxe code to accept ANY IR signal not just a "1"
The Infrain command will lock up the picaxe until it gets a VALID IR signal
(valid being SONY TV protocol), it will sit and wait forever unless it gets a correct signal.

So I would suggest using the "COUNT" command or similar on another pin then
once you are sure that pulses are being recieved then go back to "infrain"

Good luck !
 

Technical

Technical Support
Staff member
Make sure the remote has been programmed with the Sony code (212) - you need to do this every time the batteries are changed.

Also try a debug, leaving the cable connected.

main:
infrain
let b1 = infra
debug
if infra = 1 then hit
goto main
 

BeanieBots

Moderator
You've not said which PICAXE you're using.
If it's an 08M, then pin3 can only be used as an input so "high 3" won't work.
 
Top