Distance (cm) = (Echo pulse width in µs) / 58.0 Distance (mm) = (Echo pulse width in µs) / 5.8

The AJ-SR04M has four pins: