Introduction: ZazHRM - a Bluetooth Heart Rate Monitoring System for Sleep Time

ZazHRM is being formed to stress to perform pulse rate monitoring (HRM) during sleep metre. This prototype broadcasts via Bluetooth (BT), in near real-time, a measure of the tenderness pace (HR) or the pulse signal to an Mechanical man phone in a 10 meter r. An App running on the Android call enables the graphic art visual image of either the HR or the beat. When the HR falls below or rises above predefined thresholds, the App can also trigger an alarm for the caregiver.

The prototype comprises an Humanoid App developed with AppInventor, a PulseSensor to measure the heart pulse signal, a HC-05 BT module to perform the BT communicating, and an Arduino Uno board where a C program orchestrates the different parts. In addition, a Python script also shows how to perform basic offline processing of the data accumulated during monitoring. Code and applicable files are stored along GitHub.

Please, read besides the warnings at the ending of this presentation.

Thank you in overture for your feedback.

Step 1: Material Homework

1) Arduino Uno Board; if you are new to the world of Arduino, you may like to buy a kit and enjoy learning from the tutorial projects.

2) Hoopla-and-manoeuvre heart-rate sensor for Arduino; on the unchanged site, you may want to familiarize yourself with the examples provided aside the creators of the PulseSensor.

3) DSD TECH HC-05 Bluetooth Module

4) Mechanical man phone; information technology doesn't need to be a recent phone.

5) Bread board bearer to organize the pieces in collaboration.

6) An ordinary Tupperware (W = 15 cm, L = 25 Cm, H = 4 cm) to master of ceremonies everything and protect the electric circuit. You will need some tool to drill clean openings in the Tupperware.

7) LEDs (1 violent, 1 unhealthy and 1 viridity); the red indicates that 60 minutes measurements are either above the superior threshold or below the lower threshold; the dishonourable indicates that the impulse is being observed; the green indicates that the HR measurements are in the expected range.

8) Resistors (1 x 1k, 1 x 2k, 3 x 220)

9) Jumper wires

10) 5 meter cable system, to allow the wearer to move to a greater extent freely in the bed and to step-up the communication array.

11) One along/off push button with cable.

12) Two rechargeable 9 volt batteries and a deuce 9V battery cables; as indicated in the circuit diagram later, the two batteries need to cost wired in parallel.

13) Velcro, to non-permanently get unrivalled or ii 9 volt rechargeable batteries to the breadboard bearer.

14) A connector kit up and a crimping tool, to build connectors for the 5 meter cable, minimal brain dysfunction pins to the 9V battery cables and add pins to the on/polish off push button cable. If you are not familiar crimping, tolerate yourself to scathe a few dozen connectors before getting IT right ;)

15) Optional: a finger brace stabiliser or its equivalent for the toes, dependant on where it feels the most comfortable, but HR from square-toed may be harder to get than from finger. You can also minimize the motion of the wire connecting the PulseSensor aside simply letting information technology run under your wrist watch.

16) A basic voltmeter, to test the voltage divider in front of the BT module, the quality of your crimping Oregon the collimate association of the batteries.

Step 2: Circuit Diagram

1) The 3 wires running from the PulseSensor to the Arduino board are 5 meter nightlong. You will want to crimp these 3 wires on both sides: female on the PulseSensor side and phallic on the Arduino go with.

2) The voltage divider in front the RX connector of the HC-05 comes directly from the DSD Tech documentation.

Step 3: Suggested Use

  • The person being monitored is in one bedroom
    • PulseSensor straps round one finger or one toe; Sir Thomas More likely to workplace with a digit than a toe.
    • Breadboard is installed at a 2.5 meter distance away from the be intimate, giving the wearer 2.5 meters of tolerance.
  • The person monitoring is in another bedroom
    • The phone should remain connected to its battery charger passim the night.
    • The screen inevitably to be locked in the vertical put on.
    • The riddle saver timer needs to be position to a value ranking to united infinitesimal.
    • The distance between the telephone and the breadboard should be inferior to 10 meters; the maximum distance may change as a function of the building materials separating the circuit from the phone.

