14
\$\begingroup\$

I am trying to make an infrared proximity measurement device.

I want it to be in the range of 10cm or 4" (maybe 15 cm?). The frequency I use is 10 KHz. Here is the circuit I used, except that I have used 1 nF capacitors and resistors that suits them for band-passing 10 KHz. I have used LM358A for the OP-AMP and I don't know the part ID of my IR diode.

To increase the sensitivity and remove the offset, I added a difference amplifier with a gain of 10 using the other OP-AMP inside the LM358A. I've used a potentiometer to set the voltage to be subtracted from the out of below circuit.

It works! With a reasonable linearity. However, the voltage levels change with the day light intensity.

Is there any way to make this device immune to the daylight using an LDR? I've tried to connect the LDR in parallel with the offset removing potentiometer, however, as obvious, that didn't give good, logical results. I do not have any IR filters and it is really expensive to get them from Farnell or such in Turkey.

Schematic

From here.

Edit:

Here is my schematic:

My Schematic

\$\endgroup\$
15
  • \$\begingroup\$ You mention an offset removing potentiometer but I don't see it in your schematic? \$\endgroup\$
    – JonnyBoats
    Commented Jan 11, 2012 at 11:23
  • 1
    \$\begingroup\$ Maybe you can salvage an IR filter from an old/junk TV (or any other device with IR remote control). Its some little dark brown or black plastic piece that is almost complete opaque for the human eye and covering the IR detector of the RC receiver. \$\endgroup\$
    – Curd
    Commented Jan 11, 2012 at 13:49
  • 1
    \$\begingroup\$ @abdullah kahraman: Ok, but if the detector and/or amplifier is completely blocked by ambient light you have no chance to recover the actual signal, no matter what effort you make. \$\endgroup\$
    – Curd
    Commented Jan 11, 2012 at 18:23
  • 2
    \$\begingroup\$ It is really easy to get phototransistors / photodiodes in a black package that filters the IR, instead of the PD15-22C you are using. \$\endgroup\$
    – joeforker
    Commented Jan 11, 2012 at 22:13
  • 1
    \$\begingroup\$ As for the IR filter: unexposed, and then developed (black) reversal film is said to be an infrared filter, as is the "floppy" part of an old floppy disk. \$\endgroup\$
    – 0x6d64
    Commented Jan 13, 2012 at 7:57

10 Answers 10

11
\$\begingroup\$

I don't think that using the signal of an LDR can do much because the circuit already has some kind of ambient light suppression: it's the high pass filter at capacitor C8.

I agree with MikeJ-UK that the signal probably is saturated by ambient light.

If you just want to get the proximity sensor working with more ambient light I'd suggest to put an IR filter in front of the detector.

If this is too easy (or you also have a lot of ambient IR light, e.g. because the sun is shining at the detector):
You have to solve the problem of the signal being totally jammed by the ambient light.

Lets suppose the photocurrent caused by the signal is some micro amps or less and the ambient light gives you already some 0.1mA there is only a very very small signal voltage at the input voltage divider (D1/R10). The more current (caused by ambient light) is flowing in the voltage divider, the smaller your singal will be.

Just increasing the amplification doesn't help, because the noise will be amplified too and I think you come into regions where signal-to-noise ratio is what you have to take care about.

So instead of having a voltage divider at the detector a better approach would be to utilize a transimpedance amplifier:
enter image description here

Its output voltage is linear to the photo current. So this will give you at least constant signal level, no matter how much ambient light you have (see also this article about this problem by Bob Pease).

Of course this is only true within limits: if your amplifier is jammed, you can't do much.

So the amplification before bandpass filtering must not be too large. But if you make your bandpass filter narrow enough you can do huge amplification afterwards (like in radio receivers).

\$\endgroup\$
2
  • \$\begingroup\$ This is a good answer, in daylight, you modulate, use IR filters and still get beaten by the shot noise of the Sun's DC. I would add a positive bias to the diode above and put a cap between the cathode and the opamp. \$\endgroup\$
    – Frank
    Commented Jan 12, 2012 at 7:21
  • \$\begingroup\$ @Frank: What you propose would turn the circuit back into what it was before.... with all its problems. \$\endgroup\$
    – Curd
    Commented Jan 13, 2012 at 20:53
4
\$\begingroup\$

You want to extract the amplitude of a known frequency from you diode signal. That can as you have already tried be done with a very narrow band pass filter, however there are limits. Another option is to use a lock-in amplifier. They can be many orders of magnitude better than analog band pass filters.

A lock-in amplifier basically multiplies your input signal with a reference signal of the desired frequency. The output is then low-pass filtered. In this process all frequency components that don't match the reference don't generate any significant DC output as values of different periods compensate each other destructively.

