Hail Hydration

Team Members

  • Nick Graves
  • Kyle Rabago-Banjo

Overview

Fitbit's wearable fitness and activity trackers passively monitor a user's biometrics and collect data. For example, the optical heart rate sensor on a Fitbit is constantly sampling heart rate data and logging it. Likewise, a Fitbit can automatically determine when its wearer falls asleep.

What Fitbit can't do automatically is monitor your nutrition and hydration. To log these, the user must go into the Fitbit app and manually enter how much water he or she has consumed or what he or she has eaten.

The Hail Hydration project will eliminate the need for manually logging water consumption by automatically tracking it and syncing it with the user's Fitbit account.

Hail Hydration uses an Android app to communicate with the smart water bottle over Bluetooth. The app then adds the water consumption to the user's Fitbit account. The water consumption will appear when the user next syncs his or her Fitbit account (as he or she would do anyways).

Components Used

  • Mbed LPC1768: the mbed is the brains of the water bottle. It determines when a sync is needed and also stores cumulative water consumed.
  • Adafruit Flow Meter: this flow meter is embedded in the water bottle and tracks the immediate consumption of water.
  • Adafruit Bluefruit LE UART Friend: This chip enables Bluetooth communication between an mobile device and the water bottle. In particular, this chip conveniently offers a wireless UART mode that acts just like a serial line.
  • 2N3904 Transistor: this transistor is used for power management of the Bluefruit chip.
  • DC Barrel Jack

Hookup Guide

Barrel JackFlow MeterMbed2N3904
5V5VVinC
GndGndGnd
MbedFlow Meter
GndGnd
p30signal
Mbed2N3904Bluefruit
p20B
EVin
GndGnd
p13Txo
p14Rxi
GndCts

How It Works

/media/uploads/krbng4180/hail_hydration_high_level_arch_xH4lljU.png The Hail Hydration project uses 3 components: the water bottle itself, an Android app, and the Fitbit API. When the water bottle determines that enough water has been consumed to warrant a data transfer, the bottle turns on the Bluefruit chip. Meanwhile, the Android app is scanning available Bluetooth devices in the background at regular intervals, looking for the smart water bottle. When the water bottle turns its Bluetooth module on, the Android app will connect to it an initiate a sync. This transfers water consumption data to the Android app.

Once the Android app has a sufficient amount of data from the smart bottle, it will send that data to the Fitbit API (data is aggregated into larger chunks to not exceed the maximum daily requests to the Fitbit API).

After the data has been sent, when the user next syncs his or her Fitbit app the water consumption data will appear on the dashboard.

The water bottle implements a state machine on the mbed as seen below. This state machine for communication ensures that the Android app and device are in-sync and no data is lost.

/media/uploads/krbng4180/hail_hydration_state_machine_gG7Liyq.png

Demo

Flow Meter API

Import libraryFlowMeter

An API for interacting with the Adafruit flow meter.

Android Application Source Code

https://github.com/krabagobanjo/water_tracker


Please log in to post comments.