A few words about the caregiver, me, and the person receiving care, Zaz (no affiliation with the singer). Zaz is the nickname of a family member and I am an average technical school guy; Zaz is a chirpy, courageous and caring person WHO has epilepsy. Without entering into inside information, on that point is a connection between epileptic seizures and 60 minutes. ZazHRM may nonetheless also be helpful in the more than general circumstance of conditions where bradycardia and tachycardia are nocturnal symptoms. Please, make out non hesitate to take first to change this prototype to best meet your of necessity, or your curiosity.

The picture above was created with Floorplanner and Limp.

Step 4: Demonstrate Video

  • 0-49 s --> loading the App from AppInventor

Observe: if it is the first time payload the App, you will need to connect your Android ring to the HC-05. Pressur the "Join BT" push, then select the HC-05; the address of the BT module wish make up remembered the next time you load the App, as will other settings.

  • 49-1:15 s --> overview of the ironware setup

Remark: before powering on the circuit and strapping the PulseSensor to your finger, the compiled C code needs to Be uploaded from a laptop computer to the arduino board via the usb port.

  • 1:15-1:30 s --> burly the PulseSensor
  • 1:30-1:35 s --> start to monitor

Remark: when the "Set about HRM" button is pressed, the pulse (HR) is mechanically recorded on the phone, until the "Stop HRM" is pressed. The 60 minutes lumber will be blest locally on the phone in the format "bmpLog_MM-Doctor of Divinity-yyyy hh:millimetre:ss a.txt".

  • 1:40-1:50 s --> changing the scale of the display
  • 1:55-2:05 s --> changing display to night mode
  • 2:05-2:30 --> displaying the pulse signal

Remark: when displaying the pulsation by pressing the "Pulse" clit, the recording of the HR is temporarily stopped until you press the "BPM" button once more.

  • 2:30-3:10 --> adjusting upper or lower 60 minutes threshold

Observe: aft ever-changing the quantitative value of the upper or the lower HRM threshold, you need to press the "Set" clitoris

  • 3:10-3:20 --> setting alarm in sound mood
  • 3:20-3:50--> testing the alarm in sound mode
  • 3:55-4:05 --> setting alarm in tickle mode
  • 4:05-4:30 --> examination the alarm in vibrate mode
  • 4:30-4:40 --> scope the alarm in blink mode
  • 4:40-5:10 --> testing the alarm in twinkle mode
  • 5:15-5:20 --> mise en scene alarm in vibrate mode
  • 5:20-6:00 --> testing the alarm when lap goes down

Remark: an alarm may also comprise triggered if the batteries' charge is also low, the HC-05 fails or the speech sound is settled too cold for the BT.

  • 6:10-end --> showing where the HR logs are stored

Step 5: Offline Visualization and Interpretation of Logged Data

On GitHub, file cabinet "bpmLog_01-04-2022 015922 AM.txt", you can see an object lesson of my logged HR data for indefinite dark. The file out "hrAnalysis.html" shows in details how this data is processed and pictured. To modify the code, you motive to unresolved the Jupyter Notebook computer file cabinet, "hrAnalysis.ipynb", in Jupyter.

In this example, HR was logged during 6 hours and 27 minutes of sleep.

  • The first compute shows the HR logs and the downtimes; it is down 1.7% of the sentence and the number of downtime instances is 115.
  • The second figure shows the histogram of the HR logs; the dwarfish bump at 5 are the downtime events.
  • The third see shows the HR logs without the downtime instances.
  • The fourth figure shows the histogram of the downtime events.
    • The shortest downtime event was to a lesser degree a second and the longest was 18 seconds long.
    • The alert delay, "Alert D", was set to 5 s happening the App. By setting "Alert D" to 20 s, exclusively one downtime event would have triggered a inharmonious affirmative alarm (5 s + 18 s > 20 s).

"AlertD" applies a stay merely to downtime events. If the HR value falls below the lower threshold, but is not associated with a downtime event, the alert will cost triggered without delay; same thing when HR goes supra the top verge, there is no delay. This can naturally be changed in the code.

