Close

Navigation and better DS18B20 Code

A project log for Insulin Minder

Helps keep track of how hot or cold my insulin has gotten and when I last had an injection. Great for the absent minded diabetic!

linus-dillonLinus Dillon 12/08/2014 at 12:060 Comments

Some small bits and pieces of progress.

I've built a small carrier board for one of the 5-Way navigation switches so I can plug it into my breadboard. I've hooked it up to the Port B pins as that SHOULD let me neatly use the pin change interrupt to wake the device from sleep (which will be vital to getting a battery life beyond a few hours). At the moment its on pins 9 through to 13 using the inbuilt weak pull-ups, but I'll probably switch 13 with 8 so I can avoid the LED on 13 being lit dimly all the time and hence drawing power.

I've also grabbed some faster code for reading from the DS18B20 temperature sensor from Peter Scargill - it takes only 5ms (compared to about a second) to read (at the expense of some flexibility I don't need). The faster the better as the Trinket won't have to be awake as long using power to perform a read. I expect I'll be waking it on a timer ever few seconds to check the temperature.

Finally, so more goodies have arrived! An extra 3.3V Trinket (I want to build two of these - one for my fast acting insulin and one for my long acting insulin), plus a pair of LiPo back-packs to handle the LiPo battery and charging.

In terms of hardware thats getting close to complete; I'll probably see if I can add the ability for the Trinket to monitor the battery, and I MIGHT add an over-temperature warning LED (depending on current use).

Now... when was that deadline?

Discussions