Introduction
In this blog, I'll demonstrate how I connected a Heart Rate Sensor to the Avnet MT3620 kit. The Beats Per Minute are calculated and displayed on an attached OLED Display. The RED LED will indicate the users heart beat..
Since we're using the Avnet Azure Sphere Starter Kit, We will be putting the 3 leads from the Heart Sensor into boards headers on the Click Socket #1.
The sensor is very simple with three legs:
Heart Rate Sensor
• BLACK: Ground
• RED: Input: +3V or +5V
• PURPLE: Signal
The Click Socket #1 and the color of the Sensor lead connected to it
• PIN AN - PURPLE lead
• PIN +5V - RED lead
• PIN GND - BLACK lead
See the pinout table below. For Pin AN the Name used in code is GPIO42_ADC1
Connecting the OLED Display
You will need to solder a header to the board. This is how I did mine using a 4 pin header I had lying around.
Solder a 4 pin header to the OLED Interface on the Board.
The code for this project s located on a GitHub repository located here:
https://github.com/skruglewicz/MyBPM
This is built on the 20.04 Sphere SDK and is running Azure Sphere OS version 20.04 Update 2.
Some of the Heart sensor code was ported from a Raspberry PI project that I used to learn about the sensor.I describe some details along with project links in the following document:
The Github repo is here:
https://github.com/WorldFamousElectronics/Raspberry_Pi/tree/master/PulseSensor_C_Pi
This project is working great for me on a Raspberry PI. Here is the link to the project from the vendor of the Heart Pulse sensor.
For the ADC coding I used theMicrosoft High Level ADC Example
For OLED Code I used the codebase from the blog postAvnet Azure Sphere Starter-Kit: Advanced Tutorial
Build and Run the projectSee the following Azure Sphere Quickstarts to learn how to build and deploy this sample:
- with Visual Studio https://docs.microsoft.com/azure-sphere/install/qs-blink-application
- with VS Code https://docs.microsoft.com/azure-sphere/install/qs-blink-vscode
- on the Windows command line https://docs.microsoft.com/azure-sphere/install/qs-blink-cli
- on the Linux command line https://docs.microsoft.com/azure-sphere/install/qs-blink-linux-cli
Comments