How to measure distance between IR beacons?

Hi, I am working on a robot that follows me around using a pair of Pololu IR beacons and it worked fine but I want it to stop if it gets too close so I was wondering if it’s possible to measure the distance using the IR sensors.

I installed an ultrasonic sensor to avoid obstacles on the way.

I could use some ideas :slight_smile: thank you.

Not with the sessors you have at the moment. But you can get an IR distance sensor like this Distance sensor they work off the reflected angle of the return beam.