Skip to content

Introduction

In the bleutooth research seciton, the author has concluded that bluetooth le was usable for realising a remote based on the found speciifcations. To make sure this also holds up in the real world the author has set out to realize a physical protype to test this theory. This page will cover how the prototype has been made, the set goals and details about the realization.

Goals

The following goals for this investigation were made:

  • Investigating the possibility of using an ESP32 for BLE communication
  • Finding documentation on BLE in combination with the esp32.
  • Realizing two way communication by making a physical prototype to see if the platform is fit for our use case; a remote

Installing ESP32 libraries

To develop software for the ESP32 with Arduino IDE, a board configuration URL is required to be added in the settings. The configuration URL used is the following: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json After configuring the URL, the ESP32 board has to be installed using the built-in board manager in Arduino IDE, here search for ESP32 in the search field to find the board. One can than select the board under ESP32 Arduino -> ESP32 Dev Module

ESP32 Ble development resources

The following 2 tutorials help getting started but are severly lacking, most other tutorials are either straight copies or not usable due to missing stuff.

  1. esp32-ble-server-client

  2. How to use BLE in ESP32? ESP32 BLE (Bluetooth Low Energy) Tutorial

The most useful was this unofficial library documentation which helped in programming the actual esp32 bluetooth interaction on a more advanced level. Link: BLECharacteristic Class Reference

Needed parts

The following parts are needed to realize the prototype breadboard.

  • Esp32 classic (V1)
  • Active piezo buzzer
  • 10k ohm 1% resistor
  • Tactile button
  • Breadboard
  • Prototype wires (i.e. dupont cables)

Wiring diagram

Wiring diagram

Image of physical prototype

Wiring diagram

Realized Code

The Arduino code for this protype can be found in the repository under: arduino/push-button-ble/main

The realized code has been documented through comments, it features a debouncer for the input button, code for making sound trough an active piezo element, sending the button press value to the connected device and code to be able to read if the buzzer has been activated by the external device and in turn making a continued buzz tone.

Checking if the prototype works

To check the protoype the app “nRF Connect” can be used on an iPhone or Android device, this allows the user to see the set characteristics, read out the device and see if it works and is findable by Bluetooth enabled devices. Other apps were tried on Mac such as “LightBlue(r)” and “BlueSee Ble debugger” but were deemed unusable or needed a paid subscription thus the recommendation is using “nRF Scanner” for debugging, an dedicated app couldn’t be realized in the small timeframe unfortunately. The devie is visible under the name Iot cane on bluetooth enabled (Version 4+) devices.

The code and device has been tested in combination with an iPhone Xr

Conclusion

A prototype has been made which shows the usage of an esp32 in triggering an active buzzer and using a button to trigger a value change of a bluetooth charactheristic that can be read on a (mobile phone) app. The author thus sees the platform fit for making a first version of a remote. The goals have been archieved by finding usable documentation and realiziaton of a 2 way read write concept, by using a smartphone and esp32.


Last update: April 20, 2023