Introduction: Bluetooth RC Drone Car
If Apple made a car, would it have Windows? We don't know, but we know this Instructable is wheely cool! ;)
Hello Guys! We are Mary and Rain, two students in Ms. Berbawy's Robotics class at Irvington High School.
This Instructable is for our SIDE project in this class. In this project, we took a car built for the Science Olympiad Division C Electric Vehicle build event and modified it into an RC car that can be controlled via a phone application and take pictures/videos like a land drone. Although we also built the car ourselves and will show you the general steps of how it was done, this Instructable is more focused on the controller and electronics aspect, which we hope can be implemented to your own car designs (better than ours?).
We hope you enjoy this Instructable and feel free to give any suggestions as it is our first Instructable! :)
Step 1: Materials
These are the components you need to build the car. The cost can vary greatly depending on what parts you have and what you choose to use for the optional parts:
Lego Mindstorms/EV3/Technic Kit (for the body)--$350
Arduino NANO Microcontroller--$7.99
Two 3.7v 850mAh Li-Po Batteries + Charger (or 9v battery or other power source of your choice)--$20.50
Tamiya 4-speed Double Gearbox (includes 2 DC motors)--$10.48
HC-05 Bluetooth Module--$7.99
Small 3-wire Camera Module--$12.89
Any Reflective IR Sensor (optional for speedometer)--$6.50
On/off toggle switch (5 pack)--$5.16
Heat shrink tubing--$8.99
Other materials: balloons, cardboard, rubber bands/zip ties, tape, plastic sheet, an Android Phone
Step 2: Equipment
The equipment you need to complete the project:
Solder and soldering iron
Hot glue gun
A computer with the Arduino software
Mini USB cable to upload code
3D printer and PLA
Step 3: Building Car Body
Any small RC-like car body would work quite well with this tutorial. We built our car body with a Lego Mindstorms kit. There are tutorials/instructions available that you can adapt to your own model. We also attached some pictures of our car if you would like to try and copy it. It is a 2-wheel rear drive with no front steering. Here is another possible tutorial.
You can build the body with other things also, like wood, or even modify an old toy car body. Just make sure you have lots of free space in the center of the car to attach all the necessary components.
Step 4: Adding Motors
At first, we tried to adapt simple DC motors with the Lego pieces and some plastic gears. This proved very difficult because the Lego did not provide the proper dimensions to hold the motors snugly in place.
Instead, we found a motor gearing kit (the Tamiya double gearbox kit) that was affordable and very easy to assemble. It also comes with 2 DC motors. Here are the assembly directions.
There are 4 gear ratios available. We decided to use the 2nd fastest one, which is 38.2:1.
After assembling the gearbox, solder wires onto the DC motors before inserting them into the plastic case. We recommend heat shrinking the end where the wire attaches to the motor because it can break easily.
We attached the gearbox onto our Lego base by using the provided screws to screw it onto a small piece of cardboard. Then, we hot glued the cardboard onto the end of the base. Poking some of those black Lego pegs through the cardboard can help secure it.
Step 5: 3D Printing Wheels
The axles of the Tamiya motor gearbox are hexagonal, so you can't attach regular Lego wheels. We decided to make our own wheels that are customized with 3D printing. We designed the wheel using Solidworks software and have attached the STL file below. When we first printed the wheels, we didn't realize that the gearbox's axles are too short for the width of our car body, so we had to print extension hubs as well and hot glued them together. We have modified the attached STL file so you can print it out as one piece. The fit should be snug so no adhesives are required.
Maker Bot Replicator 2
Step 6: Wiring the Board
After the base of the car and the wheels are complete, it's time to wire all the components together!
We simply used an Ardunio Nano placed on a small breadboard to save space. To control the DC motors, we got the Dual TB6612FNG Motor Driver from Sparkfun. Here are the details of how to wire it up to your Arduino.
Plug the 2 ends of each of your DC motors into the A01, A02 and the B01, B02 pins. Refer to the pictures above to see how we plugged it in specifically. We extended the GND and VIN pins to the 2 vertical rows on the breadboard in order to have more space. Ignore the yellow button as it is useless for this Instructable.
Optional: If you want to include a speedometer or distance counter feature to your car, now is the time to hookup your IR sensor as well. Plug GND to GND, 5V to VIN (or 5V on Arduino), and the digital pin to pin D10 on the Arduino.
You also need the pinstripe pattern taped onto the inside of either back wheel, because this is what the IR sensor will use to count the number of rotations. You can print out the attached file if you also used our 3D wheel design, or resize it for your specific wheel.
Place and somehow secure (hot glue) the IR sensor so that it is a few millimeters away from the pinstripe pattern and aligned. This provides for the most accurate readings.
Step 7: Adding Bluetooth
Now, take your HC-05 (or HC-06 or anything else similar) Bluetooth module and wire it to the Arduino. This will be how the car will communicate with the phone app and be controlled. Make sure the BAUD rate is set to 9600, which it should be by default if you just bought it.
Wire GND to GND, 5V to 5V, TX to RX, and RX to TX.
Secure the module onto a relatively prominent place on your car body so you can get good signal when controlling it. The range for these modules is about 10 meters.
Step 8: Adding the Camera
You can use a small drone camera or some small keychain spy camera for your car. These are convenient to use since the SD card is part of the module and there are only 3 wires. This step is technically optional if you don't want a video/camera feature for your car.
The drone/keychain camera likely comes with 3 wires on a small white plug. Cut the plug off and solder 3 separate wires you can plug into the breadboard with. Heat shrink or electrical tape the connections for insulation and prevent breakage.
The black wire of the camera is ground, so wire that to GND on the Arduino. Red wire is positive; wire that to 5V pin. Finally, white wire is the trigger pin; wire that to D13 of the Arduino.
Put the camera in the front of the car tilted upward at about 30 degree angle. Then, stabilize the camera with rubber bands, zip ties, or tape. Make sure the SD card slot is still easily accessible.
Step 9: Battery and Power Switch
Since this car was originally for a SciOly competition, we needed speed. To power the vehicle, we connected 2 3.7V lipo batteries in series. This gave it lots of speed and it can run for a long time, but you can replace that with a 9V battery or 4 AA batteries too.
We put the batteries in a spare VEX 9V backup battery holder which we attached onto our car body. You can make a holder with Lego, or make any other slot to hold the batteries down.
An on/off switch is not required, as you can just plug one end of the battery into the appropriate spot on the breadboard when you want it turned on. However, we learned the hard way that it is highly recommended so you don't accidentally burn some components or shock yourself.
Add some extension wires from the positive end of your battery and the VIN of the Arduino. Plug the negative end of the battery into GND. The on/off switch should have 3 pins. Solder the VIN extension wire to the middle pin and the battery's positive extension wire to either the left or right pin. Flicking the switch in that direction would turn on your car.
Attach the on/off switch onto your car body someplace with some hot glue or zip ties and hold down any loose wires with zip ties too so you have clean wiring.
Congrats! You've now finished the hardware portion of your car! Almost done!!
Step 10: Programming the Car
The Arduino code for the car is attached below. We utilized the structure of the code provided by kas_dev on this forum so it is compatible with the controller app.
Make sure you have the TB6612FNG Arduino Library from Sparkfun downloaded onto your computer. Otherwise your code won't compile.
In the Arduino IDE, change the board type to Arduino Nano and make sure you have selected the correct COM port. Then, compile and upload the code with the USB cable.
Note: Unplug the TX and RX of the Bluetooth module before you upload the code, otherwise it will interfere and cause an error.
Depending on how you plugged in your motors, you may need to reverse them so they run in the right direction. Find the lines
const int offsetA = -1;
const int offsetB = 1;
and change variable to 1 or -1 accordingly.
Step 11: Configuring Phone App
The app we used was the Joystick Bluetooth Commander, which can be downloaded from Google Play.
It will work on any Android device with a Bluetooth connection.
In the settings > options of the app, configure the buttons so they match the screenshot above. The joystick constraint is the box. Now, turn on your car. A light on the Ardunio should be flashing, and a red light on the Bluetooth module should flash as well.
Click connect on the app, and it will search for the Bluetooth of the car, which should be called "HC-05'. The first time you connect, you will need to enter a pin, which is usually 1234 or 0000.
Green letters on the bottom left corner should now say BT connected. You're all set! Drag the joystick around and you should see your car move accordingly. Press the video button to start the video, press again to stop it. A red light on the camera will turn on when the video is recording.
Videos/photos can be viewed from the SD card.
Step 12: Testing
Congrats! You have finished your Bluetooth RC drone car! Have fun driving it around your neighborhood or living room and record some dope videos. :)
Here is a sample video of our car in action as well as the actual camera footage. As you can see, the video is little bit to shaky since the ground is not smooth and the camera quality isn't great. Adding some sort of suspension or shock absorption material can help stabilize the video.
Step 13: Finishing Touches :)
In order to increase the friction of the wheels and make it easier to control, we cut balloons and wrapped them on the four wheels.
Also, to prevent the wiring from being damaged, we made a plastic cover for the center of our car. To do this, we found a flat, clear plastic sheet and cut it out from a snack box. Measure and cut the sheet to the desired length. Then, measure the width of your car and leave equal spacing on either end of the sheet. Cut lightly along these 2 lines so you can bend the plastic into a U-shape. Drill several holes on the 2 ends and poke several Lego pegs through them to secure the cover on your car body. Cut out a large hole for the on/off switch.
We also 3D-printed a mini license plate with our school name on the back of our car. Here is the Tinkercad file so you can easily modify it with your own letters/designs.
Step 14: Complete Car and Future Improvements
As you can see, doing point turns on this car is very difficult because it only has 2-wheel back drive and no front steering. This can be improved by turning it into tank drive by chaining the front wheels with the back wheels, adding another motor gearbox set to the front wheels, or adding a front steering system.
Also, the camera quality isn't great and can be improved by getting a better quality camera. The camera angle and height can also by made more versatile by creating a lifting and angling mechanism.
Thank you for going through our Instructable! Have fun with your Bluetooth car and feel free to leave feedback in the comments! :)