Introduction: Speed Controlled RC CAR Using (4 CH Motor Driver Controller + Arduino + Bluetooth)
Hi, As this is my first instructable here, I hope you'll like it and feel free to ask about anything not clear in it.
Firstly, I started this project after I wanted to control 4 Motors that requires relatively high power (12Volts, 4 Amperes) for each.
After searching for a good shield to supply the motors with the required power, I found this one "4 Channel Motors Driver Controller". I wanted to buy it but I didn't find any simple tutorial for how to use it with Arduino. So I decided to read its datasheet and configure how I will use it with Arduino.
Finally, I bought the board and It worked fine. So I decided to write this instructable to ease the process for the next users of the same board. In addition, just to prove the concept, I made a small hardware project which is an RC Car using ARDUINO + BLUETOOTH + 4CH MOTOR DRIVER CONTROLLER.
Step 1: Getting Started With the Driver Board + Arduino
This board can be controlled in many ways. Here, I will focus only on using it with Arduino.
Pins that are surrounded by red rectangle will be connected to the Arduino Board.
On the top, you will find VCC & GND pins. Connect the VCC with 5V pin on your arduino and the GND pin with the GND pin on your arduino also.
On the left, there are 4 Channel Input pins (One for each motor). Each channel has 4 pins (GND - PWM - DIRECTION - CURRENT).
GND pin should be connected to your arduino GND.
PWM pin is used to control the speed of motor, it should be connected to a digital pin that supports PWM output; for arduino uno (pin 3, 5, 6, 9, 10, 11).
DIRECTION pin is used to determine the direction of motor, for example (when this pin is HIGH, the motor rotates in a specific direction. when it's LOW, the motor rotates in its opposite direction). This pin should be connected to any digital pin on the arduino board.
On the bottom, you will find the Input Power Terminals for the Motors themselves (MAX 12V , 4A).
Step 2: Required Materials and Components
1- Arduino UNO R3 (or any other arduino board).
2- Bluetooth Module ( HC-05 )
3- 4 Channel Motors Driver Controller
4- 1 Kohm Resistor
5- 2 Kohm Resistor
6- Battery (I used 8Volts & 800mA , you can use any battery depending on your motors but keep on mind to be more than 7 Volts and less than or equal 12 Volts).
7- Male-Male & Female-Male Jumper Wires
8- Small Breadboard.
9- DC Jack Power Cord
10- Crocodile Wires
11- Screw Driver
12- Car Body (With 2 Motors)
13- Laptop or PC for Coding.
Step 3: Connect the DC Power Cord With the Battery Terminals.
Don't Isolate the wires after connecting them.
Step 4: Connect the Uncovered Terminals (from the Previous Step) to the Driver Board.
That's why I said we will not isolate the wires, as we will connect them directly to the board.
Put the Positive terminal of the battery in the 'Vbatt' input terminal in the Motor Driver Controller Board.
Put the Negative terminal of the battery to the "GND" input terminal in the board.
Step 5: Connecting Data Cables
Get 6 Male-Female jumper wires.
Use 3 Color codes to differentiate between them. I used (Orange - Yellow - Black).
The Orange is for DIRECTION pin, Yellow is for PWM pin and the Black is for GND pin.
Connect them as they appear in the photos.
CH4 DIR -> Arduino pin (8)
CH4 PWM -> Arduino pin (9)
CH1 DIR -> Arduino pin (10)
CH1 PWM -> Arduino pin (11)
Connect the CH4 GND & CH1 GND together in the GND terminal in the same board as in the photo..
Finally, Get 2 Male-Male Jumper Wires,
Connect VCC pin on the Driver board to Arduino pin (5V) and the GND pin on the Driver Board to Arduino pin (GND).
Step 6: Connecting Bluetooth Module (HC-05)
First, you should put the (1Kohm and 2Kohm) resistors on the breadboard and connect them as in the picture.
Then connect the Rx pin from the blueetoth Module to the Node connecting 1Kohm and 2Kohm.
Connect the 1Kohm second terminal to the TX pin on the Arduino board.
Connect the TX pin from the bluetooth Module to the RX pin on the Arduino board.
Connect GND to GND on Arduino and VCC to 5V pin on the Arduino also.
Step 7: Connecting Motors
Using 4 Crocodile Wires.
Connect each 2 of them to a motor.
Prepare the car surface well because we will put our circuits on it.
Step 8: ASSEMBLY
Connect each two crocodile wires of a motor to the corresponding Motor Output (CH1 & CH2)
Assemble everything together and mount the boards and batteries on the car's surface as in the photo.
Step 9: NOW, It's Time for Some Coding ;)
I attached the arduino code file. The program simply receives data from your mobile over bluetooth.
You can move the car Forward, Backward, Right and Left.
You can also control its speed from your mobile easily and you will see how in the next step.
1- Download the code file.
2- Open it on Arduino IDE
3- Connect the USB Cable to your arduino
4- Press "Upload Button" or press "Ctrl + U" to upload the Code to the board.
Step 10: Turn on Your Car.
Remove the USB cable.
Connect the DC power cord to the arduino to turn on your car.
Step 11: Configuring Mobile Controller
I used this application "Arduino Bluetooth Controller" and I wrote the code depending on that application.
1. Download "Arduino Bluetooth Controller" from the playstore.
2. Turn On your bluetooth and Open your bluetooth settings on your android.
3. Search for new devices until you find "HC-05", pair with it.
4. Enter password "0000" or "1234" if requested.
5. Open the application "Arduino Bluetooth Controller" , on some devices you will find its name "Arduino RC".
6. Press "Proceed", Choose "HC-05" from the list that will appear.
7. After getting connected, Press "Controller Mode".
8. Open the menu, choose "Set Commands"
9. Press on "UP ARROW:=***" and set the new Value to "0"
10, Repeat step "9" for each command and set them from 1 to 5 respectively until the "CROSS BUTTON".
11. Once you finish setting the new values, return back to the Controller Mode.
Step 12: Finally, Your Car Is Ready Now!!
It's time to see your car moving ;) !
Use the Controllers on your mobile to move the car as you want.
I hope that everything is clear and easy to you. If you have any comments, questions or improvements, It will be very much appreciated :)
Mahmoud Mohamed Morsy,
We have a be nice policy.
Please be positive and constructive.