Saturday, March 29, 2014

Cutting out the middle man


I've had the TI CC2511 Development board laying around for a while.  I was pretty confused by the software for interacting with it.  Compounding the confusion, was that it doesn't play well with Windows 7.  Like most medical tech, since the approval process is drawn out, you're getting obsolete technology by the time the product gets to market.  In this case, the development board software hasn't been updated since 2009.

I was about ready to dust off an XP notebook, but first I took a stab at filling in some of the fields in the RF Studio program.  I was then able to save that configuration, which doesn't get saved in the format that the packet sniffer wants (why?).  Then I opened the Packet Sniffer and manually changed some of the Registers.
And "Poof", it works.


The last two records you see are for 107 and 110 mg/dl.  Looks like glucose raw counts are bytes 12-15.  This is an 8 day old sensor, so expect the curve to be flatter.

I wish I could hook this to a micro controller right now, but this is going to be a challenge.  I'm probably going to have to go through the whole USB sniffing process that I did with the Dexcom to use this device.  Also, I don't yet know if there's a USB Library that will play with this on Arduino.  I wish this came in a non-USB version.  May have to buy the chip and go at it directly.


A shot of the Development board, you can cut off the strip I've drawn an arrow to.  I really want this in a non-USB version.  I can get that in a full kit for around $500.

Tuesday, March 4, 2014

New watch, additional functionality

Trying out an email update today.
Got the dressier version of the Metawatch.

Doesn't match the race bike, but looks better at work.

Predictive feature is being "field" tested.  Number to the right is indicating that I might go over 180 in 33 minutes.  I'm taking the slope of the last 15 minutes and extrapolating out to where I'll be over 180 or under 80.  Also, I'm taking 20 minutes off of the estimate to account for the delay. Higher values indicate steady blood sugar.  Greater than 99 minutes, I don't show anything.

Sunday, February 16, 2014

The final prototype for now

Front View
Back View

Finally got the Teensy Version soldered down.  This is using a Sparkfun bluesmirf, silver, modem.
The switch on the left is for powering from the battery or through a USB port.
The battery is 1350 mAh.  This is good for 11 hours.

This configuration is for use with the Metawatch, which is now working great.  At least 3 days without a charge on the watch, and it no longer freezes.  I would attribute this to the bluetooth dongle.  The Bluesmirf is configured to automatically reconnect.  You do this from the modem itself, don't waste time trying to get the Arduino to do this.  The modem handles ALL of the connection details, you just have a pipe from the Arduino to it to pass information.  I also tried the Bluesmirf "Gold", reconnect never worked, and I didn't notice an increase in range.  It has a much more recent firmware version.

This link is a good place to start for details on how to deal with the Metawatch and the BlueSmirf.  This will get you up to speed on how to program the Modem as well as the watch.  Although this example shows controlling the connection process from the Arduino, don't be tempted.  The BlueSmirf is meant to do that on it's own.

The hardest part of this, software wise, is creating and sending a 96x96 packet representing your display to the watch.

This would be an example of how the binary representation of a few pixels gets turned into Hex, that gets sent to the Metawatch in 16 byte packets.  I found some font definition files on the internet that gave me the Hex for all the numbers and arrows I needed.  
Ex. this is "8":
0x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e

When I finally got this to work, I had a microscopic font, on it's side, and upside down.  After a couple of bit operations, it then took me a while to realize that if I just sent each line twice, I could enlarge the font to a decent size.  

With all that squared away, I'm going to add a small graph and I'm thinking about a predictive feature.  A report of how long it would be before I'm over 180 or under 80, depending on which way the wind is blowing.  Probably will be a up or down arrow, and the number of minutes.




Thursday, January 23, 2014

ANT+ Gizmos

Pursuing multiple threads here.  With ANT+, I can use a sports watch, and Hijack the HR channel.  A watch with HR and Alarms can work perfectly as a glucose monitor.  One late night of googling and I found some posts on ANT+ and Arduino.  Unfortunately the ANT+ development board sold by Sparkfun is long out of stock.  Some more searching and I found a similiar chip was available, but would need to be mounted.  Some photos of how I spent my Saturday.

 All this wouldn't be happening if it wasn't for this site.  First solder 17 very small wires,  started with Cat5, and pulled some strands out to get them through the holes.  Kind of like sewing.



