Shop OBEX P1 Docs P2 Docs Learn Events
How to read a heart rate monitor — Parallax Forums

How to read a heart rate monitor

Tom FTom F Posts: 59
edited 2007-07-11 12:59 in BASIC Stamp
For a hobby project, I'm trying to find a way for a BS2 to read the 5khz output from a heart rate monitor used in gyms, like this one: link

I've found a (5 year old) site (link) that shows what the 5khz waveforms look like and even provides a circuit design.

Somehow I'd thought that a Hall effect (like the Melexis 90217) would be able to pick up this signal, rather than having to go to the trouble of building and understanding how to use the circuit that the above link's parent shows. (I'm not very experienced in circuit building and debugging, so I'm hoping for a simpler solution.)

Thus far, using this code:

Main:
COUNT SpeedIn, 5000, Pulses ' 5 second sample
BPM = Pulses * 12 ' BPM is beats per minute
DEBUG DEC BPM, CR
GOTO Main


I haven't been able to detect the signal with the 90217. Waving the magnet past the device, I'm able to get lots (in fact far more than I'd expect) counts.

Do you think I should be able to use the 90217 in this application? Would I need the bias magnet attached to the 90217 in this use?

Any suggestions on how to proceed (even using a alternate sensor) would be appreciated.

Thanks in advance

Tom

Post Edited (Tom F) : 4/2/2007 7:37:29 PM GMT
«1

Comments

  • Mr.EdMr.Ed Posts: 35
    edited 2007-03-19 00:32
    Tom,

    I think we share interest in the same subject. I suspect that the Hall sensor is not the way to go because the signals from the heart rate belt are not suitable for this sensor. I think (complete lack of) magnetism and poor signal strenght are the main reasons for this. But lets not get into this too much. I'm no scientist.

    However, i am considering buying a sensor from : http://www.vernier.com/··· (look for the "HR-REC" sensor).

    It is "affortable", easy to connect and i have seen similar projects using this sensor. For this you have to google for "vernier heart rate receiver" and then look for pictures. Then you'll see what i mean.

    Let me know if you achieve some level of succes with your project.

    Best regards,

    Ed.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...

    Post Edited (Mr.Ed) : 3/19/2007 12:37:31 AM GMT
  • Tom FTom F Posts: 59
    edited 2007-03-19 02:20
    Wow, Ed! That's a great find!!!! It looks, from their low-res pix of the HR monitor, that they sell the Polar chest strap so they intend the sensor for it.

    Have you found any specs on the outputs from the sensor? It appears that they intend it to drive their own receiver?

    I'm not a hardware guy, but if we could find a schematic or spec for its output, that would be a good first step!

    I'm excited to be taking this project off the back burner!!! I'd pretty much given up on it. My BS2 has been sitting idle, waiting for something to catch my attention again.

    Tom

    PS By the way, my Progressive Electronics line tracer Inductive Amplifer picks up the chest strap signal wonderfully. I'm not sure my wife was too impressed when I came upstairs, no shirt, chest strap on, with the somewhat suggestive probe flashing and beeping, "Hey, honey, look what I got to work..." For a coarse pickup, you could just tape a photosensor to the device...

    Link to line tracer: http://www.partstore.com/ProductDetail.aspx?ProductSKU=8253593&s=youramigo
  • Mr.EdMr.Ed Posts: 35
    edited 2007-03-19 03:41
    Tom,

    Funny. I only responded to your thread because i started a search for heart rate monitoring. It might not have been answered otherwise. I'm glad it sparked your attention. Let me explain my own goals here. I want to do something that has allready been done by a few manufacturers. One of them is www.FRWD.fi in Finland. They make portable recorders wich record GPS position, Heart rate, Air Temperature, Air Pressure, Altitude, Speed and·heading. This can be plotted in Google Earth, for instance. But it comes with a price and some limitations.

    I take it slow, one step at a time. I'm just aiming for GPS (with all its variables), with maybe some GSM variables (like cell number and signal strength) and Heart rate. I do a bit of sport, like running and Snowboarding. That explains it a bit. I have about average experience with the Stamp. I finished a project in which a led-display can be instructed with an SMS, or by input from a Web page. On the display, time, date and temperature is displayed as well.

    Back to the heart rate receiver. The specs, though very little, are on the mentioned website. It is stated there, that it runs on 5VDC. So i suspect that the receiver returns 5Volt pulses. But it might be a bit lower than that. You can feed it straight into the stamp. Should be easy. The range is about 80 to 100cm. So as long as you keep the Basic Stamp box in a pocket on your body, it should work just fine.

    I'm at work right now. As soon as i·get home, i will try to place an order for one of those receivers. Keep me posted if you succeed!

    Ed.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Tom FTom F Posts: 59
    edited 2007-03-19 05:30
    Hi, Ed,

    I just ordered mine!

    My intended use is similar to yours: to track my aerobics workouts. Yes, Polar and others sell watches that can upload recorded pulse and other info (like GPS location, etc)... but, of course, doing it yourself is more fun! For years I've had the thought to build something like you are (for tracking my cycling rides). One of the things that put me off was the need to put more RAM on the Stamp board. Capturing an hour's worth of heart rates at, say, one capture every 5 seconds, will pretty much be all that can be stored w/o more RAM.

    Anyway, let's keep in touch. The next week or two should be fun!

    Tom
  • Mr.EdMr.Ed Posts: 35
    edited 2007-03-19 16:16
    Tom,

    I ordered mine few minutes ago. In fact, i ordered two. One to take on the road and to modify (shorten the lead, place in portable housing), one to keep (intact) in "the lab", near my internet PC. Should be fun too, measuring while surfing or playing a game. lol.gif

    Ah, the all-important RAM. I (hope to) have that covered too. Check out www.sddatalogger.com (SD RAM up to 32MB) and www.vinculum.com (vdrive2 for USB-sticks up to many GB's). Still in the process of trying to order the one from sddatalogger. They don't accept payments via Paypal from foreign customers. I hope that it will be solved soon. The vdrive2 is allready in the mail somewhere. yeah.gif

    The thing with the professional stuff is, that it cannot be altered to my likings and support is often very minimal. If i can keep the dimensions as small as possible, i dont mind carrying a Basic Stamp along. If it breaks down, i can fix it. If i stop using it, i can take it apart and use it for something else. All the known advantages. smile.gif

    I am trying to think ahaid and come up with a piece of scripting that can "measure" a certain amount of pulses in a certain amount of time. Timekeeping is quite important here. I'm thinking of using the timestamp in the GPS string. Need a very good GPS receiver? Check this out : www.coolcomponents.co.uk. They sell a great receiver with the SirfIII chipset, sensitive up to -159dbm. It can get a fix inside the house. smilewinkgrin.gif

    Enough said for now. Tonight working the late shift. I'll check my mail then, to see if you have been thinking ahaid too tongue.gif .

    Ed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Tom FTom F Posts: 59
    edited 2007-03-20 17:58
    Two URLs from their site on this device, if you didn't see them.

    www.vernier.com/probes/ehr-bta.html

    www2.vernier.com/booklets/ehr-bta.pdf

    From the graph they show, the output is not just a binary on-off. I'm sure there's a way to count this kind of wave-form, but don't know what it is.

    And, I'm not sur where to find a British Telecom analog connector! Of course we can cut it off, unless their wire is some of that awful twisted foil stuff!

    Their support staff confirmed by email earlier as I suspected (and the above links show) -- these work with Polar pickup. (Note of caution: Polar makes, I believe, two types of pickups: uncoded and coded. The coded one is designed to cut down on interference from other nearby monitors' signals. If you're thinking about purchasing a pickup, I'd suggest the uncoded for this application in case the coded signal isn't as easy to process...)

    Tom
  • Tom FTom F Posts: 59
    edited 2007-03-20 18:15
  • Tom FTom F Posts: 59
    edited 2007-03-20 20:59
    The link below is the the best cable that Vernier's tech support could suggest for a DIY project. It's an extension cable off of which we could cut the male end.

    www.vernier.com/accessories/access.html?ext-bta&template=basic.html

    Of course if you don't mind the permanency of it, you can just cut off the male connector that comes already on the monitor and deal with the wires as you wish...
  • Tom FTom F Posts: 59
    edited 2007-03-23 02:43
    >> I am trying to think ahead and come up with a piece of scripting that can "measure" a certain amount of pulses in a certain amount of time. Timekeeping is quite important here.

    For HR measuring, why would time be that important? THE BS2 surely can do counts over five or ten seconds with enough accuracy. The command: COUNT PinIn, 5000, OutputVariable should be adequate, although an even longer sampling period would increase the accuracy, or at least the precision, so the readout doesn't bounce all over the place due to minor clock or pickup errors.
    I’ve been thinking that missing one beat over 5 seconds (due to it falling just after the period's end), for example, would mean that the read-out would drop by 12 BPM one period, and then in the next period the readout would jump by that amount. I suppose there's a whole field of knowledge on averaging readings to smooth the readout...

    If you need time for the GPS stuff you're planning to do, I guess I was thinking that GPS data included clock information.

    Also, I'm planning to use the Hall effect for a cadence pickup! What I’d really like is a way to pickup power output from the crankset, but that’s a lot more machining and engineering than I’m capable of!

    My unit arrived from Vernier today (I'm just a few hour drive from them!) and tomorrow the cable with connector will be delivered. I'll try the COUNT command then and see if it works!

    Where'd you disappear to?
  • Mr.EdMr.Ed Posts: 35
    edited 2007-03-23 20:19
    Tom,

    I didn't forget this thread. I was getting prepared for a week of holidays.

    I'm off to go skiing for a week in France. De HR receiver is still on its way, so by the time i get back, it should be here somewhere. I will be bringing a laptop and a basic stamp along with me, so work will go on.

    I will keep you posted as soon as i have results worthy of showing.

    Best regards,

    Ed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Tom FTom F Posts: 59
    edited 2007-03-24 16:57
    Hi, Ed,

    So I've got my hardware now and will play a bit this weekend.

    I don't know what the "Vres" (pin 3) "resistance reference" line is.

    Regarding conditioning the signal: I have no idea what your background is in all this. You may be well educated in electronics and way ahead of me. And/or you may want to take a look at Chapter 3 in the Process Control Parallax course. www.parallax.com/dl/docs/prod/sic/Web-PC-v1.0.pdf It has a simple design using an ADC to read an analog signal.

    I plan to try reading the sensor directly first, but it strikes me that it might be that the ADC will provide more robust results, since we can adjust the input threshold level down to a level where the spike from the sensor is wider. The Vernier docs for the HR sensor talk about noise from clothing (or other HR transmitters, which I'll be near in my gym's spinning classes where I plan to use this.) So, maybe some additional noise filtering circuitry will be necessary?

    Clearly I'm more enthusiastic than knowledgeable here! blush.gif

    Tom
  • Mr.EdMr.Ed Posts: 35
    edited 2007-04-01 20:34
    Ok Tom,

    I'm back... A bit more tanned and really exited about the developments·in the HR project sofar...

    Let's put it this way, i'm· not quite a newbie regarding electronics. Mostly i'm into HF radio applications / gsm radio technology. As a hobby, i'm being busy with CNC machining and the electronics involved with it. One could say i have a very wide range of knowledge about anything, but no specialisations on any part. I do a lot of things mechanically and electronically, but i am not specialised in anything. Learning all the time.

    The main goal that i have in mind right now, is that i want a certain amount of accuracy, within a reasonable amount of time. Period. I want to log HR and position and i want it frequent. I cannot allow measurements of more then 10 seconds, because i would be 50 meters down the road after one measurement. That is, when running. Driving a car would demand even faster measurements. As stated in the private message, my greatest concern was to have low resolution, with short measuring times. A·contradiction when using the COUNT command. Anyway, i want to achieve both, if possible.

    If i use the COUNT command, and i count for 10 seconds, i get for instance 10 pulses. When i multiply this with 6 i get 60 pulses per minute. But when HR goes up by only 1, the result will go up by 6. When i count a shorter amount of time, resultution will go up. Less sensitivity. Not a good thing, but i need speed. When i count longer, resolution will go down. But updates of HR will then take a longer amount of time. Not a good thing either. So in all, i doubt if counting for a certain amount of time is a good thing. Maybe, it's better to just count, for instance, exactly 5 pulses, and then measure the amount of time it took and then calculate how much pulses will go into 60 seconds. But the BS uses integers, and i'm not experienced when it comes to exact calculations with the BS.

    I am eagerly awaiting my sensor wich should be in the mail and hopefully i will receive it the upcoming days.

    Let's keep in touch.

    Ed.





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Tom FTom F Posts: 59
    edited 2007-04-01 22:26
    Ed: My HR sensor arrived about 3 days after I ordered it. Happily, I live in Seattle, WA, only a few hour's drive from Vernier!

    Okay, I'm with you now: we need a timer so we don't tie up the BS2 in a COUNT command. I'm sure there are timer chips that are easy to use and cheap. We need a chip that we can just read the time (in MS) whenever we want.

    I'm sure there's a good chip for the job that someone will suggest. Something cheap, low power, minimal extra components, and easy to communicate with. Then, is this code what you're thinking?

    Start:

    DO
    Loop until IN0 = 1 ' Wait for leading edge of signal

    ' Get time1 from some chip

    DO
    Loop until IN0 = 0 ' wait for trailing edge of signal

    DO
    Loop until IN0 = 1 ' wait for start of next beat

    ' Get time2 from some chip

    ' Time2 - Time1 is the duration of one heart beat (typically .3 to 1 second). We have to do the math to convert this to BPM. We could also average this with preceding times, etc.

    ' Do anything else we want to like GPS, etc

    GOTO Start

    I was wondering if an RC circuit and a DAC would work as a clock. Start charging the RC circuit at time1. Check it's voltage at time2 and do the math.

    I'm sure I'm re-inventing the wheel here and someone will jump in and straighten me out.
  • Tom FTom F Posts: 59
    edited 2007-04-02 05:05
    Further progress, Ed! I decided that I'd try using the processor itself as a timer by just counting in a loop.

    Then I empirically derived the formula to calculate BPM from the counter value. This was done by collecting data on the HRM by running in place and noting the readout of the HRM monitor watch. (My wife came downstairs at one point to ask what the noise was. She collapsed in laughter at me, running in place, lifting hand weights (actually a hammer and plane, the best "free weights" I could find at the moment, jotting down read-outs from the watch and the Debug window!)

    The attached file "BS2 Loop to wrist monitor.jpg" shows the raw data and the least squares match for the line. Yes, the data is messy and I need more points at higher heart rates. The y-intercept of the line shows that at BPM of 180, the loop count goes to zero, which either means I'd be dead ... nono.gif ... or my raw data isn't good, or that I should be using a different trend line stat... like a log. I don't remember any of my stats. Getting more data at higher heart rates would show me... but it's late and I'm lazy. It's too much work to get my heart above 125.

    I then coded the formula from the least squares line. The BS2 program is attached. You were asking about how to do math. See the comments in the code. I don't know if this is the "correct" way to do this, but the ** operator seems to be working.

    The resulting calculated heart rate graph is in the third attachment. Notice how erratic the heart rate is. I think we need to smooth the data -- a running average across several points might help??? Also, we can throw away any point that is too far from the preceding point, except at startup!

    Yes, this is all empirical. It depends on the BS2's clock being consistent. And I need more data to get a better trend line! Or I need a clock chip!

    One nice thing about this approach is that just before the "Goto" at the end, you could do any other processing (like GPS, etc) you like, and then loop around and time the next heartbeat.

    This is fun. Jump in, Ed! That sun tan (where'd you go?) is going to fade!

    Tom

    Post Edited (Tom F) : 4/2/2007 3:25:07 PM GMT
    911 x 390 - 50K
    bs2
    837B
    789 x 467 - 50K
  • Tom FTom F Posts: 59
    edited 2007-04-05 04:23
    I'm looking for suggestions on a way to read time in milliseconds so I can gather heart rate data without the looping (& calibration) I described in this thread.

    It seems to me that I need something like a DS1302, but with way of reading milliseconds, rather than the seconds resolution that I believe is the maximum resolution that the DS1302 provides. Something that is as easy to work with and for which there is ample documentation for a noob like me!

    I don't need the clock calender or RAM function of the DS1302.

    Any suggestions on how to proceed? What other ways are there to get milliseconds elapsed time between two events on a BS2?
  • Mr.EdMr.Ed Posts: 35
    edited 2007-04-05 21:24
    Tom,

    I've been very busy this week with other stuff, but i have been able to work a little on the HR monitor project. I have been succesfull in making the Vdrive2 to work. I now have a Basic Stamp with 1GB USB storage RAM. I am thrilled! So, storing large files such as comma seperated volumes is now a piece of cakeyeah.gif

    Unfortunately the ordered HR sensor from Vernier is still in the mail somewhere. I was hoping it would get here sooner.·On the 15th of April, the Marathon of Rotterdam will be held, and i will be running a quarter of that distance. I'm planning of taking a basic stamp along, logging position and Heart Rate. I know i am being VERY·ambitious here·but one has to set some goals in his life smile.gif· (a bit off topic: For that day i'm being sponsored by friends to support the World Cancer Research Fund at www.wcrf.nl. If interested, look for the sponsor page and my name, Edwin van Brugge).

    Tom, could you do me a favour, and measure the exact size of the HR sensor? I'm planning on building it on·half a Euro card. That is about the same size·as a Super Carrier board. So the board will hold a Basic Stamp BS2P24 with power components, a GPS receiver from coolcomponents, a Vdrive2, a HR monitor from Vernier and two battery packs on the back side to hold 6·rechargable penlites rated 2700mAH. So i need all the space that i can arrange on that board. Afterwards i'm planning on plotting the whole log into Google Earth.

    I'm sorry that i am not very helpfull with the millisecond counting / measuring part. I have put that part asside, because i have put counting that accurate on hold. Milliseconds and Basic Stamp, i doubt if it can be done. I am more for the aproach of taking time·from DS1302 or GPS, counting exactly 5 pulses, taking time again, calculate difference in seconds, rounding up to whole seconds and then multiply by 12. I think the trick still is, to count exactly a certain amount of·pulses, and estimate time, rather then counting for a certain amount of time. There is a difference. I reckon the first approach is a bit more accurate. (Please bare in mind that i am no expert on this part. (Autodidactic, try and learn along the way).

    Ed.







    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Tom FTom F Posts: 59
    edited 2007-04-05 23:41
    counting exactly 5 pulses said...

    If your heartbeat is 120 beats per minute, that's two per second.

    Five beats will take real time 2.5 seconds. If you note the time before and immediately after five beats, if your timer resolution is only one second (as is the case, I believe, with the DS1302), your measured elapsed time will be TWO seconds. You'll calculate beats per minute as 30 times 5 equals 150, which is a big difference than the real 120.

    In my opinion, you'll need to sample for considerably longer than five beats if your timing resolution is only one second. Or get a clock with higher accuracy.

    I'd be happy to donate to your running effort. I was unable to find a link to donate in your name ... only general donation. Many events here in the US allow donations in the name of the competitor. If that's the case in your event, can you provide link where to make such a donation. (Here's a link to a fund raising effort I did 3 summers ago www.campparadox.com/stp/.

    Unfortuntately, I'm traveling for the next eight days, so I can't provide the measurements you requested. Sorry.

    Good luck on your 15 April deadline

    Tom
  • Tom FTom F Posts: 59
    edited 2007-04-06 00:02
    It appears that the DS1302 has resolution to hundredths of seconds.

    See this link:

    www.maxim-ic.com/quick_view2.cfm/qv_pk/4359

    However the Parallax link below shows only reading seconds accuracy:

    www.parallax.com/dl/docs/prod/appkit/ds1302rtc.pdf

    EDIT SEVEN HOURS LATER: Oops. Maxim data sheet is for DS1390, not the DS1302. sad.gif My mistake.

    Post Edited (Tom F) : 4/6/2007 5:48:28 AM GMT
  • Tom FTom F Posts: 59
    edited 2007-04-06 00:15
    Table 3 "Address Map" at the link below shows how to get hundredths of seconds:

    datasheets.maxim-ic.com/en/ds/DS1390-DS1393.pdf

    LATER EDIT: Darn! This is the 1393, not the 1302. My mistake. The reason I'm fixated on the 1302 is that I have one that came with the Parallax IC course, and there are good examples provided by Parallax on how to talk to it.

    Post Edited (Tom F) : 4/6/2007 2:30:19 PM GMT
  • Tom FTom F Posts: 59
    edited 2007-04-06 05:29
    Ed:

    The Industrial Control text has a great example of how to use the DS1302. Pdf is here: www.parallax.com/detail.asp?product_id=27341 starting on page #189.

    The discussion includes (page #199) how to work with BCD and further on (page #204) , there's some discussion that may be helpful about data logging using the EPROM.

    With this text, and the chip with the necessary crystal, we have everything we need to time "x" beats and determine the elapsed time in ms.

    The IC pdf code to read the chip is below. Not sure yet how to modify it to read hundredths of seconds:

    ReadRTCBurst: ' Read all data from RTC
    HIGH RTCReset
    SHIFTOUT RTC_IO, RTC_CLK, LSBFIRST, [noparse][[/noparse]%1\1,BrstReg\5,%10\2]
    SHIFTIN RTC_IO, RTC_CLK, LSBPRE, [noparse][[/noparse]Seconds,Minutes,Hours]
    LOW RTCReset

    Also see: http://forums.parallax.com/showthread.php?p=531080

    Post Edited (Tom F) : 4/6/2007 5:37:02 AM GMT
  • Tom FTom F Posts: 59
    edited 2007-04-06 14:49
    Well, I'm not sure the forum is the best place to showcase my stumbling around, but this morning I found the attached table in Maxim DS1302 specs indicating that hundredths of seconds are available on the DS1302. Link: www.maxim-ic.com/quick_view2.cfm/qv_pk/2685

    However, in Table 2 in this DS1302 data sheet datasheets.maxim-ic.com/en/ds/DS1302.pdf I can't find any discussion of the hundredths "hh".

    I've emailed Maxim tech support asking for clarification. (Is hh maybe the lsb or msb of the hours field?)
  • Tom FTom F Posts: 59
    edited 2007-04-17 15:11
    Maxim tech support cleared up my confusion. Although the column heading on the spec sheet for the DS1302 has a callout "hh=hundredths", the body of the spec sheet doesn't refer to this callout. The DS1302 does not support hundredths of seconds.

    However, the Maxim DS1393 is an RTC chip that is similar to the DS1302 (for which sample code and wiring is available on the Parallax site) It has 3-wire serial communication, and (unlike the 1302) it has 100ths of seconds accuracy that I need for the heart rate monitor.

    So, proud of my research turn.gif I went to order (a sample) of my first chip ever! And ... discovered that it only comes in a "uSOP" package, which appears to be some sort of surface mount???

    Does anyone have any suggestions on how to mount this type of chip on the Stamp HomeWork board?

    Tom
  • Mr.EdMr.Ed Posts: 35
    edited 2007-04-25 19:56
    Hey Tom,

    It has been a while, but finally i have some good news.

    I've got my scripting working fine now, recording position every few seconds on a USB stick. Secondly, the good news is that today my HR receivers came in!

    So now i can push ahead with this project. I suspected the HR receiver to have a DIN plug attached to it. Instead it is an exotic type wich is not familiar to me. Do you have the coloring sceme worked out?

    How is your project coming along?

    Ed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Tom FTom F Posts: 59
    edited 2007-04-25 20:10
    Ed,

    I've attached the pin-out I'm using. I cut off one end of the male-to-female extension cable they'd sent me, and then pried open the female connector itself.

    I'm stalled on the project. I haven't gotten an answer on how I might mount a uSOP chip on a breadboard. There no doubt other RTC chips (even some from Maxim) that will yield 100ths of seconds data, but given that we have code and explanations on using this chip here on the Parallax site (& I've got a crystal that came with the Industrial Control curriculum here), I've been hoping to find a way to use the DS1393 sibling chip...

    Also building a cloud chamber and a magnetometer, but those don't have any electronics!

    How was your marathon? Sorry you didn't get me the URL to which I could've given a donation.

    Tom
    925 x 295 - 34K
  • Mr.EdMr.Ed Posts: 35
    edited 2007-04-25 21:02
    Hi Tom,

    About the donation, thats ok. I think foreign donations would have been a bit of a problem anyway. Thinking about it is just as much valued. Thanks. The marathon was "great". I ran the 10KM in 01:09:52 under tropic conditions. Few minutes later the marathon was canceled because of the difficult circumstances.

    This evening i have been working hard on your request on how to handle the uSOP chip. For that i have one hint: www.jameco.com They have interesting adaptor PCB's. This way i ordered TSOP to DIL adapters in the past. But unfortunately these·are for 8 pins. I couldn't find 10 pin uSOP to DIL adapters YET, but you never know, they might have something...Check it out and let me know...

    I'll get back to you on this. I will keep an eye out for uSOP to DIL adapters.

    Good luck,

    Ed.

    EDIT: TOM, I THINK YOU NEED THIS : http://www.crownhill.co.uk/product.php?prod=1234
    (now go find one·smilewinkgrin.gif·)



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...

    Post Edited (Mr.Ed) : 4/25/2007 9:17:00 PM GMT
  • Tom FTom F Posts: 59
    edited 2007-04-29 23:44
    Found one here in the US just now: www.epboard.com/eproducts/protoadapter.htm#MSOPtoDIPAdapter

    Thanks!!
  • Mr.EdMr.Ed Posts: 35
    edited 2007-04-30 13:45
    Ok Tom, Good job!

    I applaud your attempt of finding an accurate measuring setup. I will follow your achievements closely. However... I have come up with an alternative to consider...

    What i want to try is this. I can live with measuring times of up to 20 or 30 seconds. But if the Basic Stamp is left counting for that long, my positional logs are halted that long as well. So, what i consider is leaving the counting up to a DS2423. Then, i grab the timestamp from GPS, grab the first count, then do a lot of positional logs, and finally grab a second timestamp from GPS, and grab the last count. Then, the heartrate is easily calculated by means of time differences and count differences.

    This way, i measure every one or two seconds GPRMC and GPGGA sentences, and every 20 or 30 seconds my heartrate. This is fairly accurate with acceptable resolution and still better then my Polar watch, wich records only once per minute when exercising for longer than an hour.

    DS2423 is mentioned a lot in combination with Basic Stamp for measuring windspeed and measuring rainfall. Counting heartrate is not different compared to these examples. DS2423 is obtainable as sample for free at maxim-ic.com

    Best regards,

    Ed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Tom FTom F Posts: 59
    edited 2007-04-30 14:09
    I had been wondering if there was a time-stamp from your GPS unit. Your solution sounds great! Measuring for 20 or 30 seconds of course will eliminate the inaccuracy that the shorter periods introduced.

    I'm debating whether the less frequent an update period will be acceptable to me. When I'm doing 60 second "on", then 30 second "off" wind sprints on the spinning bike, I want to have the updates more often, I think. Updating every 15 seconds (1/4 minute) results in plus or minus 4 beat error when extended out to a minute. That's probably acceptable to me.

    Plus, the great thing about your design with the DS2423 is that it totally frees up the cpu to do the other tasks you have in mind.

    Nice job!

    Of course, as Murphey's Law would have it, I ordered the DS1393, the uSOP to DIP converter, and even paid $8 to have the solder the chip in (rather than my destroying it in my efforts) last night! So, I'll have 100ths of a second accuracy, even if I don't need it! smile.gif

    I was uncomfortable ordering the chip from Maxim as a "sample," since I really couldn't state that my estimated production runs would be greater than 1 per year!

    Do you have any links to articles on the DS2423 with a Stamp?

    Thanks, Ed, for your digging into this. We're on our way! Keep in touch!
  • Mr.EdMr.Ed Posts: 35
    edited 2007-04-30 14:52
    Tom,

    One of my favourites is timbitson.com or try to Google for "DS2423" or "1-wire" and select for pictures. Lots of examples there...

    The DS2423, like your DS1393, is a very small component. For this i ordered the TSOP to DIL adapters from Jameco. I have no difficulties with soldering those small parts onto the PCB's. I simply use a microscope smilewinkgrin.gif .

    The DS2423 is a 6pin component, and·my adapters are for 8pin applications. But that is ok, you just use only 6 pins and have two pins unused.

    In your case, first stick to the DS1393. It's allready ordered. If the DS1393 is not bringing you what you would like to see, then give me your address and i'll send you a DS2423 soldered onto an adapter, for free.

    The GPS has a timestamp that looks like "164123" (HHMMSS). The only factor that we have to keep in mind, is the time delay caused by the Stamp itself, between grabbing the timestamp from GPS, and the count from DS2423. That may cause a measuring fault. Let's just hope that the stamp routines are fast enough.

    Let me know how progress goes along when using the RTC with 10 millisecond resolution.

    Ed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...
  • Mr.EdMr.Ed Posts: 35
    edited 2007-05-02 13:44
    Ok Tom, more news from Dr.Ed, i mean Mr.Ed..... smilewinkgrin.gif

    Latest situation: I've got the heart rate receiver hooked on. I integrated a DS2423 counter and a DS1820 thermometer. All is working now. BUT.... (there is allways a but)

    1. Check your color sceme. My sensor has quite different colored wires. Maybe your extension cable has different colors than the sensor itself. My sensor wire colors are 1)Yellow, 2)Black, 3)Green, 4)Brown, 5)Orange, 6)Red.
    2. Do not forget pull-up resistors when using 1-wire devices. It takes a lot of valuable time to discover this when it's not working.
    3. The pulses from the HR receiver are not 0-5V but rather 0-2,5V.
    4. This HR receiver gives out not one pulse per heart beat, but TWO. Both pulses are exactly the same hight (volts) and length (time). The two pulses represent the two biggest pulses from a standard EKG. Google for this to see what i mean (spike and whobble). All the other pulses/whobbles are unnoticed by this receiver.

    My setup is reasonably ok for now. But it's not perfect. Sometimes the count is way too high, sometimes way too low. At the moment i am counting with an estimate of time, and not a GPS timestamp. A few beats off is ok, but when it is off by 10 or 20 or more, there must be something wrong. I'm guessing that the double pulse is triggering more counts once in a while. The two pulses follow about 100mS after another (i hooked up a scope). This signal is analogue, so maybe i should connect it to an open collector transistor.

    I'll try to tinker some more. When i am onto something, i'll let you know...

    best regards,

    Ed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    A horse is a horse, of course of course...

    Post Edited (Mr.Ed) : 5/3/2007 1:16:34 AM GMT
Sign In or Register to comment.