Bluetooth-controlled Robot with RFID switching mode
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.
DC motors & H-bridge
Two DC motors an a Toshiba’s TB6612FNG dual H-bridge are used.
mbed | Dual H-Bridge | DC motors | Battery |
---|---|---|---|
Vin | Vmot | + (5V) | |
GND | GND | - | |
Vout (3.3V) | Vcc | ||
p17 | AIN2 | ||
p18 | AIN1 | ||
p19 | BIN2 | ||
p20 | BIN1 | ||
p24 | PWMA | ||
p25 | PWMB | ||
Vout (3.3V) | /STBY | ||
A01 | Left-red | ||
A02 | Left-black | ||
B01 | Right-red | ||
B02 | Right-black |
IR sensors
Sharp GP2Y0A21YK IR proximity distance sensors are used to avoid obstacle in automatic mode.
mbed | Sensor Right | Sensor Left |
---|---|---|
VU (5V) | red | red |
GND | Black | Black |
P15 | Yellow | |
P16 | Yellow |
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.
Adafruit Bluefruit LE UART Friend
View of the Adafruit Bluefruit Android application
mbed | Adafruit BLE |
---|---|
VU (5V) | Vin |
GND | GND |
NC | RTS |
GND | CTS |
P27 (serial RX) | TXO |
P28 (serial TX) | RXI |
RFID chip
RFID-RC522 reader with two tags are used to switch mode.
mbed | RFID Reader |
---|---|
Vout (3.3V) | 3.3V |
GND | GND |
P5 | MOSI |
P6 | MISO |
P7 | SCK |
P8 | CS |
NC | IRQ |
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.