How are you coming with the IRs?
A few years ago I did a laser "trip wire". The same thing can be adapted to IR.
The laser pulses at a given rate so the sensor can not be defeated by another laser or bright light. Think of those silly movies where the laser system is defeated with mirrors and such. Can not happen, or not likely to with this.
I used a simple laser diode like you would find in an office pointer. and a photo-transistor for the sensor. The sensor was placed in a 24 inch long tube so ambient light would not was it out. Night time monitoring would obviously not need this.
So here is the code if you want/need ideas. As always there are several ways to do this that may or may not be more efficient. But this system has been monitoring a quarter mile long line for around three years now.
Laser Pulse:
Code:
DEFINE OSC 4
LOOP:
HIGH GPIO.4
PAUSE 20
LOW GPIO.4
PAUSE 95
GOTO LOOP
Laser Sensor:
Code:
DEFINE OSC 4
LP VAR BYTE
START:
COUNT PORTC.1,100,LP
IF LP <> 1 THEN CHECK
HIGH PORTC.5 'HEART BEAT LED
PAUSE 50
LOW PORTC.5 'HEART BEAT LED
PAUSE 50
GOTO START
CHECK:
COUNT PORTC.1,100,LP
IF LP <> 1 THEN BREACH
GOTO START
BREACH:
'DO SOMETHING
GOTO START
Bookmarks