*As of 7/6/15, I'm still missing some of the assembly text. I will be finishing the Instructable shortly, in the meantime if you have any questions feel free to email me or leave a comment.
With this Instructable, you will be able to construct and code a versatile dual motor universal RC platform that utilizes an Arduino UNO board, L298 Dual H-Bridge, and Bluetooth control via an Android device. The result is a surprisingly quick and responsive platform with full directional capability. For simplicity, the supplied code only offers one speed capability. However, you will build the project with speed control in mind via Pulse Width Modulation (PWM) meaning the code can be modified later without additional hardware changes.
Recommended Free Android App: Arduino Bluetooth RC Car, Google Play
The chassis kit and all of the major components used can be found on Amazon using the links provided.
Step 1: Chassis Kit
I used a simple dual motor chassis kit straight from China and modified it to my liking. The motors and gearboxes seem to be durable for the price point and have no complaints running the 9.6 Volts being fed to them. Any dual motor chassis or DIY chassis will do, however you will not be able to follow along step by step.
Modifications I chose included mounting the gear boxes above the chassis to lower ground clearance and eliminating the supplied caster in favor of sliders I machined from Nylon round stock. Skipping these modifications will not alter the methods outlined in this Instructable.
*NOTE: I chose to trace the supplied chassis onto a piece of acrylic sheeting to create a top to mount and protect the components. If you do not wish to do this, you will either need to come up with alternative mounting methods or simply order two kits. Spare parts may not be a bad idea; it is China after all.
Step 2: Controller
It wouldn't be an Arduino project without an Arduino! Actually, any microcontroller that is compatible with the Arduino IDE and supports PWM and UART will do the trick, but to keep things simple I recommend the Arduino UNO R3.
Step 3: L298N Motor Drive Controller
You will need a dual H-bridge motor controller for this project. The L298N is a fantastic little board and the on-board 5v logic supply is perfect for powering your controller and Bluetooth receiver.
- Out 1: Motor A lead out
- Out 2: Motor A lead out
- Out 3: Motor B lead out
- Out 4: Motor B lead out
- 12v: +5-35v input
- GND: Ground
- 5v: +5v logic input/output (5v logic input with factory jumper removed, 5v supply output with factory jumper in place. Jumper will remain in place for our project)
- EnA: Enables PWM signal for Motor A
- In1: Enable Motor A
- IN2: Enable Motor A
- IN3: Enable Motor B
- IN4: Enable Motor B
- ENB: Enables PWM signal for Motor B
- Double H bridge Drive Chip: L298N
- Logical voltage: 5V*
- Drive voltage: 5V-35V
- Logical current: 0-36mA
- Drive current: 2A (MAX single bridge)
- Max power: 25W
- Dimensions: 43 x 43 x 26mm
- Weight: 26g
*Built-in 5v power supply, when the driving voltage is 7v-35v
Step 4: Bluetooth Module
A simple Bluetooth transceiver module is needed to establish a connection between the Arduino and Android device. I chose a HC-06 that defaults to 9600 baud; this module is capable of higher speeds however the default mode is plenty for what we're doing.
Concepts like Bluetooth can be confusing when you're new to Arduino, but it's actually very simple so try not to over think it when it comes time to code it.
Step 5: Power Supply
You will need a means of powering your project. This 9.6v battery/charger combo fits within the chassis nicely and has great run time for the price. I chose to add a charging pigtail so the battery can charged without removal. In hindsight, I should have installed an on/off switch as well. This may be something to consider for your project to avoid unplugging the battery connection when not in use.
Step 6: Android Device
You will need an Android device with Bluetooth and the ability to download the controller app linked in the introduction. I used my Samsung Galaxy S6 and had no issues connecting and staying connected to the car.
Step 7: Miscellaneous Materials
Step 8: Assemble The Chassis
As mentioned earlier, you will need to trace the acrylic chassis supplied with the kit and cut it out with a band band saw, or simply order two kits. A power drill and appropriate sized drill bits for the hardware you use are needed to mount the components and drill holes for the spacers that connect the two chassis halves.
Begin by assembling the chassis kit according to the supplied instructions (mine were in Chinese), or you can get creative and make some modifications (Increase/decrease ground clearance with motor placement, change the caster out for wheels or sliders, etc). I decreased ground clearance and machined nylon sliders. This works great for flat surfaces, but wouldn't be ideal for obstacles.
To mount the Arduino and motor controller, I used machine screws/nuts and cut small diameter polyurethane tubing for spacers to raise them up slightly.
To mount the battery and the Bluetooth module, I used the crude (but highly effective) method of drilled holes and cable ties.
The spacers I used between the top and bottom chassis halves are threaded pieces of metal to be used with machine screws and can be purchased at any hardware store. I used 6 total mounted around the perimeter of the chassis.
Lastly, solder the motor leads.
Step 9: Build Bluetooth and Motor Controller Harness
Start by building the harness that will supply power to and from the motor controller. Keep in mind that if the board supplied with +7-35v at the 12v terminal and the 5v jumper is left in place, the board will output +5v to the 5v terminal, so there is no need to power the motor controller off the +5v pin of the Arduino. Another thing to remember is that all of the grounds must be tied together for the logic to operate predictably.
Using the battery connectors, build a lead with the female connector going to the battery and the male end going to the back of the car for charging. You should have a set of leads jumped off the battery side connector that will supply your motor controller.
You will need a positive and negative cable to supply the Arduino with 5v and a strip of (4) cables to supply the Bluetooth module023
Cut the female ends from the
Step 10: Connect The Motor Controller
Step 11: Install The Top
Step 12: Pair Your Android Device
With the battery connected, the Bluetooth module should be blinking a red LED. Follow these steps to pair and connect your device:
- Turn Bluetooth "ON" in the device settings
- Scan for Bluetooth devices. Be sure your device is set to "Visible".
- Select "HC-06"
Once you successfully pair your device:
- Open the "Arduino Bluetooth RC Controller" app
- Bluetooth permission request: "Yes" if prompted.
- Touch the "Settings" button
- Touch "Connect"
When successfully connected, the blinking red LED on the module will become solid and the red display in the Android app will change to green.
Step 13: Upload The Code
If your Bluetooth module uses a different default baud rate, you will need to change it in the code before uploading it to your Arduino.
*NOTE: When uploading the code, be sure to disconnect the Rx and Tx pins from the Arduino or the upload will fail. The Arduino serial communicates on pins 0 and 1 and having the Bluetooth module connected simultaneously will prevent the code from uploading. Reconnect the pins after the upload is complete.
Step 14: Check Proper Operation
It's easy to mix up a wire or two when building a project like this, so don't be surprised if it only partially works (or not at all) on your first attempt.
If your project responds to commands sent from your Android device, great! Just verify the commands sent correspond with the operation of the motors (for example, the "Forward" button should make both motors spin full speed in the same direction). If a command doesn't match the operation (for example, the "Forward" button makes one motor turn clockwise and the other turn counterclockwise) you have a few options: