Hi Murray,
The PWM3901 is reliable but does give me quite a wide error of about 10%, and I think this varies depending on the surface.
My plan is to implement a Filter and sample more frequently, based on this. https://towardsdatascience.com/kalman-filter-an-algorithm-for-making-sense-from-the-insights-of-various-sensors-fused-together-ddf67597f35e
Another option I considered is to use two PWM3901 sensors space apart by several cm, and this can be used to average the result, but this increases cost.
I’m using the sensor at 35mm above surface, I did try 80mm but I didn’t notice much improvement in accuracy and repeatability.
In my application, the distance to surface varies from 35mm min to 100mm, so I use small TOF distance sensor, to sense Height, which is used in the equation for x,y distance.
Pixart make a similar sensor which is much better suited to shorter distance floor tracking:
https://forums.pimoroni.com/t/request-new-floor-tracking-sensor-based-on-pmw3901-breakout/14360
I asked pimoroni to make another breakout board but so far no response. I may try to make my own board, but the difficult part is sourcing the PAA5100JE-Q sensor.
Best regards
Ashley