Shop OBEX P1 Docs P2 Docs Learn Events
heart rate monitor Receiver — Parallax Forums

heart rate monitor Receiver

BlueClementsBlueClements Posts: 1
edited 2009-02-19 03:34 in BASIC Stamp
First let me say that I am very new to electronics. I have gone through most of the "what's a microcontroller?" text over the course of the past few weeks, but that is the extent of it.

I am trying to make a project using a heart rate monitor and receiver. The basic idea is that the position of a servo will be directly related to my heart rate. I have a transmitter strap which gives off a 5 MHz pulse with every heart beat it detects and I just bought this receiver circuit: http://www.sparkfun.com/commerce/product_info.php?products_id=8661


Honestly, I don't totally understand this thing. There are several options to attach it to a computer, and I think that for the basic stamp I want to use the logic-level physical interface. So there are four slots (I don't know the right jargon) Marked 5V, GND, RX-I/SDA, and TX-O/SCL

What I assume should happen is that I connect "5V" to the Vdd and GND to Vss, then can the RX-I and TX-O attach to any of the slots P0-P15? Does the basic stamp receive a "on/off" type signal from the receiver circuit?

I hope that these questions make sense. I'm not totally sure what I am dealing with and the manuals for the basic stamp and the Heart rate monitor interface are not helping.

Thankyou,

Blue

Comments

  • TMGTMG Posts: 6
    edited 2009-02-19 00:53
    I don't have a clue how to help on your project, other than to say that I'm a beginner as well. By the time we both understand all of this, no doubt we will be rich beyond rich - right! Anyway, stick with it - good luck.

    Terry
  • FranklinFranklin Posts: 4,747
    edited 2009-02-19 02:19
    Looks like you need to talk to the device using TTL serial or !2C protocol. check the stamp manual for serin and serout for the TTL stuff.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-02-19 03:34
    BlueClements said...
    Honestly, I don't totally understand this thing. There are several options to attach it to a computer, and I think that for the basic stamp I want to use the logic-level physical interface. So there are four slots (I don't know the right jargon) Marked 5V, GND, RX-I/SDA, and TX-O/SCL

    Page 10 and following of the manual (on the Sparkfun site) tell you how to set up the jumpers to select serial or I2C:

    "Without a jumper across OP0 the micro-controller communicates
    using a serial interface through either the Logic-level connector or USB connector. With a jumper across OP0 the microcontroller
    communicates using the I2C protocol."

    Both are interfaces that you can use with Stamp modules. Serial is, as you suspected, probably the better way to go, which means you should leave the jumper off of OP0.
    BlueClements said...

    What I assume should happen is that I connect "5V" to the Vdd and GND to Vss, then can the RX-I and TX-O attach to any of the slots P0-P15? Does the basic stamp receive a "on/off" type signal from the receiver circuit?

    Yes, power the receiver with 5v and ground as you suggest. You'll need to use the same ground, at least, as the Stamp is using, and I suspect you can use 5v from the Vdd from your Stamp as well.

    Once you do that, the Rx and Tx lines are used with SERIN and SEROUT on the Stamp to communicate. You'll need to set jumpers to set a Baud rate, per page 11 of the manual. Try 2400 first. You'll need to use the same settings with your SERIN/SEROUT commands on the Stamp, so 8N1 2400 would be 396 on the BS2 (see the PBasic manual sections on SERIN and SEROUT to pick the right codes, or just ask here again). The "Operations" part of the receiver's manual (p. 20ff) tells you about how to communicate with it. Try sending (SEROUT) "G3", and then receiving (SERIN) the next 5 bytes.

    (no guarantees on the exact code - there's always some "tweaking" that has to happen to get these things to work right)
    TXPin Con 3  <-- or whatever pins you're using from the Stamp
    RXPin Con 2 
    
    S1   Var Byte
    S2   Var Byte
    HR1 Var Byte
    HR2 Var Byte
    HR3 Var Byte
    
    SEROUT TXPin, 396, [noparse][[/noparse]"G3"]
    SERIN RXPin, 396, [noparse][[/noparse]S1, S2, HR1, HR2, HR3]
    Debug ? Dec S1, cr
    Debug ? Dec S2, cr
    Debug ? Dec HR1, cr
    Debug ? Dec HR2, cr
    Debug ? Dec HR3, cr
    



    You should get two status bytes (see page 26 of the receiver's manual) and three heartrate numbers (see p. 21 of the manual). Page 23 of the manual lists the commands and the data that some of them return.

    I don't know what you mean by "a on/off signal", but I think the answer to that question is "no". You're going to have to send out command bytes and then read in the responses.

    Post Edited (sylvie369) : 2/19/2009 3:59:47 AM GMT
Sign In or Register to comment.