Pet Feeder
An automated Smart Pet Feeder
Author: Borca Razvan Andrei
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-RazvanAndrei2005
Description
A smart, automated pet feeder that reliably dispenses perfectly portioned meals on schedule while keeping track of your cat's daily eating routines. It actively monitors for food jams to ensure your pet is always fed, and automatically logs exactly when they visit the bowl so you can easily monitor their habits.
Motivation
The primary motivation for this project is the daily challenge of managing the demanding feeding schedules of my two hungry cats. Manually dispensing exact portions multiple times a day is difficult and inconsistent, especially during early mornings or when I am not at home
Architecture
+------------------+ +-------------------+ +-----------------------+
| Time Manager |====I2C======| |====PWM======| Dispensing Mechanism |
| (RTC Module) | | | | (Servo Motor) |
+------------------+ | | +-----------------------+
| |
+------------------+ | | +-----------------------+
| Weight Monitor |===Data======| |====SPI======| Visual Interface |
| (Load Cell/ADC) | | State Manager & | | (Color Display) |
+------------------+ | Logic Controller | +-----------------------+
| (Pico 2W) |
+------------------+ | | +-----------------------+
| Presence Tracker |===GPIO======| |====GPIO=====| Status Indicators |
| (PIR Sensor) | | | | (LEDs & Buzzer) |
+------------------+ | | +-----------------------+
| |
+------------------+ | | [Data Subsystem]
| Local Input |===GPIO======| | +-----------------------+
| (Push Buttons) | +-------------------+====SPI======| Persistence Logger |
+------------------+ | (MicroSD Module) |
+-----------------------+
Main software and system components:
-Core Controller: The Rust-based central brain that manages the state machine, evaluates feeding schedules, and processes sensor data.
-Perception Subsystem: Handles all real-time inputs, including offline timekeeping (RTC), exact weight monitoring (ADC), cat presence detection (PIR), and manual button presses.
-Actuation & UI Subsystem: Executes commands by driving the physical food-dispensing servo motor and provides real-time feedback via the color screen, LEDs, and buzzer.
-Data Persistence: Manages non-volatile storage, automatically logging feeding success events and cat visitation timestamps directly to the MicroSD card.
-Feedback Loops: The internal logic that connects inputs to outputs-automatically stopping the motor when the target weight is reached or reversing it if a food jam is detected.\
Log
Week 23 - 29 March
-Got the initial idea -Submitted the project proposal to the teacher for approval.
Week 30 - 5 April
-Received project feedback from the teacher -Researched and planned how to integrate the suggested features
Week 6 - 12 April
-Easter Break
Week 13 - 19 April
-Ordered some of the components
Week 20 - 26 April
-Received the hardware order -Soldered some of the components at the lab
Hardware
2x Raspberry Pi Pico 2 W
1x DS3231 Real-Time Clock
1x CR2032 Coin Cell Battery
1x SG90 Micro Servo Motor
1x Load Cell (1kg) & HX711 Amplifier Module
1x 1.44" Color LCD ( ST7735 Controller)
1x HC-SR04+ Ultrasonic Sensor
1x MicroSD Card Module
1x MicroSD Card
Push Buttons
LEDs
Resistors
1xBuzzer
Breadboard(for the moment)
Jumper Wires
USB Cables
Breakout Pin Headers
Electrolytic Capacitors\
Schematics
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| Raspberry Pi Pico 2W | The microcontroller | 39 RON |
| Raspberry Pi Pico 2W | Debugger | 39 RON |
| 1.44" SPI Color Display | The Display | 30 RON |
| DS3231 RTC Module | High-precision I2C offline clock | 16 RON |
| MicroSD Card Module | MicroSD Card Module | 4.4 RON |
| HC-SR505 PIR Sensor | Mini motion detector | 7.3 RON |
| Micro Servomotor SG90 | Small Servo for now | 12 RON |
| 1/5 kg Load Cell with HX711 Amplifier Module | High-precision weight monitoring for exact portion control | 27 RON |
| HC-SR04+ Ultrasonic | Distance Sensor | 15 RON |
| 3x40-pin Male Headers | Male Headers for pico | 1.3 RON |
| Breadboard & Jumper Wires | For now Breadboard | ~15 RON |
| Basic Electronics Kit | Push buttons for manual control, RGB LEDs/Buzzer for error alerts, and 220ohm resistors. | ~15 RON |
| Estimated total | until now | 221 RON |
Software
| Library | Description | Usage |
|---|---|---|
| cortex-m & cortex-m-rt | ARM Cortex-M core and runtime | Provides low-level CPU access and handles the initial startup execution for the Pico 2 W. |
| embassy-rp | Async Hardware Abstraction Layer | Core driver used to control the Pico's specific GPIO, SPI, I2C, and PWM (Servo) in an asynchronous way. |
| embassy-executor | Async task executor | Manages concurrent tasks, allowing the system to run the web server, read sensors, and drive the motor simultaneously. |
| embassy-time | Async timing and delays | Provides non-blocking delays and scheduling (e.g., waiting between motor steps or polling the load cell). |
| embassy-sync | Synchronization primitives | Safely shares data (like current weight or system status) between the different asynchronous tasks. |
| embassy-net | Embedded network stack | The TCP/IP stack required to handle internet traffic over the Wi-Fi connection. |
| cyw43 & cyw43-pio | Wi-Fi chip drivers | Controls the Pico 2 W's onboard wireless chip to connect the feeder to your home network. |
| picoserve | Async embedded web server | Hosts a lightweight local web dashboard so you can view logs or trigger feeds from your phone. |
| hx711 | Driver for HX711 ADC | Used to read real-time weight values from the load cell for exact portion control and active jam detection. |
| ds323x | Driver for DS3231 RTC | Used over I2C to read highly accurate offline time so the feeder triggers perfectly on schedule. |
| st7735-lcd | Display driver for ST7735 | Used to initialize and send pixel data to the local 1.44" SPI color display. |
| embedded-graphics | 2D graphics library | Used for drawing the UI, text, menus, and status shapes onto the physical screen. |
| defmt, defmt-rtt & panic-probe | Deferred formatting & debugging | A highly efficient logging framework used during development to view errors and sensor data via the SWD debugger. |
| fixed | Fixed-point arithmetic | Performs precise, lightweight math for weight (gram) calculations without the overhead of floating-point numbers. |
| embedded-sdmmc | SD Card & FAT16/FAT32 library | Used over SPI to read and write persistent feeding history and cat presence logs to the MicroSD card. |