Introduction: Mecanum Wheel Robot - Bluetooth Controlled
Since I can remember I always wanted to build a mecanum wheel robot. The mecanum wheel robotic platforms available on the market were a little too expensive for me so I decided to build my robot from scratch.
Like no other robot meacanum wheel robot can move across without any difficulty. This feature makes it unique and allows for easy maneuvering in tight spaces without the need to rotate in place.
Well, it's time to get down to work!
Parts needed in this project:
- Arduino Mega 2560 x1
- TB6612FNG Dual Motor Driver Carrier x2
- HC-06 bluetooth module or similar x1
- Breadboard (min size) x1
- Li-Po batteries: 7.4V 1800 mAh and 11.1V 3000 mAh x1
- SKYRC iMAX B6 Mini battery charger x1
- DC motor 12V x4
- Mecanum wheel x4
- Jumpers and cables
- Nuts and bolts
- Chassis made of plastic
Step 1: Building Robot Chassis
The first thing to do was to cut a piece of plastic plate (153x260 mm). In the next step I screwed the dc motors placed in a metal tube to the plastic base. Instead of 2 metal tubes you can also use 4 metal holders for dc motors. The last step in robot chassis construction was fitting the wheels.
Step 2: Fitting the Mecanum Wheels
Mecanum wheels should be fitted in the correct way. A correct configuration requires each of four mecanum wheels is set in the way as shown in above picture. The rotation axis of each wheel's top roller should cross the center of the robot chassis (point C).
Step 3: Connection of Electronic Parts
The brain of the system is Arduino Mega 2560. As a motor driver I used two TB6612FNG dual motor driver carriers. This motor controller has sufficient range of acceptable input voltages (4.5V to 13.5V) and continuous output current (1A per channel). Robot is controlled via bluetooth using Android application. In this project I used a popular inexpensive bluetooth module HC-06. The electronic system is equipped with two power sources. One for supplying the DC motors (LiPo battery 11.1V, 1300 mAh) and the other to supply Arduino and bluetooth module (LiPo battery 7.4V, 1800 mAh).
All connections of electronic modules are the following:
- Bluetooth (e.g HC-06)-> Arduino Mega 2560
- TXD - RX1 (19)
- RXD - TX1 (18)
- VCC - 5V
- GND - GND
- TB6612FNG Dual Motor Driver -> Arduino Mega 2560
- RightFrontMotor_PWMA - 2
- LeftFrontMotor_PWMB - 3
- RightRearMotor_PWMA - 4
- LeftRearMotor_PWMB - 5
- RightFrontMotor_AIN1 - 22
- RightFrontMotor_AIN2 - 23
- LeftFrontMotor_BIN1 - 24
- LeftFrontMotor_BIN2 - 25
- RightRearMotor_AIN1 - 26
- RightRearMotor_AIN2 - 27
- LeftRearMotor_BIN1 - 28
- LeftRearMotor_BIN2 - 29
- STBY - Vcc
- VMOT - motor voltage (4.5 to 13.5 V) - 11.1V from LiPo battery
- Vcc - logic voltage (2.7 to 5.5) - 5V from Arduino
- GND - GND
- TB6612FNG Dual Motor Driver -> DC Motors
- MotorDriver1_A01 - RightFrontMotor
- MotorDriver1_A02 - RightFrontMotor
- MotorDriver1_B01 - LeftFrontMotor
- MotorDriver1_B02 - LeftFrontMotor
- MotorDriver2_A01 - RightRearMotor
- MotorDriver2_A02 - RightRearMotor
- MotorDriver2_B01 - LeftRearMotor
- MotorDriver2_B02 - LeftRearMotor
Step 4: Arduino Mega Code
The full code for this project is available at GitHub: link
The Arduino program checks in the main loop - "void loop()" whether the new command (character) has been sent from Android app via bluetooth. If there is any incoming character from bluetooth serial the program starts execution of "void processInput() " function. Then from this function depending on the character a specific direction control function is called (e.g. for "r" character function "void moveRight(int mspeed)" is called). From a given direction control function each motor is set to the desired speed and direction of rotation by function "void motorControl" so that the robot move in the desired direction.
You can also use my other code example for Arduino Mega 2560 that allows you to control a mecanum wheel robot using voice commands: link. Additionally you will need to download BT Voice Control for Arduino app from Google Play.
Step 5: Control of the Mecanum Wheel Robot
Every mecanum wheel has free rollers, which make a 45 degree angle with the wheel's axis. This wheel design allows robot to move in any direction as shown in above figure. The blue and green arrows show the direction of the friction forces acting on each mecanum wheel. By moving all four wheels in the same direction we can get forward or backward movement. Controlling the two wheels on one diagonal in the same direction and other two wheels in the opposite direction we get sideways movement as shown in the second figure (move right).
You can download my Android app that allows you to control mecanum wheel robot from Google Play: link
How to use the Android app:
- tap menu button or 3 vertical dots (depending on the version of your Android)
- select the tab "Connect a device"
- tap on the "HC-06" tab and after a while you should see the message "Connected to HC-06"
- after connecting, you can control your robot
- if you don't see your bluetooth device HC-06 tap "Scan for devices" button
- on the first use pair your bluetooth devices by entering the default code "1234"
If you would like to see my other projects related to robotics please visit: