Live data from Hacker News

Building a T1D smartwatch for my son from scratch

andrewchilds.com

51–60 of 88 posts

Re: Building a T1D smartwatch for my son from scratch

#51

I'm going to buck the trend and say this is an excellent idea, but it should absolutely NOT be used for its indended purpose. If OP wants to track his own insulin levels, fine, but to put DIY, uncertified, learn-as-you-go medical monitoring device on someone else, let alone your own son is f*cking bonkers.

Just to clear up the confusion here: there's basically no risk to this device. It's not inventing numbers on its own. It's simply a secondary display to the same data that's on the phone. The phone alarms are still there, and can't be disabled, not to mention the insulin pump, which also alarms independently.

Re: Building a T1D smartwatch for my son from scratch

#52
post #38

Wow! This is some phenomenal engineering! > Another area that stumped me is how to shut the power off 100% on the device, so that it can remain “off” for weeks or months. This is actually a pretty solvable problem... https://circuitcellar.com/resources/quickbits/soft-latching-... Then the microcontroller can choose at any time to completely shut off the entire circuit (including itself), and extremely little power wi…

Another alternative is to use ESP32's deep sleep mode. You can tell ESP to sleep until some event occurs. There are many options for waking up the microcontroller. https://docs.espressif.com/projects/esp-idf/en/stable/esp32c... It uses little power, so standard 18650 battery could last years with single charge. https://www.programmingelectronics.com/esp32-deep-sleep-mode

ESP's deep sleep is not great - the datasheet for the C3 says 5 uA. That's an order of magnitude above low power microcontrollers (e.g. ATSAML), and two orders of magnitude above an ultra low power timer. Not horrendous, but higher than I'd prefer for a tiny watch battery.

Re: Building a T1D smartwatch for my son from scratch

#53
post #42

The number of skills one has to master for a project like this is just mind-boggling, and the part about the tortilla press made me laugh out loud. A labor of love in the most literal sense! That said, I would feel pretty nervous about actually selling these, as I wouldn't be surprised if it is legally considered a medical device.

> I wouldn't be surprised if it is legally considered a medical device

Couldn't you just include a disclaimer that it isn't?

Re: Building a T1D smartwatch for my son from scratch

#54
post #38

Wow! This is some phenomenal engineering! > Another area that stumped me is how to shut the power off 100% on the device, so that it can remain “off” for weeks or months. This is actually a pretty solvable problem... https://circuitcellar.com/resources/quickbits/soft-latching-... Then the microcontroller can choose at any time to completely shut off the entire circuit (including itself), and extremely little power wi…

Another alternative is to use ESP32's deep sleep mode. You can tell ESP to sleep until some event occurs. There are many options for waking up the microcontroller. https://docs.espressif.com/projects/esp-idf/en/stable/esp32c... It uses little power, so standard 18650 battery could last years with single charge. https://www.programmingelectronics.com/esp32-deep-sleep-mode

The ESP32-S3 spends most of its time in deep sleep, only waking up for about 5-10 seconds every 5 minutes. The problem I ran into was that not just the ESP32-S3, every component on the board (the accelerometer, the haptic motor driver, the LiPo battery charger, the 3v3 LDO) has a some constant, minimum (quiescent) current draw. And even how your resistors are configured (pullup or pulldown) and their resistance values contributes. To diagnose it, I would need a precision measurement tool like a ($1k) Joulescope https://www.joulescope.com/products/js220-joulescope-precisi... and probably a significant amount of time.

Re: Building a T1D smartwatch for my son from scratch

#55
post #39

Wonderful. I'm interested in learning about circuit and PCB design. What would you recommend as the best introductory resources to get started?

I would start with breadboards and modules from SparkFun or Adafruit. You can mock up a lot of functionality without needing to solder anything. If you get to the point where you're ready to jump into PCB design, check out the /r/printedcircuitboard wiki: https://www.reddit.com/r/PrintedCircuitBoard/wiki/index/. You might be able to find similar projects that have been posted and critiqued there already. SparkFun and Adafruit both publish their schematics/PCB layouts. I recommend KiCad for your PCB/schematic software - there are plenty of KiCad tutorials and guides on Youtube. Have fun!

Re: Building a T1D smartwatch for my son from scratch

#56

I'm going to buck the trend and say this is an excellent idea, but it should absolutely NOT be used for its indended purpose. If OP wants to track his own insulin levels, fine, but to put DIY, uncertified, learn-as-you-go medical monitoring device on someone else, let alone your own son is f*cking bonkers.

[deleted]

Re: Building a T1D smartwatch for my son from scratch

