In today’s tutorial we look at designing a non-invasive method for detecting and measuring blood pressure and cholesterol in the body. Monitoring your health is more important than ever, and with advancements in technology, it’s now possible to build your own non-invasive blood pressure and cholesterol monitoring system at home. In this blog post, we will guide you through a step-by-step process on how to create this project using Arduino, making health monitoring accessible and affordable. Let’s dive in!
You can read about how this project is among other non-invasive detection techniques here too. Non-invasive monitoring techniques are crucial because they eliminate the discomfort and risks associated with invasive procedures. Traditional methods for checking blood pressure and cholesterol often involve needles and laboratory tests. Non-invasive techniques, however, use sensors and algorithms to provide accurate readings without penetrating the skin, making the process much more user-friendly and less daunting.
DIY health projects offer several advantages. They are cost-effective, as they often use affordable components and open-source software. Additionally, they provide educational value, enhancing your understanding of how health monitoring devices work. DIY projects also offer customization, allowing you to tailor the system to your specific needs and preferences.
Arduino is a versatile microcontroller platform that serves as the brain of your DIY monitoring system. Its ease of use, wide range of compatible sensors, and extensive online community support make it an ideal choice for this project.
For this project, we will use:
Arduino Setup: Begin by setting up your Arduino Uno on a stable surface. Ensure that you have installed the necessary Arduino IDE on your computer.
Connecting the Pulse Sensor:
Connecting the Pressure Sensor:
The pressure sensor was custom built and we had to also made it have a pinout that we can easily connect the sensor module to the Arduino Uno board.
Connecting the NodeMCU:
Connecting the LCD Screen:
#include <EEPROM.h>
#include <SoftwareSerial.h>
#include <DallasTemperature.h>
#include <OneWire.h>
#include <LiquidCrystal.h>
SoftwareSerial mySerial(2, 3); // RX, TX
int sensor[] = {};
//4 pin of uno
#define ONE_WIRE_BUS 4
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature.
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
#define greenLED 13
#define redLED A4
#define blueLED A5
long randNumber;
float temp, bp, chloe1, chloe2, totalChlr;
int ecg1, ecg, pulseRate, glocoseSensor; //chekRandNumber;
int changeTemp;
void generate(){
randNumber = random(5, 10);
Serial.println(randNumber);
EEPROM.write(0, randNumber);
}
void setup(void){
Serial.begin(115200);
while (!Serial) { ; }
// set the data rate for the SoftwareSerial port
mySerial.begin(115200);
//mySerial.println("Hello, world?");
sensors.begin();
lcd.begin(20,4);
//define the pins for ECG sensor
pinMode(6, INPUT); // Setup for leads off detection LO +
pinMode(5, INPUT); // Setup for leads off detection LO -
//the LEDs
pinMode(greenLED, OUTPUT);
pinMode(redLED, OUTPUT);
pinMode(blueLED, OUTPUT);
//print a welcome message
lcd.setCursor(0, 0);
lcd.print(" WELCOME ");
lcd.setCursor(0, 1);
lcd.print(" Mr. Ameh Solomon");
for(int x=0; x<19; x++){
lcd.setCursor(x,2);
lcd.print("*");
delay(200);
}
for(int x=0; x<19; x++){
lcd.setCursor(x,3);
lcd.print("*");
delay(200);
}
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" IoT Based Vascular");
lcd.setCursor(0,1);
lcd.print(" Blood Disease");
lcd.setCursor(0,2);
lcd.print(" Prevention And");
lcd.setCursor(0, 3);
lcd.print(" Detection Project");
delay(4000);
lcd.setCursor(0,0);
lcd.print("Prepping Sensors");
for(int x=16; x<19; x++){
lcd.setCursor(x,0);
lcd.print("*");
delay(200);
}
for(int x=0; x<19; x++){
lcd.setCursor(x,1);
lcd.print("*");
delay(200);
}
for(int x=0; x<19; x++){
lcd.setCursor(x,2);
lcd.print("*");
delay(200);
}
for(int x=0; x<19; x++){
lcd.setCursor(x,3);
lcd.print("*");
delay(200);
}
lcd.clear();
randomSeed(analogRead(A3));
generate();
}
float bodyTemp(){
// Send the command to get temperatures
sensors.requestTemperatures();
Serial.println("Temperature is: ");
// Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire
temp = sensors.getTempCByIndex(0);
return temp;
}
int ecgSensor(){
ecg1 = analogRead(A0);
if((digitalRead(5) == 1)||(digitalRead(6) == 1)){
Serial.println('!');
}
else{
return ecg1;
}
//Wait for a bit to keep serial data from saturating
delay(100);
}
To get the rest of this code, let us know by sending us a message
#include "ThingSpeak.h"
#include <ESP8266WiFi.h>
#include <SoftwareSerial.h>
SoftwareSerial nodeMCU(D1, D2);
char ssid[] = "AncII"; // your network SSID (name)
char pass[] = "eureka26"; // your network password
int keyIndex = 0; // your network key Index number (needed only for WEP)
WiFiClient client;
unsigned long myChannelNumber = 1685425;
const char * myWriteAPIKey = "IWGFF3L5SEHT38RB";
String myStatus = "field1 equals field2";
const int ledPin = LED_BUILTIN;// the number of the LED pin
// Variables will change:
int ledState = LOW; // ledState used to set the LED
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0; // will store last time LED was updated
// constants won't change:
const long interval = 1000;
char c;
String dataIn;
int8_t indexOfA, indexOfB,indexOfC,indexOfD,
indexOfE,indexOfF,indexOfG,indexOfH;
String data1, data2, data3, data4, data5, data6,
data7, data8;
void setup() {
Serial.begin(115200);
nodeMCU.begin(115200);
pinMode(ledPin, OUTPUT);
WiFi.mode(WIFI_STA);
ThingSpeak.begin(client); // Initialize ThingSpeak
}
void blinkLed(){
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// if the LED is off turn it on and vice-versa:
if (ledState == LOW) {
ledState = HIGH;
} else {
ledState = LOW;
}
// set the LED with the ledState of the variable:
digitalWrite(ledPin, ledState);
}
}
void loop(){
while(nodeMCU.available() >0){
c = nodeMCU.read();
if( c == '\n'){
break;
}
else{
dataIn += c;
}
}
if(c == '\n'){
//Serial.println(c);
parse_data();
//thingspeak send
if(WiFi.status() != WL_CONNECTED){
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
while(WiFi.status() != WL_CONNECTED){
WiFi.begin(ssid, pass); // Connect to WPA/WPA2 network. Change this line if using open or WEP network
Serial.print(".");
delay(5000);
}
Serial.println("\nConnected.");
}
else{
blinkLed();
}
// set the fields with the values
ThingSpeak.setField(1, data1);
ThingSpeak.setField(2, data2);
ThingSpeak.setField(3, data3);
ThingSpeak.setField(4, data4);
ThingSpeak.setField(5, data5);
ThingSpeak.setField(6, data6);
ThingSpeak.setField(7, data7);
ThingSpeak.setField(8, data8);
// figure out the status message
// if(data1 > data2){
// myStatus = String("field1 is greater than field2");
// }
// else if(data1 < data2){
// myStatus = String("field1 is less than field2");
// }
// else{
// myStatus = String("field1 equals field2");
// }
//
// set the status
ThingSpeak.setStatus(myStatus);
// write to the ThingSpeak channel
int x = ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);
if(x == 200){
Serial.println("Channel update successful.");
}
else{
Serial.println("Problem updating channel. HTTP error code " + String(x));
}
// change the values
// data1++;
// if(data1 > 999){
// data1 = 0;
// }
Serial.println("data 1= " + data1);
Serial.println("data 2= " + data2);
Serial.println("data 3= " + data3);
Serial.println("data 4= " + data4);
Serial.println("data 5= " + data5);
Serial.println("data 6= " + data6);
Serial.println("data 7= " + data7);
Serial.println("data 8= " + data8);
Serial.println("............................");
delay(20000); // Wait 20 seconds to update the channel again
c = 0;
dataIn = "";
}
}
void parse_data(){
indexOfA = dataIn.indexOf("A");
indexOfB = dataIn.indexOf("B");
indexOfC = dataIn.indexOf("C");
indexOfD = dataIn.indexOf("D");
indexOfE = dataIn.indexOf("E");
indexOfF = dataIn.indexOf("F");
indexOfG = dataIn.indexOf("G");
indexOfH = dataIn.indexOf("H");
data1 = dataIn.substring(0, indexOfA);
data2 = dataIn.substring(indexOfA+1, indexOfB);
data3 = dataIn.substring(indexOfB+1, indexOfC);
data4 = dataIn.substring(indexOfC+1, indexOfD);
data5 = dataIn.substring(indexOfD+1, indexOfE);
data6 = dataIn.substring(indexOfE+1, indexOfF);
data7 = dataIn.substring(indexOfF+1, indexOfG);
data8 = dataIn.substring(indexOfG+1, indexOfH);
}
This code connects an ESP8266 WiFi module (NodeMCU) to the internet and sends data to a website called ThingSpeak.
Here’s a breakdown of the functionality in 3 parts:
parse_data
function to extract eight data values separated by specific characters (likely letters A to H).indexOf
function to find the positions of these characters.substring
function. These eight substrings are assigned to variables data1
to data8
.Calibration is crucial to ensure the accuracy of your readings. For the pulse sensor and pressure sensor, we used a known reference, such as a clinically validated blood pressure monitor, to calibrate our system. Comparing the readings from our DIY system with the reference device and adjust the calibration constants in our Arduino code accordingly.
For the cholesterol sensor, calibration is more complex due to the proxy method used. It involves taking multiple readings and comparing them with laboratory test results to create a calibration curve.
Blood pressure readings consist of two numbers: systolic and diastolic pressures. The systolic pressure is the highest pressure in your arteries when your heart beats, while the diastolic pressure is the lowest pressure when your heart rests between beats. Normal blood pressure is typically around 120/80 mmHg.
Cholesterol levels are measured in milligrams per deciliter (mg/dL). Total cholesterol is the sum of low-density lipoprotein (LDL), high-density lipoprotein (HDL), and 20% of your triglyceride level. LDL is often referred to as “bad” cholesterol because high levels can lead to plaque buildup in arteries and result in heart disease. HDL is “good” cholesterol as it helps remove LDL from the bloodstream.
With the sensors connected and calibrated, you can now use Arduino to monitor blood pressure and cholesterol levels in real-time. The LCD can show the current readings, and the NodeMCU board can send the data to a remote server for further analysis and storage.
Visualizing your health data helps in better understanding trends and anomalies. You can use various tools like ThingSpeak or Blynk to create real-time graphs and dashboards. These platforms allow you to monitor your health metrics on your smartphone or computer.
Having a personal health monitoring system allows you to keep track of your vital signs regularly. It empowers you to take proactive steps in managing your health and making informed decisions based on the data collected.
Regular monitoring can help in the early detection of potential health issues. By noticing deviations from your normal readings, you can seek medical advice promptly and take preventive measures to avoid serious health problems.
DIY health monitoring systems may not always match the accuracy of clinically validated devices. It is essential to understand their limitations and use them as supplementary tools rather than complete replacements for professional medical equipment.
Maintaining your DIY system involves regular calibration, ensuring sensor accuracy, and updating the software as needed. Proper upkeep ensures that your monitoring system remains reliable and functional over time.
Creating this DIY non-invasive blood pressure and cholesterol level monitoring system using Arduino is an exciting and empowering project. It combines technology and health, allowing you to take control of your well-being. By understanding and utilizing this system, you can gain valuable insights into your health and make informed decisions to maintain a healthy lifestyle.
For those interested in exploring this project further, the journey of building and optimizing your DIY health monitoring system can be both educational and rewarding.
1. How accurate are DIY blood pressure monitors compared to traditional devices? DIY monitors can be accurate if properly calibrated and used correctly, but they may vary in precision compared to clinical-grade equipment. Regular calibration against a standard device can improve accuracy.
2. Can I use this monitoring system to replace regular visits to my doctor? While useful for personal health tracking, DIY monitors should not replace regular medical check-ups. They are best used as supplementary tools alongside professional healthcare advice.
3. Are there any safety concerns with DIY health monitoring devices? Ensuring proper calibration, understanding the device’s limitations, and not relying solely on DIY monitors for critical health decisions can mitigate safety concerns. Always consult a healthcare professional for accurate diagnosis and treatment.
4. What are some common pitfalls to avoid when building this monitoring system? Common pitfalls include improper sensor calibration, inadequate data interpretation, and insufficient understanding of sensor technology. Following detailed instructions and double-checking connections can help avoid these issues.
5. How can I expand this project to monitor additional health parameters? To expand the project, you can integrate additional sensors like glucose sensors, ECG monitors, or temperature sensors. Using Arduino’s versatile platform, you can program and connect multiple sensors to create a comprehensive health monitoring system.
Footwear Trends: The Hottest Shoes Introduction As the seasons change, so too do the trends…
Coping with Breakups Introduction Breakups can feel like a whirlwind, leaving you emotionally drained and…
Signs You’re Growing Apart Introduction Every relationship goes through its ups and downs, but sometimes,…
Capital punishment, a phrase that sends shivers down the spines of some and a sense…
Burning Embers Introduction Katie May's "Burning Embers" transports readers to a seemingly ordinary town harboring…
The story of Jesus Christ is not just a tale of a man who lived…
View Comments
i want to know full details of this project
Please it has been updated.
Can I get the details or video of this project.