2025

pet feeder

iot-based remote controlled pet feeding unit.

esp32 c++ sveltekit supabase mqtt

pet feeder is an iot-based solution i designed for my university project. it’s not just a simple dispenser, it’s much more than that because it can be controlled from anywhere. it solves a common problem of pet owners. when life gets busy or you’re away from home, it ensures your pet is fed on time.

3d printed prototype

i used esp32 microcontroller because it’s built-in wifi capabilities make it perfect for this kind of iot projects. it handles timekeeping with a ds1307 rtc, monitoring food levels using a load cell and hx711 amplifier, and controls the precise dispensing mechanism via a nema 17 step motor and a4988 driver.

mechanical design

i used onshape to design the cad. i know it’s not a perfect design, no one would buy something like this, but it works. since this is a university project, i focused on functionality and precision. mechanism converts the rotation of the motor into linear motion to open and close the food container. the gate of the container is designed to prevent jams and ensure precise portion control.

front view
back view
food gate mechanism

remote control

i developed a dashboard that allows users to create feeding schedules, view feeding history, and trigger manual feeds. used sveltekit, tailwindcss, and daisyui to build a modern and responsive ui. using it, you can take care of your pet from anywhere on any device.

web dashboard ui

mqtt (hivemq) is used for communication between the device and the dashboard. the device sends realtime status updates (food weight, connection status, etc.) and receives commands from the dashboard instantly.

everything is stored in a supabase (postgresql) database, but the device saves the feeding schedules locally and uses rtc (it keeps the time accurate) to continue operating even when it’s not connected.

challenges

designing a seamless mechanism, especially the gate that controls food flow, was the biggest mechanical challenge. it took many iterations to get it right. on the electronics side, i faced a weird i2c stability issue. the ds1307 rtc runs on 5v logic, while the esp32 uses 3.3v. this mismatch caused unexpected ‘nack’ errors after running for a while. i solved it by adding a bidirectional logic level shifter to the sda/scl lines, bridging the two worlds perfectly.