I have an idea. I saw in a previous post that at 9V the range is 2.2 meters. At 5V the range is much shorter about 30 cm. Is it possible to vary the voltage to get a different threshold turn on distance? For example at 5.5V it would be 45cm 6V 50cm. I haven’t tested this because I don’t have a power supply but if the distance varies by voltage a simple circuit can be made with a microcontroller to vary the voltage multiple times to determine how far an object is and turn on and off the unit to reset it.
Regards!