Back to wizard
Intermediate 90 minsLast reviewed: 2026-03-15Maintainer: Magnus Persson

Build a GravityMon (Classic ESP8266)

Build a digital hydrometer using classic iSpindel hardware — a Wemos D1 Mini, MPU6050 gyroscope, and DS18B20 temperature sensor — running GravityMon firmware for advanced gravity monitoring.

1

What is GravityMon?

3 minsStep 1 of 8

What is GravityMon?

GravityMon is open-source firmware for building your own digital hydrometer — a small, battery-powered device that floats inside your fermenter and continuously measures gravity and temperature throughout fermentation. It eliminates the need to pull samples, giving you real-time insight into how your beer is progressing.

The device works on the same principle as the iSpindel: an accelerometer inside a sealed tube measures the tilt angle as the density of the liquid changes during fermentation. GravityMon converts that tilt angle into a gravity reading and transmits it over WiFi or Bluetooth to your brewing software.

Why GravityMon?

GravityMon is 100% compatible with iSpindel hardware — no modifications required. If you have an existing iSpindel, you can flash GravityMon and immediately benefit from its features. If you're building from scratch, the hardware is the same.

What sets GravityMon apart:

  • Advanced calibration — a built-in formula editor with graphical validation helps you dial in accurate gravity readings
  • Broad service support — push data to Brewfather, Fermentrack, Brewers Friend, BrewSpy, Home Assistant, ThingSpeak, MQTT, InfluxDB, and more — up to 5 endpoints simultaneously
  • OTA updates — update firmware over WiFi without opening the tube
  • Gravity velocity (ESP32) — shows how many gravity points you're dropping per 24 hours, so you can see fermentation activity at a glance
  • Advanced filtering (ESP32) — filters the data to avoid peaks during very active fermentations
  • Bluetooth transmission (ESP32) — broadcast in Tilt, GravityMon, or RAPT Pill formats for local receivers
  • Modern ESP32 support — runs on ESP8266 (classic iSpindel) as well as ESP32-C3, S2, and S3 boards

How It Works

  1. The device floats in your fermenter at an angle determined by the liquid's density
  2. The accelerometer measures the tilt angle, which changes as sugars are consumed during fermentation
  3. The microcontroller wakes periodically, reads the angle and temperature, converts them to a gravity reading using your calibration formula, and transmits the data over WiFi
  4. Your brewing software receives the data and logs it — giving you a complete fermentation curve without touching the fermenter

Between readings, the device enters deep sleep to conserve battery. A typical 18650 cell lasts several weeks on a single charge.

2

What You'll Need

5 minsStep 2 of 8

What You'll Need

This build uses the same hardware as a classic iSpindel — the original and most widely documented digital hydrometer design. All components are inexpensive and readily available.

The Microcontroller

The Wemos D1 Mini is a compact ESP8266 board with built-in WiFi. It's the standard board for iSpindel builds and is fully supported by GravityMon. These boards are widely available and cost just a few dollars.

Any D1 Mini clone will work — there are many sellers on AliExpress and Amazon. Just make sure it's an ESP8266-based D1 Mini, not an ESP32 variant (if you want to use an ESP32, see the ESP32 build tutorial instead).

The Gyroscope

The GY-521 module contains an MPU6050 accelerometer/gyroscope. It communicates with the ESP8266 over I2C and provides the tilt angle measurements that are converted to gravity readings. This is the same sensor used in the original iSpindel design.

Temperature Sensor

The DS18B20 in a waterproof stainless steel probe reads the temperature of your fermenting beer. Get the version with the metal probe tip and wire leads — it fits neatly inside the PET tube. The 4.7kΩ resistor is a pull-up for the DS18B20's data line.

Power

An 18650 lithium battery powers the device. Use an unprotected, flat-top cell — protected cells with a button top are slightly longer and may not fit in the tube. The TP4056 module charges the battery via micro-USB and includes protection circuitry to prevent over-discharge.

The slide switch lets you turn the device on and off without opening the tube.

Enclosure

The PET preform tube (commonly called a "Petling" in geocaching) is a food-safe, pressure-rated plastic tube that seals with a screw cap. The standard 130mm length fits all the components with the right sled.

The sled is a 3D-printed carrier that holds the battery, board, and sensors in the correct orientation inside the tube. STL files are available on Thingiverse. If you don't have a 3D printer, you can cut a sled from plastic sheet or order a print from a service.

