Smart CO2 bottle

Hi everyone!

I have a quooker with a 2kg CO2 bottle attached to it. It often happens, that I notice too late that the CO2 bottle comes to an end and therefore I wondered if there are any ideas/hardware (that does not cost a fortunre) to make this smart and to visualize the remaining filling in %? I have a pressure reducer attached to it https://gase-kaufen.de/quooker-cube-umbau/571-druckregler-fuer-die-umruestung-quooker-cube-auf-co2-mehrwegflasche-4260509846493.html. The needle is around 50 when it is full. The space where this is installed is very tight.
I thought the best way to get accurate readings would be via the weight but I did not come across a good solution to measure this with HA compatiblity.

Maybe anyone has some ideas how to make this lett dumb :slight_smile:

Have you looked into using ESPhome and a weight sensor? I’m not sure how accurate they are. HX711 Load Cell Amplifier — ESPHome

Hi @tom_l,

Looks like a good guide which I will give a try. This is by far beyond anything I have done so far, so I am exited about the outcome.

So I have made the “wood work” and also the soldering/wiring. However I am still getting wrong values.
Either negative values or the raw weight is getting lower with something added to it.

Should I figure out why and fix it I’ll post it here should anyone else be interested.

I have this running now for a few weeks. Eventhough I have tried many different cabeling options, I was not able to get positiv and correct readings. However, this wasn’t bad as I was able to get around this via the sensor.



    - name: "FĂźllstand CO2 Flasche"
      unique_id: 4ca9a42e-7727-413b-86de-fff9e025527b
      state: >
        {{ ((((26532|float - states('sensor.tasmota_hx711_weightraw')|float) - 5455|float) / 2000) * 100) | round (0) }}
      unit_of_measurement: '%'

The readings are pretty inconsistent.

To overcome this, I am using this tool. https://github.com/Limych/ha-average with duration 1 day.

I have used hx711 several times without any problems, but never tried with esphome.
Are you powering it 5V?
Did you try it with just some arduino code?

I am powering it with 3.3v from an ESP8266.

This is with Tasmota, as I was not really familiar what the config would be via ESPHome and since it is running for me now, I am a bit afraid to touch it until I have some time again.

Totally clueless with arduino code to be honest.

3V3 can be the problem. Many hx711 modules have 4.3V regulator to give stabile and clean excitation voltage to cells. Also your wiring is quite long.

You mean the voltage (red) wiring? I could get it shorter, this is really version 1.0 so I will certainly do some changes on it. When shortening the cables, I will try with 5v connection and see if the readings will be more stable.

If not shielded, they should be short.
If your module has 4.3V regulator, you should power it at least 4.6V.
Also, temperature changes have certain effect.

They are not shielded, they are the standard ones. I think neither the ESP8266 nor the Hx711 does not have a regulator out of the box, right?

My modules have regulator. It’s for sensors, not for the chip.
There are so many different modules around (some are better, some worst), have a look at yours.

Hi,

I found some time to touch this project again. I have now tried with ESPhome and this config.

sensor:
  - platform: hx711
    name: "HX711 Value"
    dout_pin: GPIO4
    clk_pin: GPIO5
    gain: 128
    update_interval: 5s
   # unit_of_measurement: "g"
   # accuracy_decimals: 0

Also I shortened the cables and switched to 5V. Unfortunately, I am not getting any readings, only this log. Trying to set the logger level to INFO, but even then the log says DEBUG only.

INFO ESPHome 2024.9.0
INFO Reading configuration /config/esphome/esphome-web-c1558a.yaml...
INFO Starting log output from 192.168.20.72 using esphome API
INFO Successfully connected to esphome-web-c1558a @ 192.168.20.72 in 0.003s
INFO Successful handshake with esphome-web-c1558a @ 192.168.20.72 in 0.020s
[14:35:56][I][app:100]: ESPHome version 2024.9.0 compiled on Sep 22 2024, 13:37:07
[14:35:56][I][app:102]: Project esphome.web version dev
[14:35:56][C][wifi:600]: WiFi:
[14:35:56][C][wifi:428]:   Local MAC: ***
[14:35:56][C][wifi:433]:   SSID: [redacted]
[14:35:56][C][wifi:436]:   IP Address: 192.168.20.72
[14:35:56][C][wifi:439]:   BSSID: [redacted]
[14:35:56][C][wifi:441]:   Hostname: 'esphome-web-c1558a'
[14:35:56][C][wifi:443]:   Signal strength: -74 dB ▂▄▆█
[14:35:56][C][wifi:447]:   Channel: 6
[14:35:56][C][wifi:448]:   Subnet: 255.255.255.0
[14:35:56][C][wifi:449]:   Gateway: 192.168.20.1
[14:35:56][C][wifi:450]:   DNS1: 192.168.20.1
[14:35:56][C][wifi:451]:   DNS2: 0.0.0.0
[14:35:56][C][logger:185]: Logger:
[14:35:56][C][logger:186]:   Level: DEBUG
[14:35:56][C][logger:188]:   Log Baud Rate: 115200
[14:35:56][C][logger:189]:   Hardware UART: UART0
[14:35:56][C][captive_portal:089]: Captive Portal:
[14:35:56][C][web_server:145]: Web Server:
[14:35:56][C][web_server:146]:   Address: esphome-web-c1558a.local:80
[14:35:56][C][mdns:116]: mDNS:
[14:35:56][C][mdns:117]:   Hostname: esphome-web-c1558a
[14:35:56][C][esphome.ota:073]: Over-The-Air updates:
[14:35:56][C][esphome.ota:074]:   Address: esphome-web-c1558a.local:8266
[14:35:56][C][esphome.ota:075]:   Version: 2
[14:35:56][C][safe_mode:018]: Safe Mode:
[14:35:56][C][safe_mode:019]:   Boot considered successful after 60 seconds
[14:35:56][C][safe_mode:021]:   Invoke after 10 boot attempts
[14:35:56][C][safe_mode:022]:   Remain in safe mode for 300 seconds
[14:35:56][C][api:139]: API Server:
[14:35:56][C][api:140]:   Address: esphome-web-c1558a.local:6053
[14:35:56][C][api:144]:   Using noise encryption: NO
[14:35:56][C][improv_serial:032]: Improv Serial:

I don’t see any issues with your YAML, so I’m guessing you have a wiring issue? What’s weird, is I would expect a ‘can’t connect to the sensor’ type error in the logs if it just can’t talk to it at all.

I use a similar setup to measure the weight of my CO2 tank for my Keezer (for beer). I also measure the pressure past the regulator, obviously doesn’t really change until the tank is completely empty, but it lets me accurately tell when it goes from ‘very low’ to ‘actually empty’. Here’s the sensor I went with:

And what do you get on log after this boot, when board is actually running?
Also, you shouldn’t power hx711 at 5V if it doesn’t have regulator .

5V was just for testing. I would Change it back to 3.3 later.

Thats it. Nothing happens on the logs after what I postet. It stays like this, now error nothing. That is what confuses me to be honest.

That testing can fry your Esp.
Is your board shown online on dashboard?

Yes. I can edit the File and push it to the device. Also shown online in Unifi.

I have started with a new Wemos D1 Mini, shortened the cables and also installed ESPhome. I now get less fluctuating values, which seems good.

Since the scale is under the kitchen sink, I want to eliminate the influence of any movement and temperature difference when someone is cooking etc. Is there a way to tell ESPHome to only take readings at, for example 1 am rather than every 24 hours?