All projects Embedded systems · IoT · Control

Smart cat bowl

Wet cat food spoils within hours at room temperature. I designed and built a feeder that keeps it cool with a thermoelectric module and opens its lid only when the cat walks up. Mechanics, electronics, firmware and smart-home integration are all my own work.

Context
Personal project
Role
Solo: CAD, electronics, firmware
Versions
v1 → v2 (current)
Platform
ESP32 · ESPHome · Home Assistant
Overview

At a glance

8
time-of-flight distance sensors on one I²C bus
2
thermal control loops (cold side and hot side)
13
parameters tunable live from Home Assistant
OTA
wireless firmware updates
Design

Mechanical design

The enclosure houses the cooling plate under the bowl, a liquid-cooling loop for the hot side, a motorised lid and a ring of sensors facing outwards.

System

Sensing, actuation, cooling

Cat detection

Seven VL53L0X time-of-flight sensors around the feeder detect an approaching cat. All eight sensors share one I²C bus through a TCA9548A multiplexer, and are sampled at a fixed rate that doesn't block the other tasks.

Bowl detection

An eighth sensor checks whether a bowl is in place. Cooling only runs when there is something to cool.

Motorised lid

A linear actuator driven by an L298N H-bridge in PWM, with separate, adjustable opening and closing speeds for a smooth, cat-friendly motion.

Thermoelectric cooling

A Peltier module switched by a MOSFET relay. Its hot side is cooled by an all-in-one liquid cooler whose pump and fan are both PWM-controlled.

Temperature sensing

Two DS18B20 probes on a 1-Wire bus, addressed individually, monitor the cold and hot sides of the Peltier.

Robust firmware

A reading must repeat before it counts, so a single glitch never opens the lid. If the cat comes back while the lid is closing, it reopens at once.

Control logic

Two loops and a safety net

Presence → lid

If any sensor reads closer than the detection threshold for long enough, the lid opens. Once nothing has been detected for a set delay, it closes. Both timings are tunable to avoid false triggers.

Cold side: keep the food at target

The Peltier is driven towards a target cold-side temperature with hysteresis to avoid rapid switching. It is enabled only while a bowl is detected.

Hot side: just enough cooling

A PID loop modulates the fan and pump speeds to hold the hot side at its target. Everything spins only as fast as needed, which keeps the feeder quiet. The pump never drops below a minimum speed.

Thermal safety

If the hot side exceeds a safety limit, the Peltier shuts down and only restarts once the temperature has fallen below a reset threshold.

Smart home

Monitoring and live tuning

The bowl talks to Home Assistant through its native API. Temperatures, the Peltier state and the fan and pump speeds are live, and every threshold, delay and speed is a control on the dashboard, so tuning never needs a new firmware build. Updates go over Wi-Fi.

Stack

Tools & techniques

Hardware
  • ESP32
  • VL53L0X ToF
  • TCA9548A
  • L298N
  • Peltier
  • DS18B20
Firmware
  • ESPHome
  • ESP-IDF
  • I²C
  • 1-Wire
  • PWM
Control
  • PID
  • Hysteresis
  • State logic
  • Safety interlock
Integration
  • Home Assistant
  • OTA updates
  • CAD
Next project

High-voltage test bench