Skip to main content
Version: FILS English

Pet Feeder

Automatic food dispenser for animals

info

Author: JUVERDEANU Diana-Maria
GitHub Project Link: https://github.com/UPB-PMRust-Students/project-JuverdeanuDianaMaria

Description​

I grew up surrounded by pets at home, and one recurring challenge we faced as a family was planning vacations. We often had to limit our travel plans because it was difficult to find someone reliable to feed our pets while we were away. This inspired me to design a Smart Pet Feeder system built using a Raspberry Pi Pico 2W and Rust. The feeder dispenses food at scheduled times or remotely via wi-fi control. To make pet care more convenient and give pet owners more freedom and peace of mind when traveling.

Motivation​

I believe this could be a practical solution to real-life problems I've faced. Even if the project might seem a bit silly, I’m excited to have fun working with the hardware I've invested in.

Architecture​

Main Components:

Architecture

Raspberry Pico 2W: Acts as the central processing unit for the Pet Feeder, controlling the sensors and motors.

Ultrasonic Distance Sensor HC-SR04+: Detects when a pet is near the feeder.

Servo Motor SG92R: Drives the mechanism to dispense the pet food.

Power Supply: Provides the necessary power to all components at 5V.

ESP32-CAM with OV2640: Used for capturing real time images.

Wi-Fi Module: Facilitates communication with external devices.

Connection Overview:

The Raspberry Pi Pico 2W acts as the central controller of the Pet Feeder, directly interfacing with the ultrasonic distance sensor (HC-SR04+) and the SG92R servomotor. When the pet approaches the feeder, the sensor detects proximity, and the Pico 2W automatically activates the servo to dispense food. The Pico also runs a Wi-Fi access point and hosts a local web server, allowing the owner to manually trigger feeding from a browser interface. Capturing real time images is handled separately by the ESP32-CAM, which streams real-time footage to the owner. The SG92R servomotor is responsible for physically releasing food from a dedicated container, and is powered by a 5V supply. The ultrasonic distance sensor also helps ensure that food is only dispensed when the pet is actually near. This architecture ensures seamless interaction between sensing, actuation, and user control, enabling both automatic and manual feeding through reliable, Wi-Fi-based communication, with the Pico 2W orchestrating core functions while the ESP32-CAM provides independent visual monitoring.

Log​

Week 5 - 11 May​

Bought hardware parts. Mounted the Raspberry Pi Pico 2W on breadboard. Wrote the code for the ultrasonic sensor (HC-SR04+). Tested PWM for SG92R servo motor.

Week 12 - 18 May​

Week 19 - 25 May​

Hardware​

Pico 2W - brain of the Pet Feeder

Servo Motor - delivers food

Ultrasonic Distance Sensor HC-SR04+ - detects pet

OV2640 - captures images

Power Supply - battery 5V

Schematics​

Schematics

Bill of Materials​

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller39 RON
Servo Motor SG92RThe Servo Motor20 RON
Raspberry Pi Pico Debug probePico Debug Probe66 RON
HC-SR04+ Distance sensorUsed to measure the distance from the pet to the device15 RON
ESP32-CAM with OV2640 CameraMicrocontroler ESP32-CAM with OV264047 RON

Software​

LibraryDescriptionUsage
embassyAsync executor and HALAsynchronous framework for embedded Rust
embassy-executorTask executorRuns your async tasks like HTTP server, distance monitor, button
embassy-netNetworking stackEnables static IP, Wi-Fi AP, TCP server on the Pico W
embassy-rpRP2040 HAL via EmbassyAccess to GPIO, PWM, ADC, timers for Raspberry Pi Pico 2W
embassy-timeAsync time handlingProvides Timer:: after() and Instant:: now ( )
static_cellStatic memory allocationNeeded for safely creating global resources (Wi-Fi stack)
defmt, defmt-rttDebugging and loggingFor logging with low overhead in embedded systems
panic-probePanic handling for no_stdLightweight panic handler for debug output
esp-idf-sysESP-IDF system bindingsAccess to ESP32-CAM system internals (C functions)
esp-idf-halHardware Abstraction Layer for ESP32GPIOs, clocks, etc. on the ESP32
esp-idf-svcHigh-level ESP32 servicesStarts the HTTP stream server on ESP32-CAM
logStandard Rust loggingLogs messages from ESP32 camera logic
camera_configCustom module (in Rust)get-camera_config() function to configure the OV2640 camera
  1. link
  2. link ...