Within what we can do with Arduino and as electronics enthusiasts, today it is important that our projects have a communication with mobile devices, whether tablets, smart phones and laptops.
To begin I will describe below what we need for development:
1. Bluetooth Module HC-06
2. Arduino Mega 2560
3. Smart Phone with Android OS
4. LCD 2X16
5. Connection Cables
In the case of bluetooth module, this is connected as follows, with the pins 0 and 1 of the Arduino, connected to the TX and RX of Bluetooth module respectively and powered by VCC (5V) and GND of the Arduino .:
I have put pictures of the diagrams independently to be more clear the connection diagram, but should note that the Bluetooth module and the LCD are connected to the same circuit.
The code that I implemented on the Arduino is very simple and includes only the configuration of LCD and serial communication, through which we can control the communication with the Bluetooth module.
The complete code of the implementation are in download section:
code to communication between arduino bluetooth and a mobile phone
Now the implementation of the Mobile Application was created using an online software made by Google Labs and in my opinion is the best way to program mobile applications, for its flexibility, simplicity and ease.
For those who do not know, the AppInventor is a web application developed by Google Labs in association with MIT. It is an application for those who are unfamiliar with traditional programming and Google Labs was based on research of educational computing, that is the reason of its simplicity
you can access to the online application of AppInventor and get more information at the following link and I leave the image of the code that was implemented for the application of mobile communication and Android.
In this test we will send a text from a mobile phone and displayed on 2X16 LCD and also can be monitored by the “Serial Monitor” in Arduino software. I have also added the ability to turn on and off an LED located at pin 13, this LED will illuminate when the text you receive is “On” and will deactivate when the text you receive is “Off”.