How to control arduino board using an android phone and a bluetooth module
Here is a short video showing an example app I created. I’ll describe how to do the wiring, write an arduino sketch that can accept basic commands and send them and how to write the app itself. I asume you’re already familiar with some of the basics, you made a few arduino projects and are familiar with the arduino IDE. If you have attempted serial communication with the arduino board everything should be fully comprehensible. If you have any problems or questions feel free to ask them in the comments section.
…and here is an example of receiving the data from the arduino board on the mobile. The temperature sensor connected to the arduino board is a ds18b20 sensor. Just to show how awesome app inventor is I added text to speech functionality – the app says the temperature every 15 seconds. The arduino code and the app is described in more detail in steps 4,5 and 6.
Step 1: Wiring & part list
The circuit is as simple as it gets so you probably already have most of them.
You will need:
- arduino board
- bluetooth serial module (I used a btm222 module on a breakout board with an inbuilt regulator )
- an LED
- resistor (100ohm)
The only problematic part here is the bluetooth module. There are different modules all over the internet so be sure you check the pinout in the datasheet of the one you get as it can differ.
Also notice that there are two general classes of bluetooth modules:
Class 1 has range of about 100 meter (300 feet)
Class 2 has range of about 10meter (30 feet)
In case you’re wondering they are entirely compatible and you can only get 100 meter range if both of the devices (ie the mobile and the serial module) are class one. If one of it is class 1 the maximum range is lower.