We use cookies to provide our visitors with an optimal site experience. View our privacy notice and cookie notice to learn more about how we use cookies and how to manage your settings. By proceeding on our website you consent to the use of cookies.
Using an Arduino Nano board. The system is designed to turn on a relay when the sensor is triggered. There are 2 EKMC2693112Ks hooked up to pins A0, A1. For testing purposes, I use a PULLDOWN 10K on A0, and INPUT_PULLUP on A1. Without the sensor being hooked up to A0, but using the PULLDOWN resistor, the analogRead(A0) function returns 0, as it should. Without the sensor being hooked up to A1, but using the INPUT_PULLUP, the analogRead(A1) function returns 1023, as it should. After I hook up the sensor, it reads ~250. According to Digi-Key support, the idle should be .08v, or about 16 on the readout. On A1, the readout is 1023 without the sensor attached, but ~250 with the sensor attached at idle. It should be reading in the 10xx area. When triggered, the sensor puts out a sine wave, which I can detect from about 80 on the low end and 300 on the top end. These small differences between idle/high/low allow for many false triggers, which is not acceptable. Questions:
Why is idle ~250? Why doesnāt A0 read between 0-16 with the PULLDOWN resistor at idle? Why doesnāt A1 read between 1007-1023 when using a INPUT_PULLUP setting at idle?
Am I doing something wrong, or is there another way to achieve my goal?
I wish the datasheet offered a better variety on itās timing characteristics. They only show a short time detecting a āpresentā target, but they show this output as being quite sine-wave all the timeā¦
After the 30 second āwarm-up timeā, looks like a "target now presentā would give a minimum of 1.9V as what youād want to read as your āhighā threshold, and a ātarget has leftā when it reads well below 1.0V
I spoke to David, one of your tech reps, before I posted today, and he recommended this forum.
As am I, heās unsure why Iām getting an idle value of about 250. It should be close to 0. Thatās why he recommended the PULLDOWN resistor, and without the sensor hooked up, that pin does indeed read 0 instead of going up/down as an open pin will do.
When the sensor is hooked up, it reads about 250, when it should read about 16 or so. Thatās my issue, and itās driving me nuts.
If youāre around any of the other techs at coffee, maybe you could ask them if they have any ideas?
Okay Dick, maybe Iām off, but humor me- If reading 5V = 1023, so 1.1V (idle) should read about 225 (been along time since algebra) without any resistor, yes?
This appears to be the point of misapprehension; the 80mV figure would seem to be the typical noise amplitude, whereas the expected output in a non-detection state would be about 1.1V.
rick_1976 is correct ā a detection will produce a sinusoidal voltage about a center value of around 1.1V. Additionally, though you really shouldnāt need pull-ups or pull-downs, if you do use them, they should probably be of a higher value, as the maximum output current is 200uA. 10K with a 2V output gets you to 200uA, so you would be pushing the limits of the device.
Unless you really need the analog output type, I generally prefer the digital output versions, such as these, because they do not require the use of an ADC on the MCU, simplifying the interface to just a logic pin.
OK, I now see the green highlighted area. So, apparently the readings Iāve been getting are valid and the thing just works that way? I chose analog because I could better fine tune the device to trigger on the small animals Iām detecting (not humans as itās designed to do). If I got the digital unit, how tunable would that be?
Yes, thatās the way it works. A digital one would not be tunable, so based on your application, this probably is the way to go, but it will definitely require careful tuning to be useful.
Thanks to everyone for helping! Are there other sensors better for detecting small animals? Iāve used a variety of others (cheaper PIRs and radar sensors) but they had lots of false triggers due to changing light or moving plant leaves/branches.
Thatās a difficult problem. The required field of view and the definition of the term āsmall animalsā can have a great effect on what might be the best solution.
There are infrared array sensors which might do a better job, with a trade-off of higher cost, possible requirement of higher performance processor, and significantly more complex software algorithms.
If interested, a few to consider are the Panasonic Grid-EYE family of 8x8 IR arrays and the Melexis MLX90640ESF family of 32x24 IR arrays.