#57

This is great. I do watch my Dexcom on my Apple Watch, but there's times I just want the number, ASAP. I was hoping it'd talk about eliminating the need for the iOS app ("...where he shouldn’t have to run around with a phone strapped to him...") but it sounds like it's just not possible to avoid at least periodic polling. Reading through the product development, I'm curious why you didn't use a dev kit like the Pine…

Thank you! It should be possible now with the G7 to have the watch pair directly with the sensor. We’re still on the G6. Agreed that would be much better than having to go through the iOS app and up to the cloud. Honestly I don’t remember why I ruled out the PineTime. I purchased a Bangle.js and while it’s very small, it seemed very limited in what I could do with it. Of course with the Pebble announcement yesterday,…

PineTime is nice and cheap and does a little BlueTooth. It's easy to flash your own firmware to it; I think it might have been an option.

That said, Pine64 does not do a whole lot of work on their platform and I guess a lot of people are wanting _more_. It's a simple watch and for what it does and costs it's great. If you think you'll get an open source Apple Watch, you're going to be disappointed.

Re: Building a T1D smartwatch for my son from scratch

#58
post #38

Earlier quoted context omitted.

Another alternative is to use ESP32's deep sleep mode. You can tell ESP to sleep until some event occurs. There are many options for waking up the microcontroller. https://docs.espressif.com/projects/esp-idf/en/stable/esp32c... It uses little power, so standard 18650 battery could last years with single charge. https://www.programmingelectronics.com/esp32-deep-sleep-mode

The ESP32-S3 spends most of its time in deep sleep, only waking up for about 5-10 seconds every 5 minutes. The problem I ran into was that not just the ESP32-S3, every component on the board (the accelerometer, the haptic motor driver, the LiPo battery charger, the 3v3 LDO) has a some constant, minimum (quiescent) current draw. And even how your resistors are configured (pullup or pulldown) and their resistance value…

I had this problem on a low power design. We were making an industrial temperature sensor for something that moved and we needed to run on battery.

What I ended up doing was using a second voltage regulator with an enable pin for all the accessories. When the MCU wakes up it turns power on to the accessories and waits for things to stabilize, maybe 1ms or so. Then it does what it needs to do and before going back to sleep turns all the accessories back off.

Costs you a few extra parts and a second voltage bus and the hassle of programming but it turns "small quiescent draw" into essentially zero. Maybe the regulator has a bit of leak but it should be pico amps or less.

Re: Building a T1D smartwatch for my son from scratch

#59
post #35

Earlier quoted context omitted.

Thank you! I did actually buy a Bangle 2 early on in the project; I was impressed by the Espruino project and by how small the watch is, but it seemed slow to wake, and the screen was tiny, dim and had a lot of light bleed. But you’re making me think I should take another look. Very cool that your kids are programming their own watches!

Yeah, the transflective display is not great, but the power usage is nil when the backlight is off, which is nice. E-ink might be even nicer.. but the price is a major stumbling block for most form factors. The pebble might be a good option though, not only is the os now open sourced but there is apparently someone trying to build new watches. Once you get out of the hobby space, Hardware is a tough business, and the…

Thanks! Yeah, it's odd to me that there are so many cheap Apple Watch clones on Aliexpress with nice AMOLED displays and sensors galore, but nothing hackable, nothing with an e-paper/MIP display. I feel like they would make way more $$ if they made one that was hackable? Lilygo.cc has done a lot of work on open hackable watches, but they're big and not water-resistant.

Re: Building a T1D smartwatch for my son from scratch

#60
post #38

Earlier quoted context omitted.

Another alternative is to use ESP32's deep sleep mode. You can tell ESP to sleep until some event occurs. There are many options for waking up the microcontroller. https://docs.espressif.com/projects/esp-idf/en/stable/esp32c... It uses little power, so standard 18650 battery could last years with single charge. https://www.programmingelectronics.com/esp32-deep-sleep-mode

The ESP32-S3 spends most of its time in deep sleep, only waking up for about 5-10 seconds every 5 minutes. The problem I ran into was that not just the ESP32-S3, every component on the board (the accelerometer, the haptic motor driver, the LiPo battery charger, the 3v3 LDO) has a some constant, minimum (quiescent) current draw. And even how your resistors are configured (pullup or pulldown) and their resistance value…

Wait until you look at the leakage current of capacitors..! Very poorly specified, if at all, and can actually swamp the consumption of active components in these low or sub-microamp situations. The dual voltage rail that msanford described is the way to go here, gate as much as you possibly can and really focus on reducing the duty cycle.
Post reply on HN