,

Weighing the CO₂ – a scale for the gas bottle

Posted by

–

How much CO₂ is left in the bottle? The gauge on the regulator won’t tell you until it’s almost empty – the pressure stays the same as long as there’s liquid CO₂ left. And when we started measuring oxygen, we also wanted to know how much CO₂ a purge actually uses. So the whole gas supply now hangs on a scale.

How it’s built

An S-type load cell hangs from a wooden bracket above the shelf. The regulators and the bottle hang from it on rods through a hole in the shelf, so nothing rests on the shelf and everything that’s weighed is the gas supply. The regulators are the same ones as in the gas line tests.

The load cell is read by an HX711 amplifier and an ESP32-S3 on a Waveshare board with a round 1.28″ display.

TypeS-type load cell
Capacity10 kg
Sensitivity2.0 ± 0.05 mV/V
Nonlinearity, hysteresis, repeatability± 0.03 % of full scale each
Creep± 0.03 % of full scale per 30 min
Zero temperature coefficient± 0.03 % of full scale per 10 °C
Operating temperature−20 to +80 °C
Safe overload150 % of full scale
Excitation10–15 V
The load cell’s specifications.

A tare button in Home Assistant zeroes out the regulators and fittings, so what’s left is the bottle. From the weight, the scale works out which of our two bottle sizes is hanging there – the small one weighs 770 g empty and holds 425 g of CO₂, the large one 1,590 g and 885 g – and shows the grams and the percentage left. When only about 50 g (small bottle) or 85 g (large) is left, the liquid is gone and the pressure starts to drop, so the arc on the screen turns red.

Temperature

Load cells drift with temperature. On ours the zero point moves about 505 counts per degree, and with 442 counts per gram that’s 1.1 g per °C – about four times the load cell’s own specification (0.03 % of 10 kg per 10 °C, or 0.3 g per °C), so some of it probably comes from the amplifier or the mounting. A DS18B20 on the load cell measures its temperature, and the scale corrects for it:

float temp = id(load_cell_temp).state;
if (isnan(temp)) return NAN;
float offset = O_REF + BETA * (temp - T_REF);   // zero point at this temperature
return -((id(hx711_raw).state - offset) / S_REF); // grams

The constants came from logging the temperature and the weight over a period of time and fitting the drift. It works well: when a bottle is really empty, the scale reads within a few percent of zero.

In Home Assistant and Grafana

The scale shows up in Home Assistant with the CO₂ weight, the percentage left, the bottle size and the load cell temperature, plus the tare button and the backlight. When we fill cans with the LoDoFiller™, the CO₂ left in the bottle is on the same phone dashboard as the CO₂ level in the room, the pressures and the beer left in the fermenter.

In Grafana the CO₂ weight sits next to the oxygen readings, so we can see exactly how much gas each step of a purge uses:

Ten 5-second bursts at 20 psi used 52 g of CO₂, about 5 g each. More about the purge tests in Purging the dry-hop tower, and about the oxygen meter on The oxygen lab.

From Arduino to ESPHome

The first version was an Arduino program built with PlatformIO, with a touch interface designed in Squareline Studio and MQTT to Home Assistant. Today it runs ESPHome, and the same screen is drawn with LVGL. The touch settings screen went away – the tare button and the backlight are in Home Assistant anyway.