Tools

  • Soldering iron and solder
  • Wire strippers
  • Hot glue gun (for securing components to the sled)
  • A computer with a USB port and web browser (for flashing firmware)
  • A micro-USB data cable (not charge-only)
3

Assemble the Hardware

30 minsStep 3 of 8

Assemble the Hardware

This step walks through wiring and assembling all the components. If you've soldered before, this is straightforward — just a handful of connections.

Wiring Diagram

The circuit has three main sections: the gyroscope, the temperature sensor, and the power system. All connections go to the Wemos D1 Mini.

Gyroscope (GY-521 / MPU6050)

GY-521 PinD1 Mini Pin
VCC3.3V
GNDGND
SCLD1 (GPIO5)
SDAD2 (GPIO4)

Temperature Sensor (DS18B20)

DS18B20 WireD1 Mini Pin
Red (VCC)3.3V
Black (GND)GND
Yellow (Data)D6 (GPIO12)

Solder the 4.7kΩ resistor between the DS18B20 data line and 3.3V (a pull-up resistor required for the one-wire protocol).

Power Circuit

  1. Solder the slide switch between the battery's positive terminal and the TP4056 module's B+ pad
  2. Connect the TP4056's B- pad to the battery's negative terminal
  3. Connect the TP4056's OUT+ to the D1 Mini's 5V pin
  4. Connect the TP4056's OUT- to the D1 Mini's GND pin

The TP4056 module handles charging (via its micro-USB port) and provides regulated output to the ESP board. The slide switch lets you cut power completely for storage.

Optional: Battery Voltage Monitoring

To let GravityMon monitor battery level, add a voltage divider:

  1. Connect a 220kΩ resistor from the battery positive (after the switch) to the D1 Mini's A0 pin
  2. Connect a 100kΩ resistor from A0 to GND

This divides the battery voltage down to the 0–1V range that the ESP8266's ADC can read. GravityMon uses this to report battery status and can adjust sleep intervals when the battery runs low.

Assembly

Once everything is wired and tested on the bench:

  1. Mount the D1 Mini on the sled using hot glue — the USB port should face the open end of the tube (toward the cap) for easy charging access
  2. Mount the GY-521 flat against the sled, oriented so it measures tilt correctly — the chip should face outward, and the board should be parallel to the length of the tube
  3. Slide the DS18B20 probe along the sled toward the bottom (closed end) of the tube, securing with hot glue. The sensor should be as close to the tube wall as possible for accurate temperature readings
  4. Mount the battery in the sled's battery slot — it provides the ballast weight that determines the resting tilt angle
  5. Secure the TP4056 module and slide switch near the cap end, so you can access the charging port and switch without fully disassembling

Fit Into the Tube

  1. Carefully slide the assembled sled into the PET preform tube, cap-end first
  2. The micro-USB port on the TP4056 should be accessible near the tube opening (or you can run a short USB extension cable to the cap)
  3. Screw the cap on tightly — it must be watertight
  4. Test for leaks by submerging the sealed tube in water for a few minutes and checking for moisture inside

Ballast and Balance

The device needs to float at roughly a 25° angle in plain water. If the angle is too steep or too shallow:

  • Too steep (nearly vertical): Add small weights (stainless steel nuts or lead shot) to the bottom of the sled
  • Too shallow (nearly horizontal): Remove weight or reposition the battery

Getting the initial angle in the right range (roughly 20–35° in water) ensures the accelerometer has enough resolution across the gravity range you'll be measuring. You'll fine-tune the gravity-to-angle relationship during calibration.

4

Flash the Firmware with BrewFlasher

5 minsStep 4 of 8

Flash the Firmware with BrewFlasher

BrewFlasher is a free tool that downloads and flashes the correct firmware to your ESP32 or ESP8266 automatically — no command line needed. It supports all of the major brewing-related ESP projects including BrewPi-ESP, TiltBridge, and more.

You have three options for flashing: the desktop app (Windows/macOS), the web edition (Desktop Chrome/Edge only), or the command line edition (most OSes, including Raspbian/Raspberry Pi OS).

Option A: BrewFlasher Desktop App

  1. Download the latest release from the BrewFlasher GitHub releases page
  2. Connect your ESP32 to your computer with a USB cable
  3. Open the app — no installation required, just double-click
  4. Select the appropriate serial port (or choose Auto-select)
  5. Select the appropriate project, device family, and firmware you want to flash
  6. Click Flash and wait for it to complete

