Pet Feeder
Automatic food dispenser for animals
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:
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ā
Bill of Materialsā
Device | Usage | Price |
---|---|---|
Raspberry Pi Pico 2W | The microcontroller | 39 RON |
Servo Motor SG92R | The Servo Motor | 20 RON |
Raspberry Pi Pico Debug probe | Pico Debug Probe | 66 RON |
HC-SR04+ Distance sensor | Used to measure the distance from the pet to the device | 15 RON |
ESP32-CAM with OV2640 Camera | Microcontroler ESP32-CAM with OV2640 | 47 RON |
Softwareā
Library | Description | Usage |
---|---|---|
embassy | Async executor and HAL | Asynchronous framework for embedded Rust |
embassy-executor | Task executor | Runs your async tasks like HTTP server, distance monitor, button |
embassy-net | Networking stack | Enables static IP, Wi-Fi AP, TCP server on the Pico W |
embassy-rp | RP2040 HAL via Embassy | Access to GPIO, PWM, ADC, timers for Raspberry Pi Pico 2W |
embassy-time | Async time handling | Provides Timer:: after() and Instant:: now ( ) |
static_cell | Static memory allocation | Needed for safely creating global resources (Wi-Fi stack) |
defmt, defmt-rtt | Debugging and logging | For logging with low overhead in embedded systems |
panic-probe | Panic handling for no_std | Lightweight panic handler for debug output |
esp-idf-sys | ESP-IDF system bindings | Access to ESP32-CAM system internals (C functions) |
esp-idf-hal | Hardware Abstraction Layer for ESP32 | GPIOs, clocks, etc. on the ESP32 |
esp-idf-svc | High-level ESP32 services | Starts the HTTP stream server on ESP32-CAM |
log | Standard Rust logging | Logs messages from ESP32 camera logic |
camera_config | Custom module (in Rust) | get-camera_config() function to configure the OV2640 camera |