Warning and disclaimer:
If you don't have any basic electronics knowledge, please don't try this one. The author takes no responsibility for any damages caused as a result of this tutorial. Try this one at your own risk.
I am going to use a STC89C52RC microcontroller, a HC-06 UART interface Bluetooth module and a L298N motor driver module to biuld a Bluetooth remote control toy car. The toy car is controlled by Bluetooth Remote Toy, which is an android based application developed by me and can be downloaded form Google play store, so you can remotely control toy car via Bluetooth by your android phone. The toy car commands are as follows.
Every command consists one byte. If you stop a certain action, an OR operation will be performed between that action command and the Stop/Off command. For example,
- 0x01000100(Forward) | 0x00100000(Stop) = 0x01100100, which will be sent to the toy car and make it stop forward.
- 0x01001000(Front light) | 0x00100000(Off) = 0x01101000, which will be sent to the toy car and make it turn off the front light.
The red, green and blue buttons are reserved for those who want to do extra actions.
| Control Function | 1-byte Command |
|---|---|
| Red button | 0x01000001 |
| Green button | 0x01000010 |
| Blue button | 0x01000011 |
| Forward | 0x01000100 |
| Backward | 0x01000101 |
| Right | 0x01000110 |
| Left | 0x01000111 |
| Front light | 0x01001000 |
| Rear light | 0x01001001 |
| Stop/Off | 0x00100000 |