I tried to find some good illustrations and found a LabView app note and a brief functional description.

Software approach: Microcontroller

Ready to use chip: AD630 (there must be cheaper ones)

\$\endgroup\$
3
  • \$\begingroup\$ You are mocking with me, right? As I know, lock-in amplifiers are the ones that are used in rubidium oscillators? \$\endgroup\$ Commented Jan 13, 2012 at 8:18
  • \$\begingroup\$ I am sorry that I was so brief, I have edited my answer. \$\endgroup\$
    – Chris
    Commented Jan 14, 2012 at 3:46
  • \$\begingroup\$ +1 Very good idea! I was also thinking about lock-in amplifier but didn't mention it, because I thought it might be to far from the existing circuit. It would be a very interesting project (some years ago I made an electronic compass using lock-in amplification). \$\endgroup\$
    – Curd
    Commented Jan 18, 2012 at 17:50
3
\$\begingroup\$

Well, although the ideas in here seems quite elegant.. well, if you can-t make it simple it might not be right. Oli Glaser had maybe the best idea here, even I have tried it myself before. you have to switch off the IR LED to sample ambient light, and then turn it on again to sample your reading, by subtracting those measures you will get the correct measure. There are going to be few inconveniences due to the saturation levels of the photo transistor, but is the best you can get out of it. IR cap filters are not really recommended if you have a low power LED.

\$\endgroup\$
3
\$\begingroup\$

Looking at the sunlight spectrum on Wikipedia, there is a dip at 940nm due to absorption of IR by water vapor in the atmosphere.

Using a IR source and sensor operating at 940nm will greatly reduce the ambient light pick-up.

The RPR220 is one, which has a 800nm and 940nm version.

\$\endgroup\$
1
  • \$\begingroup\$ Your answer would be better if it included a link to the page on Wikipedia that you are looking at, or the spectrum were inserted into your post as an image. \$\endgroup\$ Commented Apr 26, 2015 at 18:56
2
\$\begingroup\$

I suspect the input is saturating. At high ambient light levels with the diode passing near to 100uA there will be no bias left. Try reducing the 50k resistor.

\$\endgroup\$
1
  • \$\begingroup\$ Nope, doesn't help. I've replaced it (was 47K) with 39K and 33K and 56K. It decreased the sensitivity to IR, too. \$\endgroup\$ Commented Jan 11, 2012 at 13:04
2
\$\begingroup\$

If you are feeding the signal into a microcontroller, then you could maybe use a calibration routine to adjust for the ambient light.

For example if you read the level when nothing is being transmitted, you can subtract this value from the "ON" reading to get the difference caused by your IR emitter.
Something like this should help. You could do similar with an LDR in the opamp feedback to adjust the gain, but it would be trickier to get right.

Another thing might be to have a sharper bandpass filter (e.g. stagger 2 or 3 stages) so only the modulated frequency is "seen".

\$\endgroup\$
1
\$\begingroup\$

I would go along with Oli Glaser's suggestion of using a microcontroller, but I'd suggest a couple of circuit changes as well:

  1. I would suggest adding a second ADC input to the microcontroller to sense the DC level from the photodiode. My guess would be that the sensitivity of the photodiode is non-linear. If your AC input has 100x the gain of the DC input, then compute the combined value of the inputs (100x the DC value the AC value) and perform some transformation (or interpolate using a lookup table) to get a linearized value.
  2. There may be some benefit to adding an analog bandpass filter but removing the demodulator. Have the processor sample the input at 40KHz. Use four rolling-average filters (first linearized sample to filter 0, next to filter 1, then 2, 3, 0, 1, 2, 3, etc.) and compute the AC signal level as (f2-f0)*(f2-f0)+(f3-f1)*(f3-f1). This approach will offer much better noise immunity than a peak detector.
\$\endgroup\$
1
\$\begingroup\$

I've seen a few variants of IR preamp circuits to control the diode bias to avoid saturation with , for example This Elmos device and This very old IR preamp SL480 I've used a circuit based on the first example for an outdoor proximity sensor and it worked very well.

\$\endgroup\$
0
\$\begingroup\$

A mechincal solution is also possible, a "snoot" which is a tube that protects the reciever from most of the ambient light.

\$\endgroup\$
0
\$\begingroup\$

Did you try to have an extra sensor as control group, one that is exposed to the same ambien light but does not detects the obstruction that your real sensor does? Then, you substract the signal of the control group sensor to the working sensor.

It worked for me a few times in scholar projects, haha. That was when I didn't knew how to program a software filter.

\$\endgroup\$
1
  • \$\begingroup\$ This is typically going to be much harder to setup than modulating the single sensor. \$\endgroup\$ Commented Dec 2, 2019 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.