Author: Perian Bianca-Luminita | Group: 331CB
We all love our pets, but remembering to fill the bowl at the exact same time every day is just another task on a never-ending to-do list. So, here I am with the solution: an Automatic Pet Feeder. But what is it, exactly? It's a smart solution for a common problem. The device is designed to automate the feeding routine while keeping you in control. It features two main modes: an 'on-demand' option where your pet can trigger a snack using an IR sensor, and a manual option that lets you dispense food via a custom web interface from your phone. Beyond just dispensing food, the system monitors storage levels so you always know when it's time for a refill. It also tracks feeding history, letting you see exactly when the last meals were served. Most importantly, you have full control: if your pet is getting a bit too hungry, you can remotely disable the IR sensor through the interface to prevent overfeeding. So, now you have more time to play with your furry friend!
This table describes the physical connections made on the breadboard between the ESP32 microcontroller and the system's peripherals:
| Component | ESP32 Pin | Interface |
|---|---|---|
| Ultrasonic Sensor (TRIG) | D5 | GPIO / Output |
| Ultrasonic Sensor (ECHO) | D18 | GPIO / Input |
| IR Sensor | D4 | GPIO / Input (Pull-up) |
| SG90 Servomotor | D13 | PWM / Output |
| Active Buzzer | D26 | GPIO / Output |
| Red LED | D32 | GPIO / Output |
| Yellow LED | D33 | GPIO / Output |
| Green LED | D25 | GPIO / Output |
| LCD1602 SDA | D21 | I2C (Data) |
| LCD1602 SCL | D22 | I2C (Clock) |
| Power Supply | VIN (5V) | Power Input |
I've developed this ESP32 project using the Wokwi simulator. Since the platform doesn't offer a dedicated IR proximity sensor, I used a push button to simulate the pet's arrival. This allowed me to fully test and perfect the logic for the LCD, LEDs, buzzer, and servo, ensuring the system is ready for a quick swap with a real IR sensor once I move to the physical build.
The software is designed to bridge the gap between the physical feeder and the user's smartphone. While this stage of the project is still in the planning phase, the goal of the future application or web interface is to provide users with real-time updates on food levels and a detailed meal history. Additionally, the app will offer the ability to trigger a feeding or disable the IR sensor remotely via WiFi, ensuring the pet is always cared for, even when the owner isn't home.
The project firmware is developed using Arduino IDE / PlatformIO (C++), while the responsive user interface is built using HTML5, CSS3, and JavaScript.
The main libraries used to connect the hardware with the web interface are:
The system is designed to run asynchronously, ensuring that the web interface stays responsive even while the mechanical feeding parts are active.
The communication between the interface and the ESP32 happens asynchronously through a REST API. This allows the pet feeder to receive commands and send telemetry data back instantly without disrupting the device's main operations.
| Functionality | Project Implementation & Justification |
|---|---|
| Laboratorul 0: GPIO | Used as Digital Input for the IR Sensor and Digital Output for the status LEDs and Buzzer. |
| Laboratorul 1: UART | Used for Serial debugging (`Serial.print`) to monitor sensor data and network status. |
| Laboratorul 3: Timere. PWM | Timere: Used via `millis()` for non-blocking sensor polling and schedule checks. PWM: Used to control the SG90 Servo Motor angle for food dispensing. |
| Laboratorul 6: I2C | Used for data communication with the 16×2 LCD display using only two pins (SDA/SCL). |
Hardware Reference
Software and Tools
Libraries Used