Capturing heart rate from USB ANT+ dongle and chest strap
28 views (last 30 days)
I'm trying to figure out the simplest way to acquire data live from my heart rate monitor (chest strap), which communicates wirelessly with the PC through an ANT+ USB dongle. I really don't know much about drivers but I think I have to use the Instrument Control Toolbox and make a Matlab driver for this? Unless the Data Acquisition Toolbox can get the USB data directly? Any tips would be appreciated!
Edit3: As explained in an answer below, some ANT dongles can work with virtual COM port drivers, and thus Matlab can interface with them as a serial port. Unfortunately, the chip in my device is Nordic nRF24AP2-USB which includes USB and does not provide a VCP driver. Thus to interface with it I need to use their API. The way I think I can do this is with MEX files, but I'm still wondering: does the Instrument Control Toolbox provide anything that would make this easier?
Star Strider on 21 Jul 2014
You don’t necessarily have to use the Instrument Control Toolbox or the Data Acquisition Toolbox. You didn’t say what OS you have, but if you plug the USB dongle into your computer — and the Force is with you — Windows should find the driver for you and install it. (You may have to try different USB ports. All of mine function correctly, but for some reason, only the ones on the right side of my relatively new HP laptop will trigger the Windows search behaviour.)
Set the USB interface up as a serial port. See the Serial Port Devices documentation for details.
I didn’t do exactly what you are doing, but about five years ago I got a fingertip plethysmograph (measures pulse contour, oxygen saturation, heart rate, and a few other things) that had limited offline data storage and a direct connection with a USB cable, and after finding the details of the hardware and its communications protocol online (PDF documentation from an Internet search on the hardware Windows identified), was able to get all the information from the device and display it in real time. I had to do a lot of experimenting, but I got it to work.
I have a couple routines from that effort that may help get you started. I’m attaching them here for your reference. (Unfortunately, I don’t remember the details of the logic behind them. I believe I got some of the information in them from the hardware and driver documentation, so it’s best you use that information for your hardware and driver in your application.) They were written for a Windows 7 machine in R2009b, so there could be version differences as well.