0
\$\begingroup\$

I am working on project where I am using an IR proximity sensor from Vishay - VCNL36826S.

This sensor is observed to give false positives randomly. As I am still trying to catch this rare event, the debug information is unfortunately not available at the moment, I will update this when new information is available.

I want to get a general idea of this type of sensor. Is it expected to provide false positives even though they are highly developed? What has been your experience?

  • The sensor has 940 nm LED, has redundant checking when a measurement crosses the set threshold.
  • The sensor is set to give an interrupt to a connected microcontroller.
  • The pullup resistor on the interrupt pin of this sensor is also added.
  • Power pins have capacitors as well.
  • Sensor is not used in direct sunlight (even if it mattered.) Indoor lights are present.

Please let me know if I missed any key information.

Any observations of experience would help.

\$\endgroup\$
3
  • \$\begingroup\$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. \$\endgroup\$
    – Community Bot
    Aug 19, 2022 at 9:36
  • \$\begingroup\$ What size pull-up or pull-down is on interrupt pin and how is the interrupt configured, both on the sensor and MCU? Are bypass caps adequate? If you only detect a short glitc about presence, can you check again if it was a glitch or still present? \$\endgroup\$
    – Justme
    Aug 19, 2022 at 11:51
  • \$\begingroup\$ Pullup resistor is 10k, capacitor are selected according to the manufacturers application example. But I will add power source to the debug list, thanks. Currently it is not checked if it was a glitch, I suppose that is a big miss. Interrupt was planned to check over the I2C (takes longer and so it was dropped), but why not do it by reading the pin status, true that! \$\endgroup\$ Aug 19, 2022 at 12:02

2 Answers 2

4
\$\begingroup\$

It sounds like you haven't set it up properly.

The VCNL36826S isn't a simple "slap it in and be happy" kind of device. According to the application note Designing the VCNL36826S Into an Application, you need to adjust some parameters to account for reflections from the housing you install it in and from the window your device uses to protect the sensor. Along with that are parameters to adjust the sensitivity, the sunlight rejection, and the power for the laser.

Properly setup, it should ignore environmental light - that's sunlight and room lighting.

If you just plop it in without appropriate initialization, it'll do something - it'll probably even provide an interrupt when something gets close. It won't be anything close to optimal, though. False triggering wouldn't surprise me at all.


Keep in mind that the VCNL36826S is intended for short range (maximum 20 centimeter) detection. If you twist the parameters to try and get more range, then it probably won't work well.

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

I had a similar experience couple years back. It is affected by both sunlight and indoor lighting. My guess is that since sunlight has lots of IR in it. It is normal to get some misreading when exposed to sunlight, but you have mentioned using it indoors so it is probably the lighting. Just put the device in a dark room and check if this time gives readings.

See that the sunlight has a IR part in the spectrum.

Sunlight Source

Also, this is some of indoor lighting spectrums.

As you can see, even in indoor lights there is quite a bit of IR emittance going on. My guess is your sensor is affected by those indoor light's IR part.

The best way to check is to put device in a dark environment and check it.

Indoor Lightings Source

If you get good readings in a dark room, you could switch to a UV sensor (I think there is not ready module on the market.) You can basically make it with a UV receiver and UV light by placing them at the same direction with a separator in between.

Alternatively, for me the best practice, is to use a ultrasonic sensor, or you could buy a more expensive/quality IR sensor which is used in the automatic taps. I did not see anyone triggered with indoor lighting.

When choosing your IR sensor, it is the most important to check its frequency. The higher the frequency, the better since many light sources, including the sun, emit very little IR after 950nm. If you can find 950-1000nm range, it would be better.

Your sensor can pick up down to 800nm, which is not good for your project:

enter image description here Datasheet Source

Finally, look up your indoor light's datasheet and check if its spectrum also crosses with 800nm and above.

Unfortunately, it is tricky to use those sensors since they get disturbed easily.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you very much for your detailed answer! It is very useful. It makes sense to check the indoor lighting conditions. I will update here, if I manage to find out concrete cause of the false triggering. \$\endgroup\$ Aug 19, 2022 at 11:45
  • \$\begingroup\$ Burak Ciceksoy - Welcome :-) I see that you have read the tour but FYI you have broken this site rule listed in the help center, requiring you to provide a reference link for anything you copy from elsewhere into a post here. Therefore please edit your answer and add a link to the original webpage below each image that came from elsewhere. Thanks. \$\endgroup\$
    – SamGibson
    Aug 19, 2022 at 12:43
  • \$\begingroup\$ @SamGibson Hi, thanks for the heads up :) I added links below the images. Is it fine? Thanks! \$\endgroup\$ Aug 19, 2022 at 13:07
  • \$\begingroup\$ That sensor uses a pulsed laser and locks into the repetition rate of the laser, so I doubt ambient light is going to have a large effect. The modulated illumination combined with the high intensity of a laser should make it fairly resistant to interference, at least as long as its not completely blinding the photodiode. \$\endgroup\$ Aug 19, 2022 at 13:07

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.