Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 08:14 08 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Maximite heart rate monitor.

Author Message
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5915
Posted: 06:38pm 03 Apr 2014
Copy link to clipboard 
Print this post

First, a bit of history.
12 years ago, about the time I met the lady who became my wife, a regular doctors visit found I had an irregular heart beat. I can honestly say that my heart missed a beat when I met the missus.
It has been investigated over a few years and eventually I was told to come back if it gets any worse.
For the technically minded, I suffered from Ventricular extrasystotes but the sinus rhythm was OK so no major concern.

The one annoying thing was that the funny beat upset most heart rate monitors - like the ones found on exercise machines.

A few months ago I decided to make Maximite Monitor which could chart the heart rate and give me a realistic indication of how hard I was exercising.

I purchased an ear clip type sensor from seedstudio as it came with electronics to output nice pulses for the maximite.



My first attempt was a failure because the output was all over the place. It made no sense at all.

I had an ECG a few days ago and the good news is - my first attempt at programming the monitor was correct after all!
The bad news is the same - my Maximite monitor is right - my heart beat IS all over the place.
For the technically minded, I now have Atrial fibrillation.

The man in the white coat has sent me to another man in a white coat so it might be a while before I know what options there are but in the meantime, the Maximite Monitor will be there to keep an eye on things.

My next project will be to use a micromite to make a portable recorder so I can see what happens when walking uphill.
I also want to investigate the chest strap type sensors. There appears to be some that use Bluetooth and other 2.4GHz and a couple of different 'standards' to sort out. I have ordered one that has a receiver that plugs into the audio input to your iPhone so I am hoping that I will be able to get usable signals that way.

The code charts pulse rate (in yellow) and a running average of the last 12 pulses (in red). The running average was needed because of the erratic nature of my pulse.
' pulse monitor
' 4 Apr 2014
' TassyJim
cls
samples=12
dim av(samples)
setpin 21, 6, beat
setpin 12, 8
beatTime = timer
gosub chart
do
testtime=timer
if (testtime-beattime)>6000 then
print @(1,10) "No pulse detected! "
beatTime = timer
pStart=0
endif
k$=inkey$
if k$="P" or k$="p" then savebmp "pulse.bmp"
if k$="C" or k$="c" then
cls
gosub chart
x=0
endif
loop

end

beat:
beatTimeNow = timer
beatPeriod=beatTimeNow-beatTime
beatTime=beatTimeNow
pulse 12, 40
if beatperiod > 5 and beatperiod < 3000 then
pulseRate=int(60000/beatPeriod+.5)
s= x mod samples
pav=pav-av(s)+ pulserate
av(s)=pulseRate
gosub clr_ahead
print @(1,10) "Pulse rate: ";pulseRate;" "
if pStart>0 then
pixel(x+40,300-pulserate) = yellow
endif
if pStart > samples then
av=int(pav/samples+0.5)
pixel(x+40,300-av) = red
print @(1,25) "Pulse av: ";av;" "
else
pStart = pStart +1
endif
x = (x+1) mod 360
endif
ireturn

chart:
cls
for ys = 0 to 200 step 20
y = 300 - ys
line (40,y) - (400, y), blue
print @(5,y-5) ys
next ys
return

clr_ahead:
line (x+40,300) - (x+50,50), black,BF
for ys = 0 to 200 step 20
y = 300 - ys
line (x+40,y) - (x+46, y), blue
next ys
return


The first screen dump is from a 'normal' heart rate while the second one is mine.






It would be fair to say that the maximite has saved my life!

Jim

Edit: I forgot to add the disclaimer in big letters.
Don't rely on the maximite monitor for critical medical decisions.
If you have any doubt, don't waste time plugging in the maximite - always seek medical help immediately.
Edited by TassyJim 2014-04-05
VK7JH
MMedit   MMBasic Help
 
OA47

Guru

Joined: 11/04/2012
Location: Australia
Posts: 911
Posted: 06:54pm 03 Apr 2014
Copy link to clipboard 
Print this post

Good one TassyJim
 
