Power... down?

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/11/2014 at 12:200 Comments

After a bit of a slog tonight I think I have most of the core elements of the hardware and software together.

I've hooked up one of the Trinket Pro LiPo backpacks - certainly a nice easy way to deal with powering it all off a battery. I also have a 150mAh and a 110mAh battery - both small and would work I think. I'm not sure which I'll go with as yet, but it will probably come down to shape more than capacity.

Secondly, I spent some time sorting out the "sleep" mode on the Trinket. Without this the idea of a device you carry everywhere with you is pretty much doomed. Looks like the Trinket consumes around 20mA when powered up. The display adds a bit of course. At that rate of consumption, the small batteries I have would last all of 6 hours or so.

The vast majority the time, the Insulin Minder won't actually be doing anything. It only needs to wake up periodically to record the temperature, and also when the user wants to use it (i.e. they move the navigation stick). By using the watchdog timer and the pin-change interrupt, the Trinket can use the POWER DOWN sleep mode which should be the lowest power consumption rate possible.

A naked ATMega chip would consume only a few uA - an improvement of several orders of magnitude. The trinket however is consuming 3.3mA (measured using my handy-dandy USB power monitor). Thats still far too much. I THINK much of this is due to the power LED. Unfortunately the only way around this I know of is to actually remove the LED.

Still, the main loop is now entering the lowest power state, and waking every 8 seconds or when I move the navigation stick. The rest of the code is almost just window dressing (well, remaining challenges will be drawing pretty text and measuring the battery voltage).

Finally, I have set up a GitHub repository for the code and uploaded what I've done so far.