Measures how much water remains in your dog's bowl and reports to Home Assistant for all your automation needs.
You'll need the following to build the sensor:
Item | Quantity |
---|---|
Raspi Pico W | 1 |
3D printed base | 1 |
M5 x 12 mm screw | 2 |
TAL220B Load Cell | 1 |
HX711 Load Sensor Amplifier (any HX711 board will do) | 1 |
You'll need to 3D print the top and bottom of the scale. I recommend printing with PETG since the scale body might get wet while in use.
STL files are included in the body
folder for the top and bottom of the scale. The scale top has a diameter of 180 mm. If that is too big or small for your dog's bowl, you'll have to modify the model.
A fusion360 model is also located in the body
folder. The model has a user parameter ScaleDiameter
that can be changed to suit the size of your dog's bowl.
- Wire up the Raspi Pico W and the HX711 load sensor amplifier as shown below:
- Assemble the scale by inserting the load cell between the scale bottom and the scale top and securing with the M5 screws:
- Set up an MQTT Broker with Home Assistant (e.g., the Mosquitto add-on).
- Install Micropython on the Raspi Pico W. Instructions here.
- Fill out WiFi SSID, WiFi password, MQTT server (or IP address), MQTT username, and MQTT password in secrets-template.
- Rename secrets-template file to
secrets
. - Mount Raspi Pico W as flash drive on computer. Put
main.py
andlib
folder on the Raspi Pico W. You can also open in VSCode and upload to the board with the Pico-Go extension.
- First, get the raw value of the scale with nothing on it (you can use the
Raw value
output in the serial console when nothing is on the scale). ReplaceloadCellZeroValue
in the config variable section with this value. - Next, get the raw value of the scale with something you know the weight of in grams (you can weigh something with another scale). The calculate
loadCellScalingFactor
according to the following formula:loadCellScalingFactor = knownWeight / (scaleRawValueWithKnownWeight - loadCellZeroValue)
. ReplaceloadCellScalingFactor
in the config variable section with this value. - Finally, get the scaled value of the scale with your dog's bowl on it (you can use the
Scaled value
output in the serial console when your dog's bowl is on the scale). ReplaceemptyBowlWeight
with this vaulue in the config variable section with this value.
The sensor will be automatically added to Home Assistant via MQTT discovery.
- HX711 Micropython library by Sergey Piskunov
- MQTT Micropython library by fizista