Since you're stuck with an optical sensor, let's look at what we can do
with infrared.
I have a product at work that uses an infrared sensor that I designed.
It uses an Osram SFH426 infrared LED and a PD100MF0MP
visible-light-cutoff photodiode. The photodiode's resin doesn't let
much ambient light through.
I went as simple as possible - the photodiode is reverse-biased in
series with a 220 K-ohm resistor. In dark conditions, only a few
microamps flow, but as more light shines on the detector, more current
flows, and a voltage drop develops across the resistor.
This drop is what I measure with my AVR's ADC. The voltage is just fed
in raw - no transistors or op-amps. In order to make a measurement, I
measure the envelope:
1) Turn off the LED
2) Take 32 samples on the ADC and average them
3) Turn on the LED
4) Repeat (2)
5) Turn the LED back off again
6) Repeat (2)
If I see the same decrease after turning off the LED as I saw increase
when I turned it on, then I know there's an object in front of the
sensor. If the change isn't equal and opposite, then I know that the
ambient light conditions are changing.
The circuit works perfectly from total darkness through blinding
North-43-degrees winter sun + snow glare. In fact, it works better than
the bar code scanner it triggers - in bright enough ambient light
conditions, the trigger sensor still triggers the scanner, and you can
barely see the laser line, but the scanner can't read the bar code for
lack of contrast.
This is mostly due to my spending excessive amounts of time selecting a
resistor value that doesn't saturate in bright ambient light and still
has a decent voltage drop when illuminated by reflections from the
Osram LED.
Note that the LED and the photodiode are roughly wavelength-matched.
Hope this helps!!
Dave
Quoting rajesh parwani <rajesh_almighty@yahoo.co.in>:
Show quoted textHide quoted text
> hey the barrier is wooden plank . but the prblem is that when the
> barrier is away more than 3 cm it shopuldnt detect. well there is a
> way of adjusting that using pot but that doesnt work for changing
> ambient light. both the detector and transmitter will be fixed on
> same plane
>
> "David D. Rea" <dave@daverea.com> wrote:What is the barrier material?
> If it is metallic, a simple damped LC tank
> circuit could easily handle <=3cm detection.
>
> DDR
>
> On Wed, 2004-12-22 at 04:57, rajesh parwani wrote:
> > hi friends,
> > im searching for the sensors which can detect
> barrier
> > at a distance of upto 3 cm and not more . well my working
> > condition have lot of ambient light . i would prefer to fix the
> > setting once for any lighting so that need not change it from place
> to
> > place. please suggest me some way . should i go for ultrasonic
> sensor
> > or the normal opto. if possible send me some circuit
> >
> > regards,
> > rajesh
> >
> > Yahoo! India Matrimony: Find your life partner online.
> > Yahoo! Groups Sponsor
> >
> >
> > Get unlimited calls to
> >
> > U.S./Canada
> >
> >
> >
> >
> >
> ______________________________________________________________________
> > Yahoo! Groups Links
> > * To visit your group on the web, go to:
> > http://groups.yahoo.com/group/AVR-Chat/
> >
> > * To unsubscribe from this group, send an email to:
> > AVR-Chat-unsubscribe@yahoogroups.com
> >
> > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service.
> >
>
>
> Yahoo! Groups Sponsor
> Get unlimited calls to
>
> U.S./Canada
>
>
> ---------------------------------
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/AVR-Chat/
>
> To unsubscribe from this group, send an email to:
> AVR-Chat-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service.
>
>
>
> Yahoo! India Matrimony: Find your life partneronline.