Arduino Bluetooth Controlled Multi-modal Robotic Car (Android and iOS Compatible)

From ArduinoInfo
Revision as of 17:52, 25 September 2019 by Kufy (talk | contribs)

Jump to: navigation, search

Introduction

The Arduino micro-controller is capable of running only one sketch at a time. Therefore, it is generally thought that the Arduino can only perform one task or achieve one objective per-sketch. This project shows the implementation of a multi-modal bluetooth controlled robotic car, capable of achieving different tasks and objectives, and is controlled with an Android or iOS mobile application. Everything happens in real-time, with little to no delay.

Specifications

The communication with the robot is made possible via Serial-over-Bluetooth protocol. A bluetooth module is connected to the Arduino compatible board, and the mobile phone which the application has been installed on can connect to the bluetooth module.

This robot has been built to have 5 modes:

  1. Line-follower Mode
  2. Object-follower Mode
  3. Light-follower Mode
  4. Ramble Mode
  5. Manual-control Mode

Hardware Components

  1. HM10 Bluetooth Module x 1
  2. Yourduino RoboRed Board x 1
  3. MOTOR DRIVER (? Which version?)
  4. Line Tracker Sensor x 1
  5. Photo-resistor x 1
  6. Buzzer x 1
  7. Ultrasonic sensor x 1
  8. Motor driver x 1
  9. Geared DC motors x 2
  10. Micro servo motor kit x 1
  11. Robot car chassis with 2 wheels x 1

Configuring the HM10 BLE 4 Module

The HM10 module was chosen for this project due to it's compatibility with the common BLE 4.0 (Bluetooth Low Energy) protocol, used on Apple Iphones as well as Android phones. Before the module can be used, the baudrate, device name, and preferred pin have to be set. Below are steps for setting up the HM10 Module using the RoboRED board:

  1. The schematic of Arduino shows that the RX and TX pins are connected to the FTDI chip (on Arduino board as pin 0 and pin 1), which means that those pins to directly access the FTDI chip itself. We generally use TX and RX pins for communication. Upload the empty sketch below to the RoboRED board in order to enable it serve as USB-TTL converter for communicating with the HM10 module:
    void setup() {
    }
    
    void loop() {
    }
    
  2. Connect RoboRED-Tx --> HM10-Tx and RoboRED-Rx --> HM10-Rx (i.e. Tx --> Tx and Rx --> Rx of each board)
  3. Plug in the RoboRED's USB to the PC and open the Arduino IDE
  4. Open the Serial Monitor and set the baudrate to 9600
  5. Type AT and press enter. If the response is OK, then the module is ready to be configured using AT commands
  6. Type AT+VERR? command to check the firmware version that runs on your HM10 module. V5** and above is good
  7. Type AT+NAME? to see current name of the module, otherwise, type AT+NAMEpreferredName to set a preferred Bluetooth name for the module. Kindly note that there should be NO space between the AT+NAME and the preferredName chosen
  8. Next, set the passcode that would be required for connecting to the module; AT+PASSpreferredPasscode. The preferred passcode must be 6 numbers. To check the passcode, use AT+PASS?
  9. The HM10 module is configured to connect without passcode (i.e. AT+TYPE0). Set it to request a passcode on pairing by using this command: AT+TYPE2

The module is now configured and ready to be used. To save your settings, use AT+RESET in other to save and reset the module