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.  

Tuesday, November 12, 2013

Changing the Transmitter Battery ?

Well, I'm getting screwed by my insurance company, so I'm paying for the transmitter out of pocket.
Once I have my replacement in hand, we will be covering replacing the transmitter battery.
Stay tuned.

12/6: Update:  Battery is still working.  I think the low battery conniption the Dex throws must be coded in, and has nothing to do with the battery.  Very uncool.  Do the math, if the battery was so low 40 days ago, that the receiver was missing signals etc., for a week, how does it fix itself and work problem free after that?  Range is still great, not like some internal setting kicked the transmitter output down to conserve battery.

Friday, September 27, 2013

Software Improvements

I've had a while to field test this.  Lost one watch water skiing.  Some issues that have been bothering me:
  1. Since the RasPI doesn't have an internal clock, and the MetaWatch resets each time you re-charge it (ridiculous), I have to spend a few minutes with the RasPI networked to get the time correct.  Not ideal, this needs to be as close to "grab and go" as I can get it.
  2. Bluetooth issues.  This thing uses "bleeding edge" bluetooth.  I create a new bluetooth connection to the watch every time there's a new value to send.  Intermittently, I start getting "bluetooth.btcommon.BluetoothError: (113, 'No route to host')" errors.  Sometimes the device recovers, or I just reboot the PI and things go back to normal.  

The Time Issue:
Finally figured out how to get the current time from the Dex.  I do this on startup and set the RaspPI system time to the current time reported by the Dexcom.  This keeps everything in sync, and gives me a functional watch to boot.  One of many "interesting" issues here, C# on Debian doesn't do dates.  Huge bug.  Luckily, I can pass "Seconds since the epoch" to the Unix date function and it does it for me.

Bluetooth:
I've been using "/etc/init.d/bluetooth restart" after every call to the watch.  Randomly, the bluetooth device time's out, and stays unreachable.  Determined today that calling "hciconfig hci0 reset" fixes that issue.  So now I'm using hciconfig after every call instead of restart.

Thursday, July 11, 2013

Getting it Smaller

Took a shot at reducing the case size.  The large version(7"x5"x2")  is good for 7.5 hours, and is nearly indestructible.  The small case is a tiny fishing tackle box, the size of a match box(5"x3"x1.75"), good for 2.5 hours.  I've left a USB cord attached to it, so it can be plugged in whenever possible.  Decent for trips to the gym.




5" long is as small as you can get and fit the Dexcom with it plugged in.  Had to special order a 90 degree micro usb plug. 


A picture of the inside of the box.  The battery is underneath.  The switch allows me to charge the battery while still running the PI.  Not sure what's with this brand of battery/charger circuit(enercell), but it shuts off power when charging.  The PI has been extensively modified.  I've cut off just about everything that sticks up.  Also, relocated the USB ports.  Allot of time was spent with a magnifying glass doing this work.  I've also shortened the numerous USB cables.  You run out of room fast with extra cord length.  USB plugs were also shaved with a razor blade to make them lower profile, and more bendable.  Power is supplied to the PI via the GPIO pins, since I didn't have another 90 degree USB.  Also removed the case from the battery, which freed up 1/8", allowing the Dex to sit on a plastic plate, and not directly on the circuitry beneath.

Did some additional tests with the Chronos, battery life is shorter on the transmitter side then using bluetooth.  So the Chronos is entirely out of the picture now.