How I Hack a RC Toy Car to Control It From an Android Phone. Part 3: Android App

Droiduino Blog
3 min readSep 24, 2020

--

This post is the third part of the RC Toy Car project. The goal of this project is to hack an inexpensive RC Toy Car and connect it to an Arduino board so the toy car can be controlled from an Android phone.

If you want to learn the detailed step by step to create an Android app that can communicate with Arduino board using bluetooth, then you can take the Basic Android Programming for Arduino Makers course in Udemy.

In the previous posts, I have explained how I tear down the RC Transmitter to understand the circuit and then how I create the controller module by connecting the RC Transmitter to an Arduino board.

Now we are working on the last component of the project which is the Android app. As explained in the other post, the connection between Android phone and Arduino board will be through Bluetooth.

The command is sent by the Android app in the form of messages that are recognized by Arduino code and then translated into a signal to control the state of Arduino digital pins.

The simple explanation will be something like this

  • If the Android app sends the character “w” then digital pin 8 is set as HIGH and move the RC car forward.
  • If the Android app sends the character “s” then digital pin 9 is set as HIGH and move the RC car reversed.
  • If the Android app sends the character “a” then digital pin 10 is set as HIGH and turn the RC car to the left.
  • If the Android app sends the character “d” then digital pin 11 is set as HIGH and turn the RC car to the right.

These digital pins are connected to the transistors that act as switches to control the toy car’s movement.

For the app, I create a very simple user interface like shown below:

The Android code is available on Github. You are free to copy and alter it for your use.

If you want to know more about how the app works, you can read my post about connecting Arduino board to Android device via Bluetooth.

Lesson Learned

This project is all about experiments. There are some lessons that I gained while experimenting that I would like to share, so you won’t repeat the mistakes

  • The very first mechanism that I used to control the RC transmitter was a relay board. There are 4 mechanical relays on the board and each relay controls a pushbutton on the RC Transmitter. This configuration works and serves as a good proof of concept, however, the delay from when I press a button on the Android phone until the toy car moves is quite significant. Moreover, mechanical relays are noisy. So I have to look for other solutions and finally settles with using transistors as switches
  • The method that I use to control the Arduino board from an Android phone is by sending a String message whenever a button on the phone is pressed. Because of this, a short string is required to reduce delays. I experimented with sending a multi-character message e.g. send the message “move forward” when a button is pressed. Since Arduino needs a longer time to process longer characters, it results in a very noticeable delay on the whole system, so now I just send a single character.

Possible Improvements

There are still some improvements to the projects to make it a polished and elegant piece of hack engineering. These are some improvements that I have in mind:

  1. Put the controller hardware i.e. Arduino board and RC transmitter in a box to protect the components and make it neat. A specially designed electronic enclosure will be ideal.
  2. Improve Android App UI. Perhaps using the phone’s accelerometer to control the toy car instead of arrow buttons.

--

--

Droiduino Blog
Droiduino Blog

Written by Droiduino Blog

Droiduino is about sharing knowledge in the realm of Android app programming, Arduino project creation and using R for processing data.

No responses yet