Skip to content

A sensor to measure how much water is left in your dog's bowl and report to Home Assistant (via MQTT)

License

Notifications You must be signed in to change notification settings

matthewjselby/ha-dog-bowl-sensor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💧🐕 Home Assistant Dog Bowl Water Level Sensor

Measures how much water remains in your dog's bowl and reports to Home Assistant for all your automation needs.

Materials

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

3D Printing

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.

STLs

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.

Fusion360

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.

Construction

  1. Wire up the Raspi Pico W and the HX711 load sensor amplifier as shown below:

wiring image

  1. Assemble the scale by inserting the load cell between the scale bottom and the scale top and securing with the M5 screws:

construction image

Programming

  1. Set up an MQTT Broker with Home Assistant (e.g., the Mosquitto add-on).
  2. Install Micropython on the Raspi Pico W. Instructions here.
  3. Fill out WiFi SSID, WiFi password, MQTT server (or IP address), MQTT username, and MQTT password in secrets-template.
  4. Rename/copy secrets-template file to secrets.
  5. Add main.py and lib to the Raspi Pico W via your preferred method. You can also open in VSCode and upload to the board with the Pico-W-Go extension.

Calibration

  1. 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). Replace loadCellZeroValue in the config variable section with this value.
  2. 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). Replace loadCellScalingFactor in the config variable section with this value.
  3. 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). Replace emptyBowlWeight with this vaulue in the config variable section with this value.

Home Assistant

The sensor will be automatically added to Home Assistant via MQTT discovery.

Credits

About

A sensor to measure how much water is left in your dog's bowl and report to Home Assistant (via MQTT)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages