Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • 3D Printing
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to design a heart-rate monitor using LoRa and Arduino

By Ayush Jain June 16, 2024

In this electronics project, we’ll design a healthcare solution over LoRa, using an Arduino Nano and a heart-rate sensor connected via the I2C bus. This device demonstrates the potential of the Internet-of-Things (IoT) in enhancing healthcare services and improving patient outcomes.

The system measures a person’s heart rate in beats per minute (BPM) from a sensor placed on the user’s finger. If the heart rate is outside the safe range, Arduino Nano sends this information to the LoRa E5 mini board. It acts as the communication gateway, directly transmitting the heart-rate data to a chosen gateway. This setup enables continuous monitoring of the user’s heart rate and real-time transmission of critical data.

Using the long-range capabilities of LoRa, this healthcare solution offers remote patient monitoring and timely mediation in case of irregular heart rates. The simplicity and effectiveness of the setup make it suitable for various healthcare applications, ranging from personal health tracking to hospital patient monitoring.

This project also provides a detailed guide on the hardware connections, sensor calibration, and LoRa communication setup, making it available to developers and healthcare professionals.

Figure 1. A block diagram of LoRa-based health care using Arduino and the IoT.

Table of contents

  1. Firmware for Arduino
  2. Error in MAX30102
  3. Circuit diagram and connections
  4. Sending data through the LoRa gateway via Chirpstack
  5. Program flow or algorithm and explanation

Requirements

  1. Ensure the LoRa gateway is installed (as shown in this article)
  2. LoRa E5 mini board by Seed Studio
  3. Arduino Nano
  4. MAX30102 module

Uploading the code in LoRa

Before implementing this healthcare solution, ensure the LoRa-to-UART code (LoRaE5_mini_UART_to_Lora) is uploaded to your LoRa E5 Mini board. To do so, follow the instructions in the this article.

This code enables communication between LoRa and the gateway. Once the code is successfully uploaded to the LoRa E5, upload the code to the Arduino Nano.

This code will interface with the heart-rate sensor via the I2C bus and continuously measure a user’s heart rate.

Uploading the code in Arduino Nano

Open the MAX30102_with_arduino_nano Code in Arduino IDE.

Figure 2. Open the code in Arduino.

Select the “Board” and “Port,” as shown below, and then upload the code.

Figure 3. Select the “Board” and “Port.”

Figure 4. Upload the code to Arduino.

The MAX30102 module issue

The MAX30102 has an issue. The pull-ups on SDA and SCL are connected at 1.8 V. However, 3.3 V is needed to work with Arduino nano.fda.

To resolve this issue, connect the pull-up to 3.3 V to ensure it works with Arduino. This can be done by cutting the trace shown in red in the image. Connect a wire in the place of the blue line, as shown in the image.

Figure 5. To ensure the 3.3 V works with Arduino, modify the red trace area as shown in this image.

Figure 6. The modification of the MAX30102.

Circuit diagram

Figure 7. The complete circuit diagram of the LoRa-based heart-rate sensor using Arduino Nano, the MAX30102 module, and the LoRa E5 mini board.

Figure 8. The circuit connections on the breadboard.

Adding a device to the gateway

To add a LoRa device to the gateway and find the key, refer to this article for detailed instructions. It provides a step-by-step guide on adding devices to the gateway, facilitating seamless communication between the nodes and the gateway.

How the code works

When a user’s finger is gently placed on the sensor, it takes about ten seconds for the readings to stabilize. During this time, the figure should avoid movement or it will affect the reading’s accuracy. The heart-rate measurements in BPM can be monitored on the serial monitor with a baud rate of 9600. If the BPM falls outside the safe 60 to 100 range, the heart-rate data will be transmitted to the LoRa network for further analysis and monitoring.

Figure 9. A user’s finger on the sensor to measure his heart rate.

Figure 10. Serial monitor output.

To view the data, go to the “Events” tab in ChirpStack. It will look like the below screenshot.

Figure 11. An example of the data under the “Events” tab in Chirpstack.

Copy the data and open any hex-to-text converter website to convert the hexadecimal value to text. This text will be the location coordinates.

Figure 12. The hex-to-text convertor value.

The algorithm

