Bluetooth-controlled Robot with RFID switching mode

photo
Top view of the board

Description

This project allows a user to control a robot with an Android application via bluetooth and RFID technology.

The robot has 2 methods of movement: Controlled Mode and Automatic Mode:
- In Controlled Mode, the user has complete control of the direction the robot moves. Using the app, he chooses the direction of the robot using the arrows: forward, reverse, left, and right. There is no obstacle avoidance in this mode.
- In Automatic Mode, the robot moves autonomously, always going forward except to avoid obstacles with the help of the two IR sensors located at the front corners of the robot.

The MFRC522 RFID reader and tags and are used to switch from Controller Mode to Automatic Mode and vice versa. The robot’s default mode is Controller Mode. Waving the blue RFID tag over the RFID reader results in the robot switching to Automatic Mode. Likewise, waving the white tag over the reader results in the robot entering Controlled Mode.

The app also allows to control the speed of the robot, using the numerical buttons. Thus, in both modes we have four different speeds.

This document details the equipment, wiring, and code to create this project.



Presentation of the parts & Wiring

In this section we present the different parts we are using for this project. The overall schematic is shown on the next figure.

schema
Schematic of the project

DC motors & H-bridge

Two DC motors an a Toshiba’s TB6612FNG dual H-bridge are used.

Hbridge
Bottom view of the H-bridge

mbedDual H-BridgeDC motorsBattery
VinVmot+ (5V)
GNDGND-
Vout (3.3V)Vcc
p17AIN2
p18AIN1
p19BIN2
p20BIN1
p24PWMA
p25PWMB
Vout (3.3V)/STBY
A01Left-red
A02Left-black
B01Right-red
B02Right-black

IR sensors

Sharp GP2Y0A21YK IR proximity distance sensors are used to avoid obstacle in automatic mode.

IR
IR sensor

mbedSensor RightSensor Left
VU (5V)redred
GNDBlackBlack
P15Yellow
P16Yellow

Bluetooth chip

The bluetooth Adafruit Bluefruit LE UART Friend board and its associated Android app are used to communicate between the phone and the robot.

blue
Adafruit Bluefruit LE UART Friend

app
View of the Adafruit Bluefruit Android application

mbedAdafruit BLE
VU (5V)Vin
GNDGND
NCRTS
GNDCTS
P27 (serial RX)TXO
P28 (serial TX)RXI

RFID chip

RFID-RC522 reader with two tags are used to switch mode.

rfid
RFID-RC522 chip

mbedRFID Reader
Vout (3.3V)3.3V
GNDGND
P5MOSI
P6MISO
P7SCK
P8CS
NCIRQ

Hello World

Here are the steps for the demo:
1. Mini slide switch on Adafruit board set to "UART" (not "CMD")
2. Download the free "Adafruit Bluefruit BLE" App for your iOS or Android phone or tablet from the Apple App or Google Play store. (First time only)
3. Compile and Download the program below to your mbed.
4. Connect your smartphone's bluetooth to the chip and have fun!

Import programLab4_BluetoothRobot

Bluetooth-controlled Robot with RFID switching mode


Please log in to post comments.