Arduino Robot Car Bluetooth Controlled and Programmed With Android - Gladiator Chassis DFRobot
by bluino_electronics in Circuits > Arduino
12017 Views, 61 Favorites, 0 Comments
Arduino Robot Car Bluetooth Controlled and Programmed With Android - Gladiator Chassis DFRobot
![Arduino Robot Car Bluetooth Controlled and Programmed With Android - Gladiator Chassis DFRobot](/proxy/?url=https://content.instructables.com/FD7/HN2O/KADXJMHZ/FD7HN2OKADXJMHZ.jpg&filename=Arduino Robot Car Bluetooth Controlled and Programmed With Android - Gladiator Chassis DFRobot)
Making an Arduino robot car project is very fun, especially if you make it yourself and are supported by tutorials and tools that support quite complete.
This time we made the Arduino robot car main chassis is powered by the Black Gladiator tracked robot chassis, low noise, and easy to control, which could be a good partner for your tank-liked robots. This tracked chassis employs high-strength aluminum alloy base with delicate appearance, higher stability and longer durability.
Here are tutorials and videos that will guide you from beginning to end with an easy step of course.
Let's get started!
Part Requeriments
![Gladiator_Instructables_1.jpg](/proxy/?url=https://content.instructables.com/FK3/OZDV/KAB2MTBN/FK3OZDVKAB2MTBN.jpg&filename=Gladiator_Instructables_1.jpg)
- Black Gladiator - Tracked Robot Chassis (DFRobot)
- Arduino Uno
- Motor Shield Adafruit v1
- Bluetooth module HC-05
- Slide switch SPDT
- 4 Female Dupont cable 20cm
- 2 x Cable AWG24 18cm
- 2 x Cable AWG24 14cm
- 2 x Battery 18650 Li-ion 3.7V
- 2 x Spacers 10mm
- OTG adapter
Circuit Diagram
![DFRobot_schematic.jpg](/proxy/?url=https://content.instructables.com/FMS/UF7F/KAB2N0O6/FMSUF7FKAB2N0O6.jpg&filename=DFRobot_schematic.jpg)
Mount the Motors
![IMG_20200515_141556.jpg](/proxy/?url=https://content.instructables.com/FVR/YEEC/KAB2MTDC/FVRYEECKAB2MTDC.jpg&filename=IMG_20200515_141556.jpg)
![IMG_20200515_142330.jpg](/proxy/?url=https://content.instructables.com/F61/X7AH/KAB2MTDE/F61X7AHKAB2MTDE.jpg&filename=IMG_20200515_142330.jpg)
![IMG_20200515_143449.jpg](/proxy/?url=https://content.instructables.com/F04/8IY7/KAB2MTDH/F048IY7KAB2MTDH.jpg&filename=IMG_20200515_143449.jpg)
After soldering, you can use heat shrink tube onto the wire so that it covers and secure them futher. It also makes the wires easier to manage.
Mount the Motors into metal body chassis and tighten it with 3 M3*6 flat head screws.
Install the Drive Wheel
![IMG_20200515_144556.jpg](/proxy/?url=https://content.instructables.com/FJD/FZLZ/KAB2MTDQ/FJDFZLZKAB2MTDQ.jpg&filename=IMG_20200515_144556.jpg)
![IMG_20200515_144312.jpg](/proxy/?url=https://content.instructables.com/F2S/QF7G/KAB2MTDM/F2SQF7GKAB2MTDM.jpg&filename=IMG_20200515_144312.jpg)
![IMG_20200515_144838.jpg](/proxy/?url=https://content.instructables.com/FIB/HWKH/KAB2MTDU/FIBHWKHKAB2MTDU.jpg&filename=IMG_20200515_144838.jpg)
![IMG_20200515_145017.jpg](/proxy/?url=https://content.instructables.com/FNQ/Q0CO/KAB2MTEJ/FNQQ0COKAB2MTEJ.jpg&filename=IMG_20200515_145017.jpg)
![IMG_20200515_145252.jpg](/proxy/?url=https://content.instructables.com/FIH/AFCE/KAB2MTEL/FIHAFCEKAB2MTEL.jpg&filename=IMG_20200515_145252.jpg)
Firstly insert the coupling into shaft of motor and tighten with black screw; please note: the hole on the coupling must be aligned with the flat end of the motor shaft.
Install drive wheel into coupling, use the allen key to fit the M3*8 hex socket screw into the drive wheel and lock it with the coupling.
Repeat these steps to install the drive wheel on the other side.
Install Slave Wheel
![Gladiator_Instructables_6.jpg](/proxy/?url=https://content.instructables.com/FOT/KH3M/KAB2MTCK/FOTKH3MKAB2MTCK.jpg&filename=Gladiator_Instructables_6.jpg)
![Gladiator_Instructables_2.jpg](/proxy/?url=https://content.instructables.com/FTQ/JC1V/KAB2MTBO/FTQJC1VKAB2MTBO.jpg&filename=Gladiator_Instructables_2.jpg)
![IMG_20200516_095546.jpg](/proxy/?url=https://content.instructables.com/FTK/XVUD/KAB2MTM7/FTKXVUDKAB2MTM7.jpg&filename=IMG_20200516_095546.jpg)
![Gladiator_Instructables_3.jpg](/proxy/?url=https://content.instructables.com/FFV/3H5K/KAB2MTBP/FFV3H5KKAB2MTBP.jpg&filename=Gladiator_Instructables_3.jpg)
![IMG_20200515_152434.jpg](/proxy/?url=https://content.instructables.com/FRT/ZUXZ/KAB2MTEO/FRTZUXZKAB2MTEO.jpg&filename=IMG_20200515_152434.jpg)
First insert the M4*50 long screw into the slave wheel, and lock the other side with the M4 hex nut. Please provide a gap between the hex nut and the wheel, intended so that the wheel can rotate freely.
Insert the slave wheel assembly (long screw) to the outer side hole of body chassis, clamped with a ring washer and nut, then tighten it using a pass key or pliers.
When finished make sure the wheels can spin freely.
Repeat these steps to install the slave wheel on the other side.
Tracks
![Gladiator_Instructables_7.jpg](/proxy/?url=https://content.instructables.com/FU9/FYVM/KAB2MTCL/FU9FYVMKAB2MTCL.jpg&filename=Gladiator_Instructables_7.jpg)
![Gladiator_Instructables_5.jpg](/proxy/?url=https://content.instructables.com/FP6/NIKM/KAB2MTCJ/FP6NIKMKAB2MTCJ.jpg&filename=Gladiator_Instructables_5.jpg)
![IMG_20200515_153028.jpg](/proxy/?url=https://content.instructables.com/F41/NTGB/KAB2MTEV/F41NTGBKAB2MTEV.jpg&filename=IMG_20200515_153028.jpg)
![IMG_20200515_153959.jpg](/proxy/?url=https://content.instructables.com/F5L/VYEF/KAB2MTFF/F5LVYEFKAB2MTFF.jpg&filename=IMG_20200515_153959.jpg)
![IMG_20200515_153756.jpg](/proxy/?url=https://content.instructables.com/FP7/CWU8/KAB2MTF2/FP7CWU8KAB2MTF2.jpg&filename=IMG_20200515_153756.jpg)
Remove the track first by pressing using the needle, remove the excess part of the track (remove 4 track), and measure the required track length.
Embed the track pin into the track using pliers.
Install Battery Holder & Switch
![IMG_20200516_115420.jpg](/proxy/?url=https://content.instructables.com/F0Q/LG92/KAB2MTMF/F0QLG92KAB2MTMF.jpg&filename=IMG_20200516_115420.jpg)
![IMG_20200515_155747.jpg](/proxy/?url=https://content.instructables.com/F8O/ICVF/KAB2MTH0/F8OICVFKAB2MTH0.jpg&filename=IMG_20200515_155747.jpg)
![IMG_20200515_155827.jpg](/proxy/?url=https://content.instructables.com/FG5/YNT3/KAB2MTH4/FG5YNT3KAB2MTH4.jpg&filename=IMG_20200515_155827.jpg)
![IMG_20200515_161055.jpg](/proxy/?url=https://content.instructables.com/FSL/ACA8/KAB2MTHW/FSLACA8KAB2MTHW.jpg&filename=IMG_20200515_161055.jpg)
![IMG_20200515_161913.jpg](/proxy/?url=https://content.instructables.com/FW6/4R6P/KAB2MTIU/FW64R6PKAB2MTIU.jpg&filename=IMG_20200515_161913.jpg)
Cut the positive red cable then strip of the insulation off the end of each wire.
Glue the slide switch SPDT into battery holder.
Solder the positive red cable to two pin of slide switch.
Install battery holder into body metal chassis follow to the existing hole.
Install Arduino Board
![IMG_20200515_162449.jpg](/proxy/?url=https://content.instructables.com/FDW/B06U/KAB2MTJ6/FDWB06UKAB2MTJ6.jpg&filename=IMG_20200515_162449.jpg)
![IMG_20200515_162844.jpg](/proxy/?url=https://content.instructables.com/FN9/DWX3/KAB2MTJF/FN9DWX3KAB2MTJF.jpg&filename=IMG_20200515_162844.jpg)
Tighten the two spacer to the holes already in the metal body chassis, then screw the Arduino on them.
Add Bluetooth Into Motor Shield
![IMG_20200515_155704.jpg](/proxy/?url=https://content.instructables.com/FSB/NF7F/KAB2MTG8/FSBNF7FKAB2MTG8.jpg&filename=IMG_20200515_155704.jpg)
![IMG_20200515_155636.jpg](/proxy/?url=https://content.instructables.com/FAS/4P4Q/KAB2MTFU/FAS4P4QKAB2MTFU.jpg&filename=IMG_20200515_155636.jpg)
![IMG_20200516_103451.jpg](/proxy/?url=https://content.instructables.com/F7R/YWPZ/KAB2N3SA/F7RYWPZKAB2N3SA.jpg&filename=IMG_20200516_103451.jpg)
![Gladiator_Instructables_8.jpg](/proxy/?url=https://content.instructables.com/FZ4/P749/KAB2MTCM/FZ4P749KAB2MTCM.jpg&filename=Gladiator_Instructables_8.jpg)
![Gladiator_Instructables_9.jpg](/proxy/?url=https://content.instructables.com/FE0/2L9V/KAB2MTCN/FE02L9VKAB2MTCN.jpg&filename=Gladiator_Instructables_9.jpg)
Glue the Bluetooth module HC-05/HC-06 on the top of Motor Shield.
Connect the Dupont cable to pin of HC-05/HC-06, then cut the cable so that it remains about 6cm.
Connect and solder the cable between Bluetooth module HC-05/HC-06 and Motor Shield:
- VCC to 5V
- GND to GND
- RX to D1
- TX to D0
Install Motor Shield
![Gladiator_Instructables_4.jpg](/proxy/?url=https://content.instructables.com/FJR/6J1D/KAB2MTBU/FJR6J1DKAB2MTBU.jpg&filename=Gladiator_Instructables_4.jpg)
![IMG_20200515_164604.jpg](/proxy/?url=https://content.instructables.com/F0I/NEGX/KAB2N374/F0INEGXKAB2N374.jpg&filename=IMG_20200515_164604.jpg)
![IMG_20200516_090723.jpg](/proxy/?url=https://content.instructables.com/FOK/X6EZ/KAB2MTJQ/FOKX6EZKAB2MTJQ.jpg&filename=IMG_20200516_090723.jpg)
![IMG_20200516_091139.jpg](/proxy/?url=https://content.instructables.com/FBQ/TLWH/KAB2MTKS/FBQTLWHKAB2MTKS.jpg&filename=IMG_20200516_091139.jpg)
Push the Motor Shield carefully into Arduino, making sure all the pins go into header socket without missing and bending.
Insert and tighten the motor wires into the respective terminal. Please note: You do not connect the a motor to the two terminals M1 and M2, the correct is the "Right Motor" connect to M1 and the "Left Motor" connect to M2.
Install two 18650 battery into battery holder.
Programming Arduino Board
![IMG_20200516_112145.jpg](/proxy/?url=https://content.instructables.com/FOE/F4S2/KAB2MTMR/FOEF4S2KAB2MTMR.jpg&filename=IMG_20200516_112145.jpg)
![IMG_20200516_091209.jpg](/proxy/?url=https://content.instructables.com/FMZ/JIJG/KAB2MTLP/FMZJIJGKAB2MTLP.jpg&filename=IMG_20200516_091209.jpg)
![Gladiator_Instructables_11.jpg](/proxy/?url=https://content.instructables.com/FYA/5P1D/KADXKP2R/FYA5P1DKADXKP2R.jpg&filename=Gladiator_Instructables_11.jpg)
Last step is programming Arduino Uno board, you can upload code/firmware directly from your Android phone to Arduino Uno via USB OTG. First, get app and instal from Google Playstore the link app is below:
To upload code firmware you need disconnect the pin RX & TX that connected to bluetooth module HC-05/HC-06 or you can do with unplug Motor shield first, this mean to prevent error when process writing code to Arduino through pin D0 & D1 (RX & TX).
Open the app, then select menu Circuit Diagram & Code, in the Settings menu specify the parameters as follows:
- Motor Driver to be used : Adafruit Motor Shield V1
- Set Baud rate : 9600
- Upload firmware via : USB OTG
Then select Remote Control Mode menu. The last is tap Upload icon and wait moment until the process writing code is completed.
Arduino Sketch
If you use computer to upload sketch into Arduino Uno, copy and paste the code bellow to Arduino IDE and upload it.
/******************* Robot Remote Control Mode ********************/ // include the Adafruit motor v1 library #include <AFMotor.h> AF_DCMotor MotorFR(1); // Motor for drive Front Right on M1 AF_DCMotor MotorFL(2); // Motor for drive Front Left on M2 AF_DCMotor MotorBL(3); // Motor for drive Back Left on M3 AF_DCMotor MotorBR(4); // Motor for drive Back Right on M4 const int buzPin = 2; // set digital pin 2 as buzzer pin (use active buzzer) const int ledPin = A5; // set digital pin A5 as LED pin (use super bright LED) int valSpeed = 255; String readString; // declaring string void setup(){ Serial.begin(9600); // set up Serial library at 115200 bps Serial.println("*Robot Remote Control Mode*"); pinMode(buzPin, OUTPUT); // sets the buzzer pin as an Output pinMode(ledPin, OUTPUT); // sets the LED pin as an Output // Set the speed to start, from 0 (off) to 255 (max speed) MotorFL.setSpeed(valSpeed); MotorFR.setSpeed(valSpeed); MotorBL.setSpeed(valSpeed); MotorBR.setSpeed(valSpeed); // turn off motor MotorFL.run(RELEASE); MotorFR.run(RELEASE); MotorBL.run(RELEASE); MotorBR.run(RELEASE); } void loop() { while (Serial.available() > 0) { char command = Serial.read(); // gets one byte from serial buffer Serial.println(command); switch(command){ case 'F': // move forward SetSpeed(valSpeed); MotorFL.run(FORWARD); MotorFR.run(FORWARD); MotorBL.run(FORWARD); MotorBR.run(FORWARD); break; case 'B': // move backward SetSpeed(valSpeed); MotorFL.run(BACKWARD); MotorFR.run(BACKWARD); MotorBL.run(BACKWARD); MotorBR.run(BACKWARD); break; case 'R': // turn right SetSpeed(valSpeed); MotorFL.run(FORWARD); MotorFR.run(BACKWARD); MotorBL.run(FORWARD); MotorBR.run(BACKWARD); break; case 'L': // turn left SetSpeed(valSpeed); MotorFL.run(BACKWARD); MotorFR.run(FORWARD); MotorBL.run(BACKWARD); MotorBR.run(FORWARD); break; case 'G': // forward left MotorFL.setSpeed(valSpeed/4); MotorBL.setSpeed(valSpeed/4); MotorFL.run(FORWARD); MotorFR.run(FORWARD); MotorBL.run(FORWARD); MotorBR.run(FORWARD); break; case 'H': // backward left MotorFL.setSpeed(valSpeed/4); MotorBL.setSpeed(valSpeed/4); MotorFL.run(BACKWARD); MotorFR.run(BACKWARD); MotorBL.run(BACKWARD); MotorBR.run(BACKWARD); break; case 'I': // forward right MotorFR.setSpeed(valSpeed/4); MotorBR.setSpeed(valSpeed/4); MotorFL.run(FORWARD); MotorFR.run(FORWARD); MotorBL.run(FORWARD); MotorBR.run(FORWARD); break; case 'J': // backward right MotorFR.setSpeed(valSpeed/4); MotorBR.setSpeed(valSpeed/4); MotorFL.run(BACKWARD); MotorFR.run(BACKWARD); MotorBL.run(BACKWARD); MotorBR.run(BACKWARD); break; case 'S': // stop MotorFL.run(RELEASE); MotorFR.run(RELEASE); MotorBL.run(RELEASE); MotorBR.run(RELEASE); break; case 'V': // beep buzzer digitalWrite(buzPin, HIGH); delay(150); digitalWrite(buzPin, LOW); delay(100); digitalWrite(buzPin, HIGH); delay(250); digitalWrite(buzPin, LOW); break; case 'W': // turn light on digitalWrite(ledPin, HIGH); break; case 'w': // turn light off digitalWrite(ledPin, LOW); break; case '0': // set speed motor to 0 (min) SetSpeed(0); break; case '1': // set speed motor to 30 SetSpeed(30); break; case '2': // set speed motor to 55 SetSpeed(55); break; case '3': // set speed motor to 80 SetSpeed(80); break; case '4': // set speed motor to 105 SetSpeed(105); break; case '5': // set speed motor to 130 SetSpeed(130); break; case '6': // set speed motor to 155 SetSpeed(155); break; case '7': // set speed motor to 180 SetSpeed(180); break; case '8': // set speed motor to 205 SetSpeed(205); break; case '9': // set speed motor to 230 SetSpeed(230); break; case 'q': // set speed motor to 255 (max) SetSpeed(255); break; } } } // function for setting speed of motors void SetSpeed(int val){ valSpeed = val; MotorFL.setSpeed(val); MotorFR.setSpeed(val); MotorBL.setSpeed(val); MotorBR.setSpeed(val); }<br>
Enjoy
Hopefully you enjoy it. If you do and done, please share "I Made it!" to let me know how much is worked. Share the link, like and subscribe. As always, if you have any questions please let me know!