In this project a serial Bluetooth module is used to create a connection between Arduino Uno and an Android app that I created with MIT App Inventor.
Arduino listens for commands to light some LED's or show its status. In addition, a timer interrupt makes it check for temperature via a TMP36 sensor: if temperature is greater than a threshold a LED is lit; every n seconds (where n is a parameter set through the app) a status report is sent to the app. A simple command structure enables the app to send parameters and values to Arduino and the other way round.
There are many Bluetooth modules and even Arduino shields: my choice has fallen on JY-MCU that I bought from Hobby Components in the UK.
The JY-MCU is a class-2 Bluetooth module that acts like a serial port with no need of any software configuration on the Arduino. This module is available in several configurations, and this has been the first hurdle to overcome.
The one we need to make the connection between Arduino and the Android phone is a Slave Module. To make things very simple, there are two types of devices: Master and Slave; a Master can communicate with more than one Slave while a Slave can communicate with a single Master at a time, Master-Master and Slave-Slave communication is not allowed. Since the Bluetooth module in all smartphones is of Master type, the one we need for Arduino must be a Slave (this has nothing to do with client-server communication as we'll see later in the app description).