One project that i’ve presented on an electronic and computer’s workshop that happened in Castelo Branco, Portugal (II Workshop de Electrónica e Informática) consisted on a robot build with LEGO® and controlled with a LEGO® NXT kit (borrowed by the School of Engineering of the Castelo Branco Polytechnic Institute) that explores the space around it without touching anything. For that i used an ultrasound sensor (LEGO® 9846) and two touch sensors (LEGO® 9843).
The ultrasound sensor allowed the robot to detect objects that were in ahead of him at less than 40cm. If the robot detected an object it moved back and change direction.
The touch sensor was only for an emergency stop. If there was an object that the ultrasound sensor doesn’t detect for being low, when touch it, the sensor was activated and the robot moved back and change direction.
The robot used the second touch sensor for starting, like an ON switch.
The sequence used for programming the LEGO NXt was the following: