Android and Arduino Coding Fun

This section of Hackatronics presents projects that use an Android device to interact with code running on an Arduino using Bluetooth. The projects are quite straightforward and should be simple enough to re-purpose for the coder’s own requirements. All source code is available for download, with the Android apps also available for free on the Google Play store. To get these projects working, you will need the following core items:

  • an Android device, 4.1.2 or later,
  • an R3 Arduino Uno, Leonardo or Mega 2560,
  • a generic Bluetooth module, e.g. HC-06,
  • Arduino IDE,
  • Android studio 1.5 onwards (only if wanting to modify the code)

Each of the projects have specific requirements in addition to the above.

Using a Bluetooth Module

For projects using a Bluetooth module, the reader might find it useful to read some readily available online content for using a Bluetooth module with an Arduino, such as this instructable. For the Hackatronics projects it is assumed Bluetooth is configured with the default pairing pin of 1234, and baud rate of 9600, with the image below showing the wiring connections as used. Here, an inline voltage divider (using resistors insulated with black tape) has been built in to the yellow cable that connects to the Bluetooth RX pin to enable it to accept 5 volts.

HC-06 Bluetooth with Wires and In-line Voltage Divider.
HC-06 Bluetooth with wires and In-line voltage divider.

On the Arduino, if after connecting the Bluetooth module the received data is corrupted, setting the appropriate serial RX pin as INPUT_PULLUP should rectify that (this is already done in the downloadable code). After downloading the source code and installing the Android apps, the reader must ensure their Android device is paired with the Bluetooth module, and ensure the name of the Bluetooth module (e.g. HC-06) is set in the app’s Bluetooth config.

Images below show how the Bluetooth module is connected to the Arduino, without and with the optional multi-function shield:

HC-06 Bluetooth module wires connected to Arduino Leonardo.
HC-06 Bluetooth module wires connected to Arduino Leonardo.
HC-06 Bluetooth Module Connection to Arduino Multi-function Shield.
HC-06 Bluetooth module connection to Arduino multi-function shield.

The Current List of Projects

From time to time new projects will be added to the list, so be sure to visit this page frequently for updates.

  1. Android and Arduino DSLR Intervalometer Using Bluetooth
  2. Android Display for Arduino Speedometer Using Bluetooth

It must be pointed out that by downloading the code and following the projects, you agree to do so at your own risk, and agree to take full responsibility for any loss or damages you may incur upon yourself or others. Although we do everything to ensure our downloads are free from viruses and malware, please check that your virus and malware scanning software is up to date before hand.

Each of these has scope to be built upon and expanded, but we leave that to you. Get coding and have fun!

Leave a Reply

Your email address will not be published. Required fields are marked *