This shows you the differences between two versions of the page.
|
pm:prj2026:jan.vaduva:bianca.perian [2026/05/08 21:43] bianca.perian created |
pm:prj2026:jan.vaduva:bianca.perian [2026/05/19 22:45] (current) bianca.perian |
||
|---|---|---|---|
| Line 8: | Line 8: | ||
| ===== General Description ===== | ===== General Description ===== | ||
| + | {{ :pm:prj2026:jan.vaduva:perianbianca.png?600 |}} | ||
| - | {{ :pm:prj2026:jan.vaduva:petfeeder.png?700 | | + | === System Modules === |
| - | + | ||
| - | ===== System Modules ===== | + | |
| * **ESP32 Microcontroller:** The "brain" that connects to Wi-Fi, processes sensor data, and coordinates the feeding schedule. | * **ESP32 Microcontroller:** The "brain" that connects to Wi-Fi, processes sensor data, and coordinates the feeding schedule. | ||
| - | * **SG90 Servo Motor:** The mechanical actuator that rotates to dispense a precise portion of pet food. | + | * **SG90 Servo Motor:** The mechanical actuator that opens the dispensing lid to release a precise portion of pet food. |
| * **IR Obstacle Sensor:** Allows the pet to "ask" for food; when the pet is near, the sensor triggers an automated snack. | * **IR Obstacle Sensor:** Allows the pet to "ask" for food; when the pet is near, the sensor triggers an automated snack. | ||
| * **Ultrasonic Sensor:** Measures the distance to the food inside the hopper to calculate the remaining percentage. | * **Ultrasonic Sensor:** Measures the distance to the food inside the hopper to calculate the remaining percentage. | ||
| - | * **LCD Display:** Provides real-time status updates (e.g., "Feeding...", "Wi-Fi OK"). | + | * **LCD Display:** Provides real-time status updates (e.g., "Feeding..."). |
| * **Buzzer:** Emits a sound notification to alert the pet that the meal has been served. | * **Buzzer:** Emits a sound notification to alert the pet that the meal has been served. | ||
| * **Smart Status LEDs:** A visual signaling system for food levels: | * **Smart Status LEDs:** A visual signaling system for food levels: | ||
| Line 26: | Line 25: | ||
| ===== Hardware Design ===== | ===== Hardware Design ===== | ||
| - | <note tip> | + | === Components List === |
| - | Aici puneţi tot ce ţine de hardware design: | + | |
| - | * listă de piese | + | * **ESP32** DevKit V1 Board |
| - | * scheme electrice (se pot lua şi de pe Internet şi din datasheet-uri, e.g. http://www.captain.at/electronic-atmega16-mmc-schematic.png) | + | * **SG90** Servo Motor |
| - | * diagrame de semnal | + | * **IR** Obstacle Avoidance Sensor |
| - | * rezultatele simulării | + | * **HC-SR04** Ultrasonic Distance Sensor |
| - | </note> | + | * **16x2 LCD** with **I2C** Module |
| + | * Active **Buzzer** | ||
| + | * **LEDs** (Red, Yellow, Green) | ||
| + | * **Resistors** (220 Ohm) | ||
| + | * **Breadboard** | ||
| + | * **Jumper Wires** (M-M, M-F) | ||
| + | * **Power Bank** | ||
| + | |||
| + | === Pin Mapping === | ||
| + | |||
| + | 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 | | ||
| + | |||
| + | === Wokwi Simulation === | ||
| + | |||
| + | {{ :pm:prj2026:jan.vaduva:wokwisim.png?500 |}} | ||
| + | |||
| + | 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. | ||
| + | |||
| + | {{ :pm:prj2026:jan.vaduva:whatsapp_image_2026-05-19_at_22.06.54.jpeg?300 |}} | ||
| + | |||
| + | <html><center></html> | ||
| + | **Pet feeder update:** Hardware is officially finalized! Next step: building the actual housing for it. | ||
| + | <html></center></html> | ||
| ===== Software Design ===== | ===== Software Design ===== | ||
| + | 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. | ||
| + | |||
| + | === Environment and Libraries === | ||
| + | |||
| + | 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: | ||
| + | * **`WiFi.h` & `WebServer.h`:** Connect the ESP32 to the local network and host the web dashboard. | ||
| + | * **`ArduinoJson.h`:** Handles data transmission between the phone interface and the microcontroler. | ||
| + | * **`ESP32Servo.h`:** Controls the SG90 servo motor for the dispensing mechanism. | ||
| + | * **`LiquidCrystal_I2C.h`:** Manages the 16x2 LCD display to show real-time status updates. | ||
| + | * **`time.h`:** Synchronizes the internal clock via **NTP** internet servers to track accurate feeding times. | ||
| + | |||
| + | === Core Logic and System Behavior === | ||
| + | The system is designed to run asynchronously, ensuring that the web interface stays responsive even while the mechanical feeding parts are active. | ||
| - | <note tip> | + | * **Food Level Tracking:** The ultrasonic sensor measures the container's depth and converts the data into an easy-to-read percentage. |
| - | Descrierea codului aplicaţiei (firmware): | + | * **Pet Sensor Cooldown:** To prevent overfeeding, a **30-second cooldown** logic is applied. If the pet stays in front of the IR sensor, successive automated feeds are blocked. |
| - | * mediu de dezvoltare (if any) (e.g. AVR Studio, CodeVisionAVR) | + | * **Safety Alerts:** If the food level drops below $30\%$, the automated feeding is locked, and the buzzer triggers a rapid 4-beep alarm to notify the owner that the reservoir is empty. |
| - | * librării şi surse 3rd-party (e.g. Procyon AVRlib) | + | |
| - | * algoritmi şi structuri pe care plănuiţi să le implementaţi | + | |
| - | * (etapa 3) surse şi funcţii implementate | + | |
| - | </note> | + | |
| - | ===== Rezultate Obţinute ===== | + | === App Communication and REST API === |
| - | <note tip> | + | 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. |
| - | Care au fost rezultatele obţinute în urma realizării proiectului vostru. | + | |
| - | </note> | + | |
| - | ===== Concluzii ===== | + | * **Real-Time Web Dashboard:** The mobile application runs in browser, using background polling every 1.5 seconds to pull fresh status updates from the feeder. |
| + | * **Remote & Automated Triggers:** When a user taps the "Feed Now" button or modifies the automated feeding schedule on their phone, the app sends a direct HTTP request to the ESP32. | ||
| + | * **Time-Based Synchronization:** While the user sets scheduling preferences via the interface, the actual time tracking happens directly on the microcontroller. By constantly cross-referencing its internal NTP network clock with the saved alarms, the feeder dispenses meals fully autonomously, even if the phone goes offline. | ||
| - | ===== Download ===== | + | === Lab Functionalities Justification === |
| - | <note warning> | + | ^ Functionality ^ Project Implementation & Justification ^ |
| - | O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului: surse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-). | + | | **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 16x2 LCD display using only two pins (SDA/SCL). | | ||
| - | Fişierele se încarcă pe wiki folosind facilitatea **Add Images or other files**. Namespace-ul în care se încarcă fişierele este de tipul **:pm:prj20??:c?** sau **:pm:prj20??:c?:nume_student** (dacă este cazul). **Exemplu:** Dumitru Alin, 331CC -> **:pm:prj2009:cc:dumitru_alin**. | + | | {{ :pm:prj2026:jan.vaduva:app1.jpeg?450 }} | {{ :pm:prj2026:jan.vaduva:app2.jpeg?450 }} | |
| - | </note> | + | |
| - | ===== Jurnal ===== | + | <html><center></html> |
| + | * **Pet Profile & Manual Feeding:** Displays the pet's profile and a prominent "Hrănește Acum" button for immediate dispensing. | ||
| + | * **Real-Time Telemetry:** Monitors the exact food storage level, live pet detection alerts, and physical LED diagnostics. | ||
| + | * **System Toggles:** Allows the user to remotely enable or disable the active buzzer sounds and the automatic IR sensor. | ||
| + | * **Schedules & Logs:** Features a clean setup to program automated daily meal times and tracks a history log of all past feedings. | ||
| + | * **Device Parameters:** Shows diagnostic data including the ESP32 IP address, total feed count, uptime, and synchronized network time. | ||
| + | <html></center></html> | ||
| - | <note tip> | + | ===== Results Obtained ===== |
| - | Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului. | + | |
| - | </note> | + | |
| - | ===== Bibliografie/Resurse ===== | + | ===== Bibliography/Resources ===== |
| - | <note> | + | ** Hardware Reference ** |
| - | Listă cu documente, datasheet-uri, resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. | + | * **ESP32 Pinout:** [[https://randomnerdtutorials.com/esp32-pinout-reference-gpios/|ESP32 Pinout Reference (GPIOs)]] |
| - | </note> | + | ** Software and Tools ** |
| + | * **Simulator:** [[https://wokwi.com/|Wokwi Online Simulator]] | ||
| + | * **Development Documentation:** [[https://wokwi.com/pricing?ref=builds|Wokwi Pricing and Features]]. | ||
| + | ** Libraries Used ** | ||
| + | * **LiquidCrystal_I2C Library:** | ||
| + | * **ESP32Servo Library:** | ||
| - | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | ||
| - | }} | ||