Analog sensor non-linear region

Thread Starter

shanemm

Joined Feb 24, 2017
22
I'm working with a distance sensor that gives erratic readings when an object is <2". Here's a plot of MCU ADC counts (orange) and voltage input to ADC (blue).
1598271175671.png

My first thought is to monitor the dv/dt after we cross the 2" threshold and ignore anything that doesn't have a linear increasing slope.

Has anyone dealt with this issue and have some advice?
 

Thread Starter

shanemm

Joined Feb 24, 2017
22
Could you move the sensor 2" further back away from the target?
1.75" is all I can get for clearance. The sensor is as small as I could find. However, even if I could guarantee 2" clearance there would still be an opportunity for targets with wear and tear to come with 2" (ie bent and rusty metal).
 

KeithWalker

Joined Jul 10, 2017
1,216
What is the sensor? Is it optical, infra-red, ultrasonic, magnetic, mechanical, etc?
What circuit is attached to the sensor?
How is the sensor mounted and what is it detecting?
Without that information, we can only make wild guesses.
Keith
 

Thread Starter

shanemm

Joined Feb 24, 2017
22
Maybe the minimum distance specification is 5 cm or 10 cm? That is, if 10 cm, it may give readings for closer distances, but they are not guaranteed.

For example, this distance sensor is only spec'd for 4 to 30 cm : https://global.sharp/products/device/lineup/data/pdf/datasheet/gp2y0a41sk_e.pdf
This one is 10 to 80 cm : https://global.sharp/products/device/lineup/data/pdf/datasheet/gp2y0a21yk_e.pdf
And so forth.
Yes, you are correct that the sensor is only rated for some minimum distance. But the sensor and mechanical placement cannot be changed.

Firmware solution is the only viable option I see at this point (if it can be done at all). Has anyone had to accommodate such a design before?
 

jpanhalt

Joined Jan 18, 2008
10,210
Yes, you are correct that the sensor is only rated for some minimum distance. But the sensor and mechanical placement cannot be changed.

Firmware solution is the only viable option I see at this point (if it can be done at all). Has anyone had to accommodate such a design before?
Firmware cannot a sensor do what it can't do. Foe example, if it looks at the angle of reflection, below its minimal distance, you are seeing mostly noise. Id it is time-of-flight, the same holds true. Simply put, if the sensor is outputting garbage, you will get garbage. You might be able to convert that into numbers, but it is still garbage.

Why the reluctance to tell us what sensor you are using?
 

Thread Starter

shanemm

Joined Feb 24, 2017
22
Here's the model number and link:
Pepperl-Fuchs Ultrasonic sensor UC400-F77-IU-IO-V31
https://www.pepperl-fuchs.com/usa/en/classid_186.htm?view=productdetails&prodid=72646#documents

I'm experienced with signal processing and I understand that the mechanical system should be designed with the sensor limitations in mind. But this system was poorly designed and now I have to find a way to mitigate potential problems.

@MrChips that's a good idea. Something like the HSDL-9100-021 looks like it's perfect for the 0-2" proximity range.
 
Top