In this article we will continue our Building A Robot series with Part 3: The Proximity Sensor. The standard IR proximity sensor will be introduced and integrated into the robot we built in Part 1: The Chassis and combined with the motor control we developed in Part 2: Motor Control. The final product will be a robot that can sense its surroundings.
Purpose & Overview of this tutorial
The purpose of this part of the Building A Robot is to integrated a standard Infrared Proximity Sensor with our robot so that it can sense objects that are infront of it. If an object is detected as coming closer to the robot, some LEDs should flash as the object comes closer to the robot until finally, the robot will turn around and 'flee' a short distance away.
To accomplish this goal, we will use our already existing PIC 18F252 combined with the SN754410 motor controller we put together in Part 2: Motor Control, and add a single GP2Y0A21YK IR Proximity Sensor. This is an analog sensor, so the PIC's internal 10-bit analog to digital converter will need to be used in order to incorporate the sensor data with LEd flashing and motor movement.