Collision Avoidance Robot with Bluetooth Controller

Authors

Andres Rodriguez and David Prina

Objective

The objective of this project is to control a robot vehicle using a custom designed controller. Both the Robot and Controller are powered by the MBED LPC1768 and connected by two HC-05 Bluetooth Modules. The Robot using an ultrasonic sensor to detect obstacles within 250 mm of its front. The Bluetooth Communication uses a protocol similar to the "Stop-And-Wait ARQ" Flow Control Protocol when sending distance readings and acknowledgements back and forth between the vehicle and controller during the Collision Avoidance routine.

Parts List

  • Robot
    • Shadow Robot Kit
    • mBed LPC1768
    • HC-05 Bluetooth Module
    • H-Bridge Motor Drive
    • Reversible DC Motor (x2)
    • HC-SR04 Ultrasonic Sensor
    • Ambient Light Sensor
    • Headlights (Breadboard LEDs)
    • Barrel Jack Adapters (x2)
    • Battery Packs (x2)
      • AA Batteries (x8)
    • Duct Tape
    • Breadboards (x2)
  • Controller
    • mBed LPC1768
    • HC-05 Bluetooth Module
    • uLCD-144-G2 128x128 Smart Color LCD
    • Sparkfun Analog Joystick
    • Breadboard Speaker
    • Mini USB Cable
      • Either a battery pack or PC for power

Assembly

This video explains how to assemble the shadow robot kit.

Wiring

Controller

HC-05 Bluetooth Module:
The Bluetooth Module is used to communicate with the robot. Joystick readings are sent until the collision protocol is entered, at which point the robot sends distance readings describing its surroundings and the controller sends acknowledgements back to indicate the readings were received and processed.

mBedHC-05
p9RX
p10TX
+5VVCC
GNDGND
GNDEN

uLCD:
The LCD screen is used to draw the radar view of the robots surroundings upon entering the collision protocol.

mBeduLCD
p28RX
p27TX
+5VVCC
GNDGND
p11RES

Analog Joystick:
The joystick contains two potentiometers which are used to control the robots movements.

mBedJoystick
p15Vert
p16Horz
Vout (3.3v)VCC
GNDGND
p17SEL

Robot

HC-05 Bluetooth Module:
The Bluetooth Module is used to communicate with the robot. Joystick readings are sent until the collision protocol is entered, at which point the robot sends distance readings describing its surroundings and the controller sends acknowledgements back to indicate the readings were received and processed.

mBedHC-05
p9RX
p10TX
+5VVCC
GNDGND
GNDEN

Reversible DC Motors:
Used to move the robot.

DC MotorsH-Bridge DrivermBed
+ (Left)A01
- (Left)A02
+ (Right)B01
- (Right)B02
PWMAp21
PWMBp22
AIN1p15
AIN2p16
BIN1p17
BIN2p19
GND (ALL 3 )GND
VCCVout (+3.3v)
STBYVout (+3.3v)
VM+5v (Battery Pack)

HC-SR04 Ultrasonic Sensor:
The Ultrasonic Sensor is used to control the collision avoidance protocol and to read in radar data to be sent back to the controller over Bluetooth.

HC-SR04mBed
Trigp5
Echop6
VCC+5v (Battery Pack)
GNDGND

Automatic Headlights:

Light SensormBedHeadlights
VccVout (+3.3v)
GNDGND-
Sigp20
p30+

Code

AT Command Setup Code:
Use this code to send AT Commands to the HC-05 Bluetooth Modules. See this arduino tutorial for the commands to configure both the master and slave HC-05. https://howtomechatronics.com/tutorials/arduino/how-to-configure-pair-two-hc-05-bluetooth-module-master-slave-commands/
(NOTE: The ENABLE pin must be wired to high to enter Command Mode on the HC-05s. After they are configured, the pin should be wired to ground)

Import programHC05_AT_mode

This program send an AT command to the HC05 module and shows the response into a terminal.

Controller Code:

Import programCollision_Avoidance_Robot-Controller

Controller code for Collision Avoidance Robot with Radar Imaging (Co-Developers: Andres Rodriguez and David Prina)

Robot Code:

Import programCollision_Avoidance_Robot-Car

Vehicle code for Collision Avoidance Robot with Radar Imaging (Co-Developers: Andres Rodriguez and David Prina)

Demo Video


Please log in to post comments.