Infrared Beam Door Sensor

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Guys,

I am looking for some ideas on how to proceed with a small project I have done.

I just completed a small project for my home to monitor a doorway. If anyone passes through the doorway the IR beam is broken and a beeper beeps.

I used the avr410 example for the receiver and some RC5 transmitter code for the transmitter.

The transmitter sends two start bits and one 8 bit byte (0x55) every 100mS. I have modified the receiver routines to accept only 8 bits instead of 14 bits (the original avr410 code).

If the receiver does not see a 0x55, it beeps the buzzer. It works.

I can't help thinking there is a better way to do this. Sending continuous 36KHZ does not work (the receiver does not accept it).

I have seen kits available that will beep if the IR receiver goes low or high. I can't seem to re-create this.

Anyone have any ideas?

I am not looking for handout, or sample code, I just want some advice.

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You would probably need a different IR receiver to detect a transmission @ 36Khz... The preferred frequency is 38Khz...
http://uk.farnell.com/jsp/search...

Metal can types work much better than the plastic types, but are more expensive. Connect to Vcc via a 47R resistor and 100uF cap

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using a Sharp GP1UV700QS (36KHz) and it is working. Connected as per datasheet instruction,
47uF cap, and a 47 ohm resistor to VCC.

However it will not detect a continuous IR stream.

I can't help wondering if there is a better way to do this. The kit available here:http://www.electronickits.com/kit/complete/elec/ck1620.htm
is very simple (the receiver I mean).

When the beam is broken, the output of the IR detector is high. This can be connected to an external interrupt on the avr and devices can be operated from that(i.e buzzers, LEd's, sound, etc).

I am thinking that all of the code I have written is unnecessary to make it work. First sending a byte, then receiving the specific byte (in my case 0x55).

Correct me if I am wrong here: A constant IR stream of 36KHz sent to the receiver doesn't work, I believe you need an ON then OFF to make the receiver's output go LOW/HIGH. I am unsure as the datasheet is not clear on this.

Just looking for any advice or ideas.

Thanks

Last Edited: Wed. Feb 9, 2011 - 07:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One would normally send IR data via a 'soft' UART TXd at 600-1200 baud.You have to add a 32KHz modulation when the transmitted bit is a 'low' (simple bit on/off loop) and just output a high for a 'one'.This signal is duplicated by the IR receiver.....which would be connected to the RXd of an AVR (eg).
A constant IR stream would result in the detector being permanently high(or low).I think like this, the range would be very limited, but I've never tried with a contant IR transmit level, always modulated by TXd.
You can't go much faster than 1200 baud as you don't get enough modulation cycles for a low.I find the fastest usable baud rate is around 1600 baud.....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most IR detectors are not meant for continuous carrier detection, bursts only. You need one that does accept continuous carrier.

Quote:

Correct me if I am wrong here: A constant IR stream of 36KHz sent to the receiver doesn't work, I believe you need an ON then OFF to make the receiver's output go LOW/HIGH. I am unsure as the datasheet is not clear on this.

You are right. It reads loud and clear right there on page 2 - carrier total duty ratio must be 40% maximum.

While they do say minimum carrier burst length of 250us, they do not say what is safe maximum.

Based on other IR receivers and known IR protocols, I'd say about 10ms is maximum you will ever encounter. But not all receiver modules are suitable for every IR protocol there is.

Now what I would do is to use the example burst trail of 600us on and 1000us off, creating 625Hz square wave with 37.5% duty on the receiver. If there is a square wave, beam is OK, if not, beam interrupted.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Unfortunately I couldn't make it work any other way.

I posted the working project here:
https://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_type=project&item_id=2900

maybe someone will come up with a better solution. For now, this is working perfectly.