The vehicle will use the TIVA ARM cortex 4 as a microcontroller unit to control four DC motors through the LM293D H-Bridge IC allowing 3 modes of operation:
Forward direction: It enables the vehicle to move forward, forward-right turns, and forward-left turns.
Backward direction: It enables the vehicle to move backward.
Zero motor mode: This is the default mode when none of the above conditions are running, indicated by a “stop” command when the motors are already running prior.
The inputs and outputs from the Bluetooth module are seen through a terminal window on the Serial Bluetooth Terminal app downloaded through the Android Play Store. Once connected, the app will display the ultrasonic sensor readings and buttons the user can press to control the car.
To configure the ultrasonic sensor, we used the pins PA4 and PB6 on the launchpad, shown in the figure below. Additionally, if the ultrasonic sensor detects a distance less than 50 cm, the stopBothMotors(); function is immediately executed to avoid a crash.
We used Timer0A to capture the time a trigger signal was emitted and the time the return signal was detected. The time difference between these two was used to convert to distance in centimeters. This calculation was run in the main loop and theresulting distance is constantly serialed out to the terminal on the app through UART5.