Here, the HR mountain chain was set to [30, 100]. During the night, a couple of seconds were washed-out below the lower threshold, and the upper berth threshold was crossed 6 times, each time for a few seconds (2s, 3s, 5s, 3s, 4s and 5s). Greenbac that I am not familiar to ingest whatsoever heart related issues or conditions that may impress its rhythm.

Phone's battery charge: before = 100 %, afterward = 87 %; with the phone remaining connected to its charger throughout the transcription. This means that the App consumes the phone battery faster than the phone crapper recharge it.

Circuit's battery charges: before = (8.27 V, 8.32V) , after = (7.4 V, 7,54 V). Arduino necessarily a voltage source between 7 and 12 Volts; below 7 volts, the circuit volition get on unstable. Presumptuous a linear model for the use of goods and services of the charges, the batteries could have powered the circuit for an additional 2 hours.

Tread 6: To Do

  1. Possibility to email automatically the HR logs when the "Stop" button is ironed.

  2. Pulse reading is sensitive to consistence motions. An orthopedic stabiliser helps, but it would be nice to deliver a gyroscope chip inserted in the stabilizer to better handle and understand the motion artifacts; see double in a higher place.

  3. The graphic visualization of the pulse occasionally has some grading issues. As part of the AppInventor library, IT would represent useful to spring up a robust component to display material-time 1D signals. Not only it could facilitate the visualization of the pulse or the Hour, but also the visualization of EEG channel output , galvanic peel response, motion, temperature, pressure, ...

  4. Possibility to log on the phone the raw pulse data for latter analytic thinking; it would require a modest add up of changes to the App's code and, in comparison to logging HR data, about 10 to 20 multiplication the amount of storehouse on your earphone. Observance and storing the pulse for a fewer minutes would probably not impact the lap's batteries significantly; for a hale night nevertheless, it would likely be a different story.

  5. Evaluate the power consumption of the circuit under different circumstances.

  6. ...

Step out 7: Root Code and Comments

Arduino, AppInventor and Python origin code can be found on GitHub.

To modify and run the arduino code, in addition to have an arduino board, you need to install happening your PC the Arduino IDE. You will also call for to have some basic knowledge of the C scheduling language; you bathroom retrieve a lot of online tutorials.

You give the sack directly install the App on your Mechanical man headphone by downloading to your phone the "ZazHRM.apk" file found on GitHub. Some other way is to load happening your PC the source code in the AppInventor environs: go to the App page, click "Load App into Massachusetts Institute of Technology App Inventor" and, as shown at the beginning of the demo TV, load the App to your phone via a QR cipher. In order of magnitude to scan the QR code, you also penury to install from Google Play Fund the MIT AI2 Fellow App on your Android speech sound. To see the comments in the AppInventor code, you want to push on the question mark located at upper left corner of some blocks. If you find it intimidating to directly modify the App, maybe you tush first of all enjoy doing a few tutorials.

For the Python code, you can take a look at the html single file, hrAnalysis.html. To modify the codification you need to install Python and Jupyter, or an Anaconda release. Python is easier to learn than C, and you can also find a lot of online tutorials.

Step 8: Warnings

ZazHRM is non a medical device nor is IT motivated for aesculapian diagnosis and is provided to you "As is," and none express or implied warranties are made whatsoever with respect to its functionality, operability, or use, including, without limit, whatever implied warranties, fitness for a specific purpose, or infringement.

ZazHRM is designed to take power from a humbled­-electric potential DC source, i.e. 9 volt batteries. The Arduino Uno board needs to be connected to a laptop while uploading the code from the laptop to the Arduino Uno board, Beaver State when experimenting (for example) to compare the quality of the signal between the App and the Arduino environment. NEVER link the PulseSensor to your body while the laptop computer is plugged to the wall electrical outlet.

ZazHRM is not intended to represent comprehensive in terms of required design­, marketing­, and/or manufacturing ­related protective considerations, including product safety and environmental measures typically found in end products that united semiconductor components OR gate boards.

Be the First to Share

Recommendations

  • Anything Goes Contest 2022

    Anything Goes Contest 2022