This is a simple project of Android Bluetooth Car with Bluetooth control. This project is open source and multiplatform: Arduino (Processing), STM32, MSP430, PIC, AVR, FEZ Panda II (.NET Micro Framework) and may be even В Raspberry Pi.
To control the car used Android-device with a built-in accelerometer. Tilt forward – car goes forward, tilt to the left – car turns to the left, tilt back – car goes back. Speed of movement or rotation depends on how much you tilt the device. Sensitivity and value of the tilt set in the configuration Android-apps. Also are provided a normal way to control: the buttons on the screen. In addition to all I implemented the touch control. Total 3 ways to control the RC Car.
1. Android device
The most important part – Android device with accelerometer and Bluetooth: tablet, smartphone and other… As an Android device, I used a cheap Chinese tablet “Ainol Aurora” with an external USB-Bluetooth module (because its not have own), connected via USB Host.
2. DIY Car Chassis
We also need any chassis with 2 or 4 DC motors. You can use an old RC toy car. I bought a 4WD chassis with 4 motors on ebay. To control described in this project is most suitable track chassis.
3. Controller (MCU)
As I said above, the project is planned to be multiplatform. At the present time I implemented the project for:
Controller must support 2 PWM and UART.
4. Bluetooth module
As a Bluetooth module uses cheap Chinese module HC-06, which has been described in this article.
5. Motor Driver
I used L298N Dual Bridge DC stepper Motor Driver module. It cost 4-5$ on eBay.
6. Other parts
All calculations are performed in the Android-application, and immediately calculate the values вЂ‹вЂ‹of the PWM for the left and right motor. Application has flexible settings, such as the range of the PWM, the sensitivity of tilt, the minimum threshold for the PWM and other. Example commands transmitted by Bluetooth:
L – the command to the left engine, R – for the right
A dash means the motor rotation to move back
255 – PWM value (for Arduino is the maximum speed of rotation)
\r – end of command.
On this command RC car will move forward and slightly rotated to the right, as right engine rotates slowly left.
On this command the left engine will rotate back and forward right, forcing a car to rotate around its axis counterclockwise.
Command is an additional channel to which you can connect for example lights, sound, etc.
Symbols command L, R and H can be defined in the settings of Android-applications.
In the MCU control program provides a timer that shuts off the engine if the last command was received more than n-seconds ago. The data are stored in the EEPROM memory of the controller and can be changed from Android device. The range of this setting is from 0.1 seconds to 99.9 seconds. This setting can be disabled. To work with EEPROM provides commands: Fr – reading values вЂ‹вЂ‹and Fw – record values.
For more detail: Simple RC car for beginners (Android control via Bluetooth)