• Creation

    Shrinath Nimare10/27/2025 at 22:36 0 comments

    I have always had a very obsessive personality. If I start doing something I forget everything around me until the needs get urgent enough, I need to drop whatever I’m doing and attend to them. Such is the case with hydration as well. I have been trying to drink the recommended 4 or 5 litres of water every single day for years but seldom ever reach the target.

    Over the years I have thought of many solutions. Custom android app to drop a notification, a small ATTiny13A based device to beep every 20 minutes etc. The Android app was set to forward the notifications to my fitness band, which would give me haptic notification. Never missed them, only ignored them. Just sometimes.

    The app worked fine and kept me reasonably hydrated until Android phone OEMs started killing user apps to save battery power. IMO it's completely unreasonable that an app that I wrote is unable to reliably run on a phone I own and paid for. Anyway, the only solution to this is to make the app a foreground service, which essentially makes it a massive energy hog even. A sad state for 2025 honestly.

    Here’s a website which I found documents this phenomenon (https://dontkillmyapp.com/)

    Anyway I hence decided to make a small battery powered BLE device which could be attached to any water bottle and would give haptic and visual notifications to nudge me to drink water. I decided I wanted an accelerometer so that I could then somehow use the oscillations of the water inside the bottle to detect the amount of water left. It is a long shot, and I’m woefully short on DSP skills but it's still quite a nice problem to think about and work on…

    I envisioned that when the bottle would be kept down again after lifting it and taking a sip, the frequency of the oscillations of the water, along with their magnitude (which would induce acceleration changes in the accelerometer) would somehow let me measure the amount of water left. To help, the geometry of the bottle is known and could be somehow simulated?

    I chose ESP32-S3 WROOM modules as the MCU of choice, mainly because I had them at hand. I design with nRF52 MCUs at work, and I love their low power performance greatly, able to achieve sub 2uA sleep current yet I simply did not wish to use one this time. I also wanted WiFi for whatever reason (I fail to recall). ESP32 SoC have a rather poor sleep mode current but I intend this device to be battery powered and rechargeable. If I have to recharge it every 15 days or so, it is absolutely acceptable. With the aim of making it as small as possible, I could not have a large battery to power the device either way.

    The schematics are simple, the ESP32-S3 module itself, the USB port, Li-ion charging and automatic USB power switchover system, a low quiescent current LDO for power supply, a 2mm x 2mm WS2812B LED, an accelerometer and an optional buzzer for auditory notification. I chose a 350mAh Li-ion cell for this device (35mm x 10mm x 4mm). I designed a small board to have everything on it.

    I designed a simple enclosure which could hold the small PCB and also be attached to a water bottle using a Velcro band roll that I had for managing cables. I unfortunately forgot to account for the space required for the piezoelectric/magnetic buzzer for auditory feedback. I also made the enclosure with almost no extra space, which is not very good from an assembly standpoint. The screw hole too, was too small to fit anything that I had so I had to resort to using hot-glue to close the device up while taking care not to heat up the battery (I used some rubber adhesive to stick it on top of the module)

    I also had to attach an additional 16V 220uF electrolytic cap to make sure the device worked when WiFi is enabled. It was browning out otherwise. To make matters worse, the only available space was on the trace antenna, surely affecting the RF performance negatively.

    Finally I decided to measure the current consumption of the device using an Nordic Power Profiler Kit II. Its...

    Read more »