Introduction
With the arrival of the IoT and the need for control, devices now need to do more than perform the basic functions for which they are built, they need to be capable of communicating with other devices like a mobile phone among others. There are different communication systems which can be adapted for communication between devices, they include systems like WiFi, RF, Bluetooth among several others. Our focus will be on communication over Bluetooth.
Today we will build an Arduino based project which communicates with an app running on a smartphone (Android) via Bluetooth.
For simplicity, the goal of the project is to switch a LED connected to the Arduino using the mobile app. We will be using the HC06 Bluetooth module as the major ingredient in this tutorial.
The HC06 Bluetooth Module is a slave only version of the HC05 Bluetooth module. It has 4 pins and communicates with a microcontroller via serial interface.
The HC06 Bluetooth module is a 3.3v logic level based device and thus if directly connected to the Arduino, will sometimes be unable to process the message received from the Arduino which is a 5v Level logic level device unless there exists some form of level shifting, although the Arduino can easily understand the data being sent from the Bluetooth module since it uses a higher logic level. The level shifting/conversion can be achieved either by use of a voltage divider or a level shifter module (like we did in this tutorial).
The shifter module (shown in the image below) helps with the easy transition from one voltage to the other. The level shifter has two sides, the high voltage side (marked HV) and the low voltage side (Marked LV). The shifter allows you to connect the desired low voltage output on the LV side and the high voltage line also to the HV. More details on connecting the level shifter are discussed in the schematics section.
Read more: Arduino Communication with an Android App via Bluetooth