IR proximity sensor for automatic spraying

infraredpicproximity-sensor

I am a beginner in field of circuits, so excuse me for my amateur questions. Let me explain my task:

I have to build a low cost proximity sensor for a sense and spray device. I have read various posts on IR proximity sensors in this site. But I am still not clear in understanding the concepts. As I am a beginner, I get stuck at some silly amateur doubts.

So, this is what I am planning to do:

Build a IR sensor transmitter by pulsing the signal to 56 kHz using the oscillator from PIC MCU and then build the receiver part by using IR photodiode, band pass filter that allows only signals with 56khz carrier frequency, amplifier, op amp as a comparator and then the output is given to the microcontroller.

My objective:

When someone walks by the device, it should detect the movement and spray the liquid. after that it should go to standby mode for 15 min. It should not spray even if anyone passes at this time. After 15 min, it should come back to running mode.

This is the link for a similar type of product in the market.

My hurdles so far which I haven't crossed yet:

  1. To reduce the effect of ambient light and other IR sources, I decided to pulse the signal. But I couldn't get the right circuit in the receiver end to demodulate and amplify the signal. Because it has to be sensitive up to 50- 75 cms (even more would be better).
    I can use a tsop series photodiode which comes with bpf and amplifier. But I want to build the circuit with as simple of components as possible.

  2. When a black body is in front of sensor it absorbs all the IR radiation and does not reflect back any. I don't know how to solve this problem.

I have to design a circuit and then write a program for a PIC18F4550 microcontroller. But I think I can find a solution for the program. But the circuit diagram seems to be a bit difficult for me.

Please suggest a circuit diagram for the receiver part with the band pass filter that allows only 56khz signals, amplifier and opamp. Any kind of help and suggestions are welcome. Please don't hesitate to explain in a simple way.

Best Answer

Depending on what type of human proximity you are trying to detect, here are a couple of options that might work well:

Method 1: If you are trying to detect motion, the cheapest way is to use a photodiode or CDS cell connected with a pulldown resistor and read by one of your PIC's ADC pins. You will need to write an algorithm that senses rapidly changing values on the ADC pin, which will indicate some sort of motion. If you want a narrow detection area, you can use a tube over the photodiode as a blinder.

Method 2: If you are trying yo detect proximity by using an IR source and measuring its reflection from an object within proximity, you already have the correct setup. However, you will need to check the datasheet of your IR receiver module for its carrier frequency. I think 30Khz to 40Khz is the most common. You can use the hardware PWM pin on your PIC to constantly produce this carrier frequency on one of the IR LED pins. Connect the other pin of the IR LED to an IO pin on your PIC. Now you can send pulses or even serial data to that pin and it will automatically have the carrier frequency on it. With IR proximity, however, you will always run into the trouble of not being able to detect non-reflective dark objects. In which case, see method 3.

Method 3: Use an ultrasonic transducer for proximity detection. Typically two are used. Use one for pinging a pulse (at the resonant frequency) and use the other for detection. You will most likely need an op-amp or comparator circuit to amplify the output of the receiving transducer for greater ranges. The benefit of this method is being able to calculate exact distance to your object based on the flight time of the "ping" and its return. Flight time will be approximately 1/2 the speed of sound since the "ping" has to travel to the source (1) and back (2).