Note - When flashing some devices for the first time, you may need to hold down a button (typically labeled "boot" or "0") when connecting to the computer. You can release the button a few seconds after the device is plugged in.

Option B: BrewFlasher Web Edition

  1. Open web.brewflasher.com in Google Chrome, Microsoft Edge, or Opera on a computer (other browsers including Safari and Firefox don't support WebSerial)
  2. Connect your ESP32 to your computer with a USB cable
  3. Select the project, device family, and firmware you want to flash
  4. Click "Flash to Controller"
  5. You will be prompted by your browser to connect a device - select the controller you connected (typically "USB Serial" or similar)
  6. Click "Install" and wait for the flash to complete

Option C: BrewFlasher Command Line Edition

The command line edition works on any platform with Python — including Raspberry Pi / Raspbian — and provides the same interactive firmware selection as the desktop app.

  1. Install via pip (if not already installed):
    pip install --upgrade brewflasher_cli
    
  2. Connect your ESP32 to your computer with a USB cable
  3. Run brewflasher — it will interactively walk you through selecting a project, device family, firmware, and serial port
  4. Wait for the flash to complete

You can also skip the interactive prompts by passing options directly:

brewflasher --serial-port /dev/ttyUSB0 --baud 460800

Run brewflasher --help for a full list of options.

Troubleshooting

  • Device not detected? Try a different USB cable — some cables are charge-only and don't carry data. Also try a different USB port.
  • Flash fails on ESP32-S2? Some boards require you to manually enter flash mode: hold the 0 button, press RST, then release 0. Then try flashing again.
  • Linux permissions error? Run sudo usermod -a -G dialout $USER, log out and back in, then try again.

Once the flash completes, your device will reboot and the new firmware will be running.

For GravityMon, select **GravityMon** as the project in BrewFlasher, and choose the firmware for the **ESP8266**.

5

Initial Setup

5 minsStep 5 of 8

Initial Setup

After flashing, GravityMon needs to be configured with your WiFi credentials and basic settings. All configuration happens through a web-based interface — no apps or special software required.

If you are using the Gravitymon webflasher the WiFi settings can be set after flashing has been completed.

Enter Configuration Mode

GravityMon enters configuration mode in two ways:

  • Place the device on a flat surface — the accelerometer detects it's horizontal (not floating at an angle) and activates the web interface
  • Plug in the USB charger — the device detects charging voltage and enters configuration mode automatically

When in configuration mode and no WiFi has been configured, the device creates its own WiFi access point.

Connect to the Access Point

If you configured WiFi in the Gravitymon web flasher you can skip this step.

  1. On your phone or computer, look for a WiFi network named GravityMon
  2. Connect to the GravityMon network
  3. A captive portal should open automatically. If it doesn't, open a browser and navigate to http://192.168.4.1

Configure WiFi

If you configured WiFi in the Gravitymon web flasher you can skip this step.

  1. In the web interface, go to the WiFi settings
  2. Select your home WiFi network from the scanned list, or enter the SSID manually
  3. Enter your WiFi password
  4. Save the settings

GravityMon will connect to your home network. You can then access the configuration interface from any device on the same network by navigating to the device's IP address or hostname.

Find GravityMon on Your Network

After connecting to WiFi, you can access the full configuration interface:

  • mDNS: The mDNS name will be unique for that device so the easy way is to use an mDNS dicovery app to identify the device on the network. If you were configuring the device via the portal the device name can be viewed and set. The url will be http://devicename.local
  • IP address: Check your router's connected devices list for the GravityMon device

Basic Settings

From the web interface, configure these essentials:

  • Device name — useful if you have multiple GravityMon devices
  • Temperature unit — Celsius or Fahrenheit
  • Gravity unit — Specific Gravity (SG) or Plato
  • Sleep interval — how often the device wakes to take a reading (default is 300 seconds / 5 minutes). Shorter intervals give more data points but drain the battery faster

Leave the gravity formula and service endpoints for later — you'll set those up during calibration and service configuration.

6

Calibrate the Gravity Formula

20 minsStep 6 of 8

Calibrate the Gravity Formula

Calibration is the most important step — it translates the raw tilt angle from your accelerometer into an accurate gravity reading. Every device tilts slightly differently depending on weight distribution and balance, so each one needs its own calibration formula.

What You'll Need

  • Your assembled GravityMon device, fully charged
  • A tall container (a graduated cylinder works best, but any vessel tall enough to let the device float freely will do)
  • Plain water (for a 1.000 SG reference point)
  • Sugar (table sugar works fine) to make solutions of known gravity
  • A traditional hydrometer or refractometer to verify your reference solutions
  • A scale (optional, for measuring sugar by weight)

The Calibration Process

The goal is to float your device in several solutions of known gravity and record the tilt angle at each point. GravityMon then fits a polynomial formula to these data points.

Step 1: Prepare Reference Solutions

You need at least 3 data points, but more points give a better formula. A good set:

SolutionApproximate SGSugar per liter of water
Plain water1.0000g
Light1.020~52g
Medium1.040~108g
Heavy1.060~166g
Very heavy1.080~228g

Verify each solution's actual gravity with your hydrometer or refractometer — the sugar amounts above are approximate. For best result calibrate in liquid of 20°C (68°F) and you dont need to use the exact SG values as in the table.

Step 2: Record Tilt Angles

  1. Enter configuration mode (place the device flat or plug in the charger)
  2. Open the GravityMon web interface and toggle the force config mode on the main screen
  3. Navigate to the Formula section where the formula is created
  4. Float the device in your first solution (plain water) and let it stabilize for 30 seconds
  5. Record the tilt angle shown in the interface alongside the known gravity value
  6. Repeat for each solution, stirring well, measure SG with hydrometer and letting the device settle each time

Step 3: Generate the Formula

GravityMon's built-in formula editor takes your data points and calculates the best-fit polynomial. The interface shows:

  • Multiple formula options (linear, quadratic, cubic, etc.)
  • A graph plotting your data points against each formula
  • The correlation coefficient (R²) for each — higher is better

For most devices, a 3rd or 4th order polynomial provides the best accuracy. Select the formula that fits your data points most closely on the graph.

Step 4: Save and Verify

  1. Select your preferred formula and save it
  2. Float the device in a solution of known gravity
  3. Check that the reported gravity matches your hydrometer reading within ±0.002 SG

Tips for Better Calibration

  • Use 20°C (68°F) water for your solutions — temperature affects density
  • Let the device stabilize for at least 30 seconds at each point before recording
  • More data points = better accuracy, especially at the extremes of your expected range
  • Recalibrate if you change the battery or modify the ballast — anything that shifts the center of gravity affects the tilt
  • GravityMon applies temperature correction to readings, but calibrating near your expected fermentation temperature still helps

Migrating from iSpindel

If you previously ran iSpindel ESP8266 firmware and already have a calibration formula, GravityMon can import it. In the formula section of the web interface, enter your existing polynomial coefficients directly — no need to recalibrate from scratch.

7

Connect to Brewing Services

10 minsStep 7 of 8

Connect to Brewing Services

GravityMon can push your gravity and temperature data to up to 5 endpoints simultaneously. Whether you use a cloud service, a local server, or a home automation platform, setup takes just a few minutes.

Supported Services

GravityMon has built-in support for these services:

ServiceTypeWhat It Does
BrewfatherCloudFull-featured brew logging with fermentation tracking
Brewers FriendCloudBrew logging and recipe management
BrewSpyCloudFermentation monitoring dashboard
FermentrackLocalSelf-hosted fermentation management
Home AssistantLocalHome automation integration via MQTT
ThingSpeakCloudIoT data logging and visualization
InfluxDBLocal/CloudTime-series database for custom dashboards
MQTTLocalGeneric message broker for any subscriber
Custom HTTP/HTTPSAnySend data to any endpoint using a customizable format

See the gravitymon documentation for more details.

Configure an Endpoint

  1. Enter configuration mode (place the device flat or plug in the charger)
  2. Open the GravityMon web interface
  3. Navigate to the endpoint configuration section
  4. Select the service type and enter the required credentials

Brewfather Example

  1. In Brewfather, go to Settings → Custom Stream
  2. Copy the Custom Stream URL
  3. In GravityMon's web interface, select Brewfather as the endpoint type
  4. Paste the stream URL
  5. Save

MQTT Example

  1. Enter your MQTT broker address (e.g., 192.168.1.100)
  2. Set the port (default: 1883)
  3. Enter username/password if your broker requires authentication
  4. Set the topic (e.g., gravitymon/fermenter1)
  5. Save

Custom Data Formats

For advanced users, GravityMon includes a data format editor that lets you customize the JSON payload sent to HTTP/HTTPS endpoints. You can include any combination of:

  • Gravity (SG or Plato)
  • Temperature
  • Tilt angle
  • Battery voltage
  • Gravity velocity (points per 24 hours)
  • RSSI (WiFi signal strength)

This is useful for integrating with services that expect a specific data format, or for sending data to your own logging infrastructure.

Bluetooth Transmission

In addition to WiFi endpoints, ESP32-based GravityMon devices can broadcast over Bluetooth in three formats:

  • Tilt — compatible with any Tilt Hydrometer receiver (TiltBridge, Tilt app, etc.)
  • GravityMon — native format with extended data
  • RAPT — compatible with RAPT Pill receivers

Bluetooth transmission works independently of WiFi — you can use both simultaneously. This is useful if you have a TiltBridge or other BLE receiver nearby.

Verify Data Flow

After configuring an endpoint:

  1. Let the device take a reading (wait for one sleep/wake cycle, or trigger a manual reading from the web interface)
  2. Check your service's dashboard or logs to confirm data is arriving
  3. Verify the gravity and temperature values look reasonable
8

Test Your GravityMon

10 minsStep 8 of 8

Test Your GravityMon

Before dropping your GravityMon into a batch of beer, run through these checks to make sure everything is working correctly.

Hardware Test

GravityMon has a built-in hardware test accessible from the web interface:

  1. Enter configuration mode (place the device flat or plug in the charger)
  2. Open the web interface and navigate to the Hardware Test section
  3. The test checks:
    • Gyroscope — confirms the accelerometer is responding and reading angles
    • Temperature sensor — confirms the DS18B20 is connected and returning a valid temperature
    • Battery voltage — shows the current voltage (if you wired the voltage divider)
    • WiFi — confirms connectivity and signal strength

If any test fails, double-check your wiring for that component.

Float Test

  1. Fill a tall container with plain water at room temperature
  2. Drop your GravityMon device in — it should float at roughly 20–35° from vertical
  3. Enter configuration mode and check the web interface:
    • The tilt angle should be stable (not jumping around)
    • The temperature should match the water temperature within a degree or two
    • The gravity should read close to 1.000 SG (if you've already calibrated)

If the angle reading is unstable or jumping, the accelerometer may need recalibration — use the gyro calibration option in the web interface.

End-to-End Test

Run a complete cycle to verify everything from sensor to cloud:

  1. Float the device in water
  2. Turn it on and let it go through a full sleep/wake cycle
  3. Check your configured service (Brewfather, Fermentrack, etc.) for the incoming data point
  4. Verify the reported gravity and temperature are reasonable

Leak Test

Before using the device in actual beer:

  1. Seal the PET tube tightly (put some keg greese around the cap to better seal it)
  2. Submerge it in water for at least 30 minutes
  3. Remove and dry the outside
  4. Open the cap and check for any moisture inside

If you find moisture, reseal the cap — apply a thin ring of food-safe silicone sealant or plumber's tape around the threads if needed.

Troubleshooting

  • Device won't enter configuration mode: Make sure it's on a truly flat, level surface. The accelerometer must detect a near-horizontal orientation. Alternatively, plug in the USB charger.
  • WiFi won't connect: Double-check SSID and password. GravityMon supports 2.4 GHz networks only — 5 GHz networks won't appear in the scan.
  • Gravity reading is way off: Recalibrate. If you haven't calibrated yet, the default formula won't match your device's specific tilt characteristics.
  • Temperature reads incorrectly: Check the DS18B20 wiring, especially the pull-up resistor. A missing or wrong-value pull-up causes erratic readings.
  • Battery drains quickly: Increase the sleep interval. At 15-minute intervals, a 2200mAh 18650 should last several weeks. At 1-minute intervals, battery life drops to a few days.
  • Data not arriving at cloud service: Verify the endpoint URL/credentials in GravityMon's settings. Check that the device has a stable WiFi connection (good RSSI). Try the hardware test to confirm WiFi is working.
  • Tilt angle is unstable: The device may be bumping against the side of the container, or there's CO₂ buildup on the tube. During active fermentation, bubbles on the surface of the tube can affect the angle — this is normal and GravityMon's low-pass filter smooths it out.
Step 1 of 8