Android Bluetooth Serial App

Posted on by admin

And just as any hobbyist would love it, the ESP32 is now officially supported by the Arduino IDE. Earlier we have to do a huge work around with, but now thanks to this guy’s hard work has become a cake walk. Hence, I launched my Arduino IDE and went thorough few example BLE programs, through which I understood nothing. After a long time of surfing and youtubing I realized that there are lot more thing to understand if you have to work with Bluetooth Low Energy (BLE) using ESP32. I decided to cover the BLE in separate articles, so here we will use the Classic Serial Bluetooth of ESP32 to toggle an LED using Smart Phone. So let’s get started.Getting started with ESP32 BluetoothThe first program that I wanted to try was a simple program using which I can turn On or Off an LED from a mobile phone Bluetooth Terminal application, just like the good.

  1. Android Bluetooth Serial Application

Android Bluetooth Serial Application

But it turns out that, Bluetooth Low Energy (BLE) is not indented for that. I also discovered that there are two types of Bluetooth in the ESP32 module, one is the Classic Bluetooth and the other is BLE Bluetooth Low Energy. Okay, but why? Why do we have two types of Bluetooth and what should I use for my project?Understanding Bluetooth Low Energy (BLE) and Classic BluetoothThe Bluetooth Low Energy, as the name indicates consumes less power than classic Bluetooth. It is achieved by sending data as needed with pre-defined periodic updates. But unlike classic Bluetooth it is not used to transfer Files or Music. Have you ever wondered how your phone automatically identifies that the Bluetooth device you just paired is an audio device or a laptop or phone, you might have also seen that the battery level in wireless audio player or fitness band is automatically shown in the status bar of your mobile; all these are possible with the characteristics of BLE devices.

Bluetooth

A BLE device works with Bluetooth V4.0 and can operate with low power as a server or as a client which makes BLE an ideal choice for beacons, smart watches, fitness bands etc. Classic Bluetooth on the other hand is just the simple plain old Bluetooth that we use to transfer files and other data.

Android bluetooth serial application

Almost all BLE devices have Classic Bluetooth functionality associated with it. The Bluetooth used in modules like HC-05 is a version of the classic Bluetooth called Bluetooth SSP (Serial Port Protocol), meaning the Bluetooth follows the standard serial protocol which makes it easier to send and receive data without much overhead.

Android Bluetooth Serial App

At the end of this tutorial we will learn how to use Serial Bluetooth functionality in ESP32.Here in this article we will use the Serial Bluetooth function on ESP32 to pair it with a Smartphone and use any existing Bluetooth Terminal app from Play store to send commands to the ESP32 and toggle the on board LED accordingly.In later articles we will cover ESP32 BLE as server as well as client. BLE server is generally used to send BLE data to other Bluetooth Devices and BLE client is used to scan other BLE devices thus act as beacon.Preparing Arduino IDE for ESP32Do note Arduino IDE by default does not support ESP32 board; you have to download and install them using the board manager. If this is you first program with ESP32 then follow this and upload a test sketch.