Bluetooth Controlled Wifi Monitoring Robot
Picture of board setup
Project Overview
This project allows the user to control the robot via bluetooth control which measures accelerometer data and pushes it to a http server. This robot also uses PID control in the backend to make the robot traverse a straight path.
Note
For further information on controlling a robot via wifi, please look at this guide here: https://developer.mbed.org/users/electromotivated/notebook/wifi-pid-redbot-robot-webserver/
Information
To setup your ESP8266 or configure it, please follow the guide here: https://developer.mbed.org/users/4180_1/notebook/using-the-esp8266-with-the-mbed-lpc1768/
Information
To configure your computer into a hotspot for Windows 10, please follow this guide here: http://lifehacker.com/turn-your-windows-10-computer-into-a-wi-fi-hotspot-1724762931
Pin Connections
mBed | ESP8266 |
---|---|
p26 | Reset |
p13 | Rx |
p14 | Tx |
Vcc -> 3.3v | |
GND -> gnd | |
mBed | Adafruit BLE |
GND -> gnd | |
VU (5v) | Vin |
nc | RTS |
GND | CTS |
p27 | TXO |
p28 | RXI |
mBed | LSM9DS1 |
GND | GND |
Vcc | VOUT |
p9 | SDA |
p10 | SCL |
mBed | TB6612 |
p24 | PWMA |
p17 | Ain2 |
p18 | Ain1 |
STBY -> 3.3v (100k ohm pull-up resistor) | |
p20 | Bin1 |
p19 | Bin2 |
p25 | PWMB |
AO1 -> Left Motor (+) | |
AO2 -> Left Motor (-) | |
BO2 -> Right Motor (+) | |
BO1 -> Right Motor (-) | |
VMOT -> 5v | |
Vcc -> 3.3v | |
GND -> gnd | |
mBed | Left Encoder |
p22 | Output |
Vcc -> 3.3v | |
GND -> gnd | |
mBed | Right Encoder |
p21 | Output |
Vcc -> 3.3v | |
GND -> gnd |
Setup
For initialization, the wifi module first connects to a hotspot via your computer which then runs the setup code to make an http server. After this, the code will initialize the accelerometer and then runs the main code logic. The main code logic listens for a bluetooth input and then sets the working setpoint variable which controls the speed to 50, which will move the robot until the set sample time is met. After the sample time is met, it turns off the setpoint (working_setpoint = 0) and finalizes the data by pushing it to the webserver.
Code
Import program4180_lab4_project
Bluetooth app controlled robot
Project Demo Video
As the robot is commanded to move, it collects acceleration data which then it uses a sampling average to calculate velocity. Since it does this, there is a likely change for error accumulation and so the velocity readings can get far off.
Please log in to post comments.