Smart Scale for Automatic Pet Feeder with ESP32 and Home Assistant
Description
This project was born from the need to monitor the amount of kibble in an automatic pet feeder, as the manufacturer's app lacks accurate reporting and notifications. I designed a custom scale using an ESP32 and an HX711 amplifier, integrated with Home Assistant via ESPHome. The scale sits beneath the feeder, supported by a 3D-printed chassis that houses all electronics. It continuously logs the feeder's weight, displays the data in Home Assistant, and triggers alerts when food is running low. The design is modular and compatible with virtually any feeder model.
Functions
● Real-time measurement of pet food weight in the feeder ● Data logging and graph visualization in Home Assistant ● Push notifications to your phone when food drops below a custom threshold ● Works with any feeder thanks to its universal mechanical design
Hardware and Software Used
Hardware:
Arduino ESP32 board
5 kg load cell
HX711 load cell amplifier
5V USB power supply (i used the electrical wall socket, see pictures)
Custom 3D-printed chassis
Screws and adhesive for mounting. You could glue the lid. I've used DIN 912 M4x4 screws and threaded inserts.
Standard automatic pet feeder
Software used:
ESPHome (for ESP32 firmware and Home Assistant integration)
Home Assistant (visualization, automation)
ESPHome CLI for flashing
SolidWorks 2023 (for mechanical design)
Wiring Diagram (obtained from Random Nerd Tutorials)
GPIO Connections:
HX711 DOUT → GPIO16
HX711 SCK → GPIO4
HX711 VCC → 3.3V on ESP32
HX711 GND → GND on ESP32
ESP32 powered via USB C
Code Summary
The ESP32 runs ESPHome firmware, exposing a weight sensor to Home Assistant using the HX711 platform. It is configured to:
Use GPIO16 for DOUT and GPIO4 for SCK
Calibrate using two known data points: 700321 = 0 g and 1072350 = 943 g
Filter out negative values (returns NaN)
Report with two decimal precision and update every 60 seconds
Use grams (g) as the unit of measurement
Bluetooth proxy support is also included via an official ESPHome package.
You can find the full YAML configuration attached in a .zip file.
3D Printing Instructions
Material: PLA
Layer Height: 0.2 mm
Infill: 15%
Supports: None
Assembly Instructions
Print the base chassis and ensure it fits the feeder’s bottom.
Mount the load cell using screws; place the HX711 and ESP32 into their slots.
Wire everything according to the corrected GPIO diagram.
Flash the ESP32 with the provided ESPHome YAML code.
Pair the device with Home Assistant.
Calibrate using the known weight references used in the YAML. The calibration values will likely be different in your case, so set them by taring the scale to 0 when you want it to display 0g (i.e., when the feeder is completely empty). Next, use another scale to weigh the food, fill the feeder with that exact amount, and then tare again with the known weight of the food. For more info, check this tutorial out: ESP32 with Load Cell and HX711 Amplifier (Digital Scale) | Random Nerd Tutorials (it uses Visual Studio Code with PlatformIO but the concept is the same)
Place the feeder on top and secure it as needed.
Demo and Usage Instructions
View weight trends in Home Assistant using the default “History” graph.
Receive alerts when food drops below a defined threshold (e.g., 100 g).
Optionally, trigger Alexa reminders or other automations via Home Assistant. You can even monitor your cats' calorie intake by combining the measured weight of the kibble with its nutritional information (I will do this soon).
Since the base of my automatic feeder wasn't completely flat, I decided to cut a wooden platform out of okoumé plywood matching the feeder’s footprint. I then adhered it to the 3D-printed chassis using strong adhesive. This helped ensure a stable and even load transfer to the load cell. However, this modification is entirely optional. For reference, my feeder model is the FUKUMARU Wi-Fi Automatic Pet FeederAmazon link.
Additional Notes or Tips
Ensure that the load cell sits on a rigid and stable surface to avoid noise.
Avoid overloading the cell beyond its 5 kg rated capacity.
Calibrate after installing the feeder to compensate for structural weight.
The YAML includes a filter that removes negative readings for cleaner data. Furthermore, the weight is subjected to a second round of filtering to compensate for instabilities caused by the cats eating or their paws touching the feeder, this second round of filtering is done in Home Assistant and shown in the pictures.