An open source digital hydrometer. The main use case is measuring the amount of sugar in liquids during the process of beer and wine making.
How does it work?
Sugarboat floats on top of the liquid being measured. Because of its shifted center of mass, it will float at an angle. This tilt angle (see image below) is larger for denser liquids and smaller for less dense liquids. We can then estimate the density of a solution from this angle.
As is usual in the beer and wine making processes, we can additionally correlate the estimated density of a solution with the amount of sugar present in it.
The estimated density and sugar content are exposed – along with the temperature, relative humidity, current battery voltage and more – through Bluetooth Low Energy (BLE) services. This repository contains examples of how to read these values under
- nRF52840 system-on-a-chip
- Reads sensors, estimates the sugar content and exposes their values via Bluetooth Low Energy (BLE) services
- SHT30 temperature & humidity sensor
- MPU6050 accelerometer + gyroscope estimates the tilt angle
- Li-Ion 18650 battery
- Battery life of over a year on a single charge
- Built-in TP4056-based charging circuit
- USB-C for battery charging and programming
A preform PET tube (or “petling”) is used to enclose the electronics and provide sugarboat with the buoyancy it needs. The printed circuit board is designed to fit tightly into a tube with the inner diameter of around 33 mm and inner height of 123 mm. The board is slightly wider than 33 mm – some light sanding needs to be done to ensure a nice, snuggly fit. I bought my containers from this eBay offering.
||Electronics – schematic, PCB layout, bill of materials and fabrication files|
||Firmware – a PlatformIO project using the Arduino framework|
||A web interface for calibrating, configuring and reading sugarboat’s sensors|
||A barebones Arduino sketch showing how to read sugarboat’s tilt angle, temperature & battery voltage using a Bluetooth Low Energy client|
||An ESPHome client that integrates with Home Assistant|
This client is a web page that connects to sugarboat using the Web Bluetooth API. It lets you calibrate, configure and read the sensor values right from your web browser, wirelessly.
The web client’s source code is in
To support programming via the built-in USB-C port (via UF2), sugarboat requires a bootloader to be flashed to the chip. This is a one-time operation.
I have forked the Adafruit nRF52 Bootloader and added support to sugarboat. To build and flash the bootloader:
$ git clone [email protected]:rbaron/Adafruit_nRF52_Bootloader.git $ cd Adafruit_nRF52_Bootloader/ $ make BOARD=sugarboat all $ make BOARD=sugarboat erase # Look for the build target that contains the merged bootloader + Nordic's SoftDevice and flash it. # It will be something like _build/build-sugarboat/sugarboat_bootloader-X.X.X-XXX-XXXXXXXXX_s140_6.1.1.hex: $ nrfjprog --program _build/build-sugarboat/sugarboat_bootloader-0.4.0-149-g5ffac2e_s140_6.1.1.hex -f nrf52 --reset
Note that you will need a SWD programmer to complete this operation. A good choice for hobbyists is a J-Link EDU Mini. If you buy one, consider getting it from Adafruit.
The hardware and associated design files are released under the Creative Commons CC BY-SA 4.0 license.
The code is released under the MIT license.