Then, added a pair of pin headers so this would be easier to work with.  Also, these wires can only be flexed a couple of times before they break.  Added copious amounts of hot glue to keep everything from moving around.  I was going to post about the evils of hot glue... Maybe another day.  All this onto a Radio Shack protoboard, and then some love with the dremel.


Finally, Breadboarded and talking to the Arduino.  No problem receiving HR from a Garmin chest strap.  Now I need to figure out how to send a HR value.  Also, a Teensy is underneath the Uno, but the Serial Library's were causing me issues.  Turns out, you can't use SoftwareSerial etc.  You reference your serial ports as Serial1, Serial2 or Serial3.

Ex.  SoftwareSerial bt(9,10);
       bt.begin(baudRate);

Becomes:
      Serial2.begin(baudRate);

It took me a while to find a posting on this.

On another note, while troubleshooting why the TI USB Dongle doesn't work with the Teensy and a Mini circuits@home USB board, I discovered that I don't need to provide ANY power to the USB port for the Dexcom to work.  This means I can interface with the Dexcom, and not let it drain any power from my circuit. Sorry, turns out this wasn't true.  Lots of wires...

On deck for this weekend.  Hopefully get some code together for the Metawatch, and assemble something that I can carry around.  

For less hopeful projects I'd like to try getting access to the Pebble, although that doesn't seem likely.  Noone seems to have had any real luck with an Arduino, I'm looking into an article on "bit banging bluetooth" that looks promising.  


Saturday, January 18, 2014

New Prototype



Today, I got the Dexcom talking to a Teensy 3.1 and a Circuits@Home Usb Stick.  Each of these boards is 0.7" X 1.5".  I've had these around for about a month, and they've been frustrating me.  Finally set aside today, as a day of failure, to work through the assorted issues.

FYI, I'm accumulating boards and watches at an alarming rate.

My problem here, is I was trying to just get the Chronos working with these circuits, since, in my mind, it's simpler.  Finally on a whim, I broke the code out for just the Dexcom, and it works.

I can plug yet another stick of gum size board into this mess, and I'll have either bluetooth or Ant+.  At this point, I may go with Ant+, simulate a HR packet, and use a Timex Ironman Watch.  I don't own that watch yet though...

The Ant+ dongle is insanely small, I'll attempt soldering that tomorrow.

Thursday, January 2, 2014

Arduinos

I'm finally trying the Microcontrollers.


What you see here (L to R) is an Arduino Uno with USB Shield, a Teensy 3.1 with USB Shield and an Arduino Mega ADK.  Currently the ADK setup is running with the Dexcom and the TI watch.  Battery life is amazing.  I have the Mega written to "wake up" every 2 minutes, get the number from the Dexcom and update the watch, so the Mega is only using full current for a couple of seconds out of every 2 minutes.

The big hurdle with the microcontrollers, is USB support.  The Mega ADK comes with a single port, so I've added a USB hub.  I also was working with two Arduinos using I2C, one communicates with the TI the other with the Dexcom.  The problem with that configuration, is I can't save power by putting the Arduinos to sleep.

I may be able to get by with a very small battery, and have everything work for days without a recharge.  The TI watch has yet to require a charge since I purchased it last year.  The Metawatch needs a charge daily.

The Arduino Uno, was a failure, it can't handle the amount of data coming from the Dexcom.  I'm hoping the Teensy will work.  If it does, this will be almost pocket sized.

I also have on order a transmitter for the TI, that may have improved range.  Might be a week or two before I see that.  Also, with this device, I'll only need one USB Port, so the hub goes away.

Snowy weekend coming up, hope to at least see if the Teensy will work.

Friday, December 6, 2013

Taskbar Widget



Since I already have the C# laying around, I created a program to show the BG in my Taskbar.