Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Proximity sensor

Not open for further replies.

I made a proximity sensor with this IR emitter LL-503IRC2V-2AD and this phototransistor LTR-3208E
wavelength 940nm.

it works well, except if I expose it to sunlight both directly and indirectly ...

can you recommend something to solve?

can I put a filter in front of the window where the emitter and the phototransistor are located?

it is urgent thanks ...
You need to provide more information about the design.. A schematic, a description of the principal of operation and pictures of the way you have constructed it. Particularly the optical layout.

yes sure here ...

I'm guessing you are powering the LED continuously and looking for a fixed level at the detector?

That works fine in enclosed devices, but for anything exposed to other light sources, the normal method is to use modulated light, eg. switch it at 1000Hz, then AC couple the detector and look for the 1000Hz signal. That avoids any effect by daylight or flicker from lamps.

You can use a rather higher frequency with suitable emitters and detectors, tens of KHz, which makes filtering out lower frequencies much easier.
Update based on your circuit:
You may be able to just make it self-adjusting for level, if the daylight effects are not too fast or extreme?

Try a resistor divider from the phototransistor to +12, tapped a few percent of the way up, or possibly use the pot as the lower resistor and 100k? from that to +12.

The output of the divider (or pot wiper)goes to eg. 1uF to 0V and the negative input of the opamp.

The idea there is to set the negative input a fraction higher voltage than the positive and track slow changes, with the cap voltage adjusting as needed.

A sudden increase in voltage due to the phototransistor partly turning off would not track instantly, so trigger the comparator.
To clarify, move the lower end of the pot to the phototransistor collector, add a higher value resistor in series with the pot connection to +12 and add a cap to ground from the wiper <> opamp input junction.

The DC offset above the + input needs to be enough to avoid false triggers.

The cap size affects how fast or slow it tracks ambient changes.
That assumes the phototransistor is normally "on" and the trigger event is when the beam is interrupted, so the collector voltage increases.

Edit - looking again, adding a series resistor between the pot wiper and cap would be a good idea, possible 100k?
Otherwise the low value pot may cause too much interaction between the cap and transistor, when that switches, limiting the voltage change.
Those are guesswork, just starting values - you need to try it under different conditions and find out what level of voltage offset between the + and - opamp inputs gives the best combination of input sensitivity while avoiding false triggers.
With the pot still in circuit, you can use 47K ? to feed it and fine-adjust the pot.

The cap value controls how fast it tracks ambient light changes without false triggers, vs. losing sensitivity to wanted triggers.
A larger cap will adjust slower. It may work OK with 10, 47, 100uF or larger, even.
I made the change ... but when there is an obstacle to the distance set with the V2 trimmer, the out does not activate ... but it activates when the obstacle is removed ... why?

P.S. I used the 47K resistor and the 1µF capacitor ...
The 555 needs a low-going pulse to trigger, but you have the 393 configure for non-inverting so that means trigger when the transistor turns on again (the collector voltage goes lower), eg. at the end of an interruption of the light beam.

If you want it to trigger at the start, the 393 inputs need reversing.
What do you think of this solution?

add a 555 as astable mutivibrator to drive the LED and at the output of the receiver I put a high pass filter with a cut above 500Hz and below 1000hz...

I'm sorry is this okay to power the 1khz emitter?

I have a 53% dutycicle okay anyway?

ne555 astabile 1khz.jpg

can you tell me the filter?
You really need to re-evaluate your entire project, buying loads of PCB's for an untested design that was never going to work was a bad move.

Suck it up, and start from scratch.

Easiest way is probably to use an IR Receiver IC (as used in TV's etc.), these include 38KHz (or similar) filtering, and provide a DC output based on the modulation from the transmitter.

So you just need a IR Receiver IC (such as a TFMS5360 ), an IR LED to transmit, and a small (8 pin) PIC to do it all - three parts, a couple of passive components, and a little software.

The PIC drives the LED with a number of 38KHz pulses, then checks the output from the IR receiver.

I used such a system years ago on my Cybot pages:

Back then the only 8 pins were OTP, now there are numerous FLASH based ones of much more power, so it would be easier now to build a modern version.
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips