Cliff sensor

A cliff sensor shines infrared light down at the floor and expects it to bounce back. When the light does not return, the robot assumes there is a drop and turns away.

Most robot vacuums carry several of them along the front edge of their underside. That is why a robot can clean an upstairs landing without falling down the stairs.

The trick has a known weakness: very dark or black carpets swallow the light, so the robot may treat a dark rug as a cliff and refuse to drive onto it. Dusty sensor windows cause similar trouble, which is why manufacturers recommend cleaning them with compressed air.