Hardware Design
Motion:
Bot movement was achieved using 2 stepper motors that were provided by Prof. Land. We made extensive use of the Vertical Plotter project, SP 01 for understanding the operation of the stepper motors.
The operation of these 7.5 degree stepper motors is documented below. The motors had 2 brown leads that needed to be connected to Vcc. The rest of the wires had to be excited in the sequence of brown, red, orange and white to operate the motor. The following sequence was used to test the motor operation in the beginning.
| Brown | Red | Orange | White |
| + | |||
| + | |||
| + | |||
| + |
Thereafter to provide more torque to the motor 2 of the wires were excited at a time in the following sequence to provide a half step at every cycle. When operated at 12 V the motors provided us with sufficient torque to move the bot.
| Brown | Red | Orange | White |
| + | + | ||
| + | + | ||
| + | + | ||
| + | + |
As a first step the motors were driven using the TIP31C transistors. To drive each of the 2 motors we would need 8 of these transistors and assembling the circuit would be cumbersome. Also the circuit with 8 transistors would occupy a considerable amount of space on the bot whose size was limited. We thus decided to use the ULN2003 chip to drive the motor and isolate them from the microcontroller. The microcontroller output was connected to pins 1 through 7 on the chip and the output across pins 10 - 12 were connected to the stepper motors. 2 of these chips were used, one for each motor.

ULN2003 Pin Config
The following code was written to step through each of the motors.
A speed differential on the wheels was used to turn the bot. A ping pong ball placed on the front acted as a third supporting wheel. The 2 wheel configuration allowed us to turn the bot in its place.
Obstacle Detection:
The Sharp GP2D02 sensor was used for the purpose of obstacle detection. Using the sensor was fairly straightforward. Using the microcontroller, we implemented a state machine which outputted a sequence of signals to the sensor as illustrated below. Once this was done the output of the sensor was read in serially to obtain distance information. If an obstacle was found to be in a vicinity of about 7 cm or closer a flag was set so that the bot would avoid the obstacle.


More information on the Sharp GP2D02 sensor may be found here
Direction Tracking:
The robot would need a mechanism of tracking some kind of input sent from far away, and use that information to determine the direction of motion. We decided to build an infra-red sensor capable of picking up an IR beam from 4-7 feet away. We were inspired by the IR sensing used in a Spring 2002 project entitled “Line following Autonomous Car.” We got a Radioshack emitter-receiver pair from Professor Land and built a source and receiver circuit. The circuit schematic is shown below:

Schematic of initial IR source-receiver circuit
The sensor would pick up the IR beam from 7 feet away but the voltage received would be very small, ranging from 50 mV at 5 feet to 1V at 2”. The first problem was that the sensor was picking up noise from the 60 Hz room light and also sunlight. This was substantially reduced by using a simple RC high pass filter with a cutoff at 1 kHz. We used a 555 timer to drive the emitter at frequencies higher than 220 Hz, such as 230 Hz, 345 Hz, 0.5 kHz, and beyond using different RC pairs. This solved the noise problem. Next, we realised that the sensor voltage would have to be fed into a MCU port. This meant that we needed a voltage of the order of 2.5-3V to get any meaningful output from the sensor. We imagined that having a simple gain stage would solve the problem. So we tried using an inverting amplifier, then a non-inverting amplifier, and finally a comparator all based on the LMC 7111 op-amp. The gain drove the voltage to the power rail at short distances but it actually destroyed the receptivity. The sensor would no longer pick up a signal from farther than one and a half feet. One solution was to use the Analog Comparator in the Mega 32 MCU but since we needed four such blocks, one for each sensor, this was not sufficient.
We were also having problems with the 555 timer at the source side. This led us to use a standard DVD remote control which sends IR beams at 38 kHz. Shaun found cheap IR receiver modules online, and he was able to sample four Vishay TSOP1138 sensors. Looking at the pin-out and block diagram of the TSOP1138 given below, the reader can appreciate the level of complexity needed in a good sensor.


Schematic of Vishay TSOP1138 sensor used to receive a DVD remote-control IR beam
To control the receptivity of the sensor, we decided to try PVC electrical tape. It worked perfectly. The trick is to drape the sensor in layers of airtight tape, and then cut a small hole in the middle, and then tunnel it using a small tape-covered tube. This restricts the sensor vision to one direction only. The hole-size and the length of the tubing determine the field of vision. Shaun mounted the four sensors on an arch made from cardboard and our robot was ready to go!