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.
Table of contents
- Firmware for Arduino
- Error in MAX30102
- Circuit diagram and connections
- Sending data through the LoRa gateway via Chirpstack
- Program flow or algorithm and explanation
Requirements
- Ensure the LoRa gateway is installed (as shown in this article)
- LoRa E5 mini board by Seed Studio
- Arduino Nano
- 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.
Select the “Board” and “Port,” as shown below, and then upload the code.
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.
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.
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.
To view the data, go to the “Events” tab in ChirpStack. It will look like the below screenshot.
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.
The algorithm
The code explained
After initializing the heart-rate sensor using the below code, the sensor begins measuring the user’s BPM.
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:
Filed Under: Tutorials
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.