Keith W.
Senior Member

Joined: 09/10/2011
Location: Australia
Posts: 118
Posted: 10:18pm 03 Apr 2014
Copy link to clipboard 
Print this post

Tassyjim I am very sorry to learn of your erratic ticker.

Your contributions are appreciated. Hang in there.


I am just publishing a story about DDS on thebackshed with you in mind as likely having experience with DDS.

Keith W.
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 11:35pm 03 Apr 2014
Copy link to clipboard 
Print this post

@ TassieJim

I have been considering such a device to monitor and log my pulse concurrently with infra sound in my surroundings. I haven't looked into it yet so do you have any idea of the pulse detection technique?
David M.
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9067
Posted: 01:06pm 04 Apr 2014
Copy link to clipboard 
Print this post

  Jim said  12 years ago, about the time I met the lady who became my wife, a regular doctors visit found I had an irregular heart beat. I can honestly say that my heart missed a beat when I met the missus.


Awwwwwwwwww - how sweet.

Women certainly can have that effect, it's true.(making your heart jump when you meet the right one(or the one you think is the right one!))

Interesting utility, Jim - take care of yourself...
Smoke makes things work. When the smoke gets out, it stops!
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5915
Posted: 03:31pm 04 Apr 2014
Copy link to clipboard 
Print this post

@MOBI
I am having trouble getting to Seeedstudio web site at the moment but their wiki is OK

This is the module I am using.
http://www.seeedstudio.com/wiki/Grove_-_Ear-clip_Heart_Rate_ Sensor

It works by passing light through your ear/finger and the varying amount of blood in the path varies the output. The smarts in the box convert it to a pulse.

I have an old monitor from an exercise bike and it uses discreet components in the receiver module so I might be able to do some reverse engineering.

Having the clip on your ear for any length of tome is a bit uncomfortable but if you have it on the finger, typing is difficult and any movement cause it to go crazy.

There are sensors for the finger which also measure the oxygen content in the blood. I think they use colour to do that.

I have ordered a chest strap sensor similar to this one (now discontinued)

http://www.seeedstudio.com/wiki/Grove_-_Chest_Strap_Heart_Ra te_Sensor

I should be able to come up with a receiver that allows you to buy just the strap but the combo I ordered is about $35 so it's the easy way to do it.

If anyone wants to test the program without a sensor, a 10k resistor from pin 21 to ground and a push button from pin 21 to 3.3V will do.
Press at about once per second.

An LED on pin 12 will give visual feedback.

Jim

Warning - the links above will have the usual extra space in them.




VK7JH
MMedit   MMBasic Help
 
MOBI
Guru

Joined: 02/12/2012
Location: Australia
Posts: 819
Posted: 04:27pm 04 Apr 2014
Copy link to clipboard 
Print this post

@Jim

That is about what I imagined. The clamp looks like it would be a bit fierce on the ear after a while.

I think I'll wait and see if you come up with a bit of reverse engineering before diving in.

It would be nice to see more of an analogue display rather than just short duration digital pulses. I wonder if a strain gauge of some sort could be used to measure pressure variations?
David M.
 
Warpspeed
Guru

Joined: 09/08/2007
Location: Australia
Posts: 4406
Posted: 10:13pm 04 Apr 2014
Copy link to clipboard 
Print this post

  TassyJim said   F
I suffered from Ventricular extrasystotes but the sinus rhythm was OK so no major concern.

If you have a good strong sinus rhythm, why not use a proper ECG amplifier ?

Finger and ear plethysmographs are o/k, but as you have discovered, they can either become painful after a while, or get in the way.

Plenty of pretty simple ECG circuits posted on the internet.
Any chemist will have ECG electrodes.

An alternative would be one of those heart rate monitors athletes wear. These consist of a chest strap with built in electrodes and a low frequency transmitter, usually around 30Khz.
A wrist heart rate monitor that looks like a watch displays heart rate.
If you want to hook that up to your computer, you need to build a simple 30Khz radio receiver using a ferrite rod antenna.
Cheers,  Tony.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024