Collision Avoiding Robot using IR
Purpose
The purpose of this page is to illustrate how an IR sensor can be used in conjunction with the shadow robot chassis to create a robot that avoids obstacles.
Components
Background
IR Sensors work by using a specific light sensor to detect a select light wavelength in the Infra-Red (IR) spectrum. The Sharp IR sensor uses an LED to generate a specific wavelength of light. The IR sensor then detects the intensity of the received light, and the MBED reads its analog in pin to measure the analog output, a 0 to 1.0 value of the Sharp IR sensor. Using the basic principle, the robot is able to "sense" by evaluating the input from the IR sensor. Afterwards, the robot can execute the proper actions to avoid the object in front of the robot. In the case of the example demo code, the robot simply turns around, however, more complicated actions can be executed such as seeking an open area.
Pictures
Front side of the robot Top side of the robot Close-up of board
Pinouts
MBED | H-Bridge | Motor |
P 30 | AIN2 | |
P 29 | AIN1 | |
P 28 | BIN1 | |
P 27 | BIN2 | |
Vcc | Vcc | |
Vout | VMOT | |
Gnd | Gnd | |
Vcc | STBY | |
AO0 | Right Motor+ | |
AO1 | Right Motor - | |
BO0 | Left Motor + | |
BO1 | Left Motor - |
MBED | IR Sensor |
Pin 16 | Analog Input |
Vcc | Power |
Gnd | Gnd |
Code Example
This piece of code has the robot moving in circles. The IR sensor input is read into the MBED, and the intensity of the analog readings are displayed on the LEDs. When the intensity of the reading goes over the threshold, the robot will make a 180 degree turn and begin analyzing the nearby for objects. If no objects are discovered, the robot continues infinitely in a circle.
Import program4180Lab4SoradhmunyAndMichael
ECE 4180 Collision Avoiding Robot demo
Demonstration
Demonstration of the Code Example
Group Members
Michael Capone & Soradhmuny Lanh
Please log in to post comments.