Project by Austin O'Connell and Brandon Lasater
Our project simulates a miniature version of an automated bus route. In cities or school systems, buses typically run the same route over and over. This means the route can easily be automated without assistance from an actual bus driver. The bus will be able to track it's location based on which bus stop it is at. If any obstacles obstruct its path, the bus will automatically stop, and a person can manually override the bus to put it back on its path.
This project does just that with the help of the Magician Chassis robot. The robot is programmed to move in a square representing a bus route with 4 stops (one at each corner). The bot will drive itself to a "bus stop," wait 5 seconds (for passengers to board), then turn and continue to the next stop.
The bot is equipped with an LCD screen that labels its location and offers a menu (controlled by pushbuttons) to remove or re-add some of the bus stops along its path.
Attached to the front of the robot is an IR Proximity Sensor that will detect if an object is in front of the bot. If so, the robot will immediately stop moving if it is in auto-pilot mode.
If an object does move in front of the bot, then auto-pilot mode will immediately stop, bringing the bot into manual drive mode. We use a Universal Remote to send signals to an IR Receiver attached to the bot.
The Universal Remote is set to transmit using the NEC Protocol at 38400 baud (38kHz).
The user can user the remote to bring the bot back to the "bus stop" that it was last heading towards. Buttons 2, 4, 6, and 8 are used to move the bot forward, left, right, and backwards, respectively. When the user wants to cancel manual driving, pressing the 1 button will put the bus back into auto-pilot mode.
The IR Receiver library includes ReceiverIR.cpp (from https://developer.mbed.org/users/shintamainjp/code/RemoteIR/), which recognizes data in three states: Received, Receiving, or Idle. The state resets to Idle after each time receiving a signal from the remote. In order to avoid changing the ReceiverIR source code, a wait of 0.1 seconds has been added to main.cpp after detecting an Idle state from the receiver. This small amount of time allows the motors to continue moving seamlessly without pausing between repeat signals from the remote controller. This allows the user to hold down a button (such as button 2 for forward) and keep moving continuously.
Here's a video showing the functionality with a remote. After pressing button 1, the robot begins its automated route, which is to move forward 2 feets, wait 5 seconds, turn right and move 1.5 feet, wait 5 seconds, and continue in this pattern. The end of the video shows the remote being disabled while in automated mode. When the push button is pressed, or when the IR proximity sensor detects an object in front of it, the robot will switch to manual mode again. Then the remote will function as it did at the beginning of the video.
|IR Proximity Sensor||https://www.sparkfun.com/products/242|
|Dual H-Bridge Breakout|
|Magician Chassis Kit||https://www.sparkfun.com/products/12866|
|LCD Pin||mbed Pin|
IR Proximity Sensor
|IR Pin||mbed Pin|
|H-Bridge Pin||mbed Pin||Battery||Robot DC Motors|
|A01||Left PWR (red)|
|A02||Left GND (black)|
|B02||Right GND (black)|
|B01||Right PWR (red)|
|IR Pin||mbed Pin|
Please log in to post comments.