Figure 13. The algorithm of the LoRA-based heart-rate sensor.

The code explained

After initializing the heart-rate sensor using the below code, the sensor begins measuring the user’s BPM.

Figure 14. The code snippet when the IR sensor begins a user’s BPM measurement.

Figure 15. The code snippet for detecting a user’s finger on the sensor.

When a user’s finger is detected on the sensor, it will wait for ten seconds. After this time, it begins printing the BPM value on the serial monitor. If the BPM is out of the safe range, it will send this BPM data to LoRa.

Figure 16. This code snippet shows the detection of a user’s finger, measuring their BPM value after ten seconds.

The code for the Lora E5 mini board is explained here.

Improving healthcare

This technology holds significant potential for application in homes and healthcare settings, ensuring safe and simple heart-rate monitoring for individuals. Implementing this solution allows access to real-time user data on a single screen, simplifying monitoring efforts and reducing the burden of manual data collection.

This concept can also be extended to create smartwatches or wearable health-tracking devices. These devices can empower individuals to monitor their own heart rates as needed. In case of any fluctuations outside the safe range, the device can alert the user and transmit the heart-rate data to healthcare providers or emergency responders for immediate attention.

By leveraging LoRa technology, this solution offers long-range communication and low-power consumption, making it ideal for healthcare and personal health monitoring applications.

 

You may also like:


  • Understanding LoRa architecture: nodes, gateways, and servers

  • How LoRa enables long-range communication

  • What are the programming essentials for LoRa nodes?

  • How LoRa can impact smart cities with parking sensors

  • What is Chirpstack?

  • How to integrate modules and smart meters with LoRa node-to-gateway…

  • What is LoRa and LoRaWAN?

  • What are LoRa gateways and what types are available?

Filed Under: Tutorials
Tagged With: 12c, Arduino, healthcare, heartrate, internetofthings, IoT, lora, lorawan, sensor, tutorials
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

Submit a Guest Post

submit a guest post

EE TECH TOOLBOX

“ee
Tech Toolbox: Power Efficiency
Discover proven strategies for power conversion, wide bandgap devices, and motor control — balancing performance, cost, and sustainability across industrial, automotive, and IoT systems.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions.

  • PCB layout impact on RF path impedance
  • rechargeable battery and simple alkaline battery in one single product
  • Persistent Shoot-Through vin=vout in Synchronous Buck Converter – Physical Phenomenon Issue
  • Methods for Calculating SNR and SFDR in a CUI for Use in Machine Learning
  • Ensuring Reliable Backups in Azure

RSS Electro-Tech-Online.com Discussions

  • Panasonic RQ-A170 Walkman recorder
  • strange laptop problem
  • WTB: "The Theory Of Servicing AM, FM, And FM Receivers" by Clarence R. Green and Robert M. Bourque
  • Converting 1vac to 24vac
  • AC Input Relay Device Required

Featured – Real Time Hardware Filter Design

  • Practical implementation of bandpass and band reject filters
  • Practical application of hardware filters with real-life examples
  • A filter design example
  • Types of filter responses
  • What are the two types of hardware filters?
  • What are hardware filters and their types?

Recent Articles

  • GigaDevices introduces 32-bit MCUs with integrated DSP and FPU support
  • Grinn introduces 8-core SBC supporting AI-ready embedded development
  • EPC’s 100 kHz BLDC inverter supports high-efficiency motion control
  • Melexis announces 5 W smart driver to supports sensorless FOC operation
  • STMicroelectronics’ motion sensor simplifies industrial IoT system design

EE ENGINEERING TRAINING DAYS

engineering
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Sensor Series
      • 3D Printing
      • AI
      • ARDUINO Compatible Coding
      • Audio Electronics
      • Battery Management
      • Beginners Electronics Series
      • Brainwave
      • Digital electronics (DE)
      • Electric Vehicles
      • EMI/EMC/RFI
      • EVs
      • Hardware Filters
      • IoT tutorials
      • LoRa/LoRaWAN
      • Power Tutorials
      • Protocol
      • Python
      • RPI Python Programming
      • Sensors
      • USB
      • Thermal management
      • Verilog
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
  • Guest Post Guidelines
  • Advertise
  • Subscribe