Skip to content

Show the heart rate sent by a Bluetooth Low Energy heart rate sensor on the display of an M5Stack Core2

License

Notifications You must be signed in to change notification settings

koenvervloesem/M5Core2-Heart-Rate-Display

Repository files navigation

M5Core2 Heart Rate Display

Build status GitHub license

This Arduino sketch shows the heart rate sent by a Bluetooth Low Energy heart rate sensor on the display of an M5Stack Core 2.

This is a proof of concept with basic functionality. It supports any heart rate sensor that implements the Heart Rate Measurement characteristic of Bluetooth Low Energy.

M5Stack Core2 running the heart rate display code

Requirements

Building with arduino-cli

There's a Makefile to ease the installation of the platform and libraries if you are using arduino-cli:

make platform
make libraries

Then you can build the sketch:

make build

After this, you can upload the binary firmware file to your M5Stack Core2:

arduino-cli upload -p /dev/ttyUSB0 -b m5stack:esp32:m5stack-core2 -i $PWD/build/M5Core2-Heart-Rate-Display.ino.bin

TODO

  • Improve the user interface.
  • Let the user choose the heart rate sensor to connect with.
  • Send heart rate measurements to MQTT for further processing and visualization.

Learn more about Bluetooth Low Energy development

If you want to learn more about Bluetooth Low Energy development, read my book Develop your own Bluetooth Low Energy Applications for Raspberry Pi, ESP32 and nRF52 with Python, Arduino and Zephyr and the accompanying GitHub repository koenvervloesem/bluetooth-low-energy-applications.

License

This project is provided by Koen Vervloesem as open source software with the MIT license. See the LICENSE file for more information.

The source code is based on h2zero's NimBLE_Client.ino example from the NimBLE-Arduino library.