Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2025:eradu:andra.belceanu [2025/05/19 11:53]
andra.belceanu [Sources and Implemented Functions]
pm:prj2025:eradu:andra.belceanu [2025/05/29 23:35] (current)
andra.belceanu [Software Design]
Line 121: Line 121:
 All components share a common GND, and are powered from the Arduino’s 5V rail. Pin assignments were selected to minimize conflict with internal timers and preserve clean signal timing for both the servo and WS2812 LEDs. All components share a common GND, and are powered from the Arduino’s 5V rail. Pin assignments were selected to minimize conflict with internal timers and preserve clean signal timing for both the servo and WS2812 LEDs.
  
-====== Software Design ======+{{:​pm:​prj2025:​eradu:​whatsapp_image_2025-05-21_at_18.27.41_2_.jpeg?​200|}} 
 +{{:​pm:​prj2025:​eradu:​whatsapp_image_2025-05-21_at_18.27.41.jpeg?​200|}} 
 +{{:​pm:​prj2025:​eradu:​whatsapp_image_2025-05-21_at_18.27.41_1_.jpeg?​200|}} 
 +{{:​pm:​prj2025:​eradu:​whatsapp_image_2025-05-21_at_18.27.41_3_.jpeg?​200|}} 
 +{{:​pm:​prj2025:​eradu:​whatsapp_image_2025-05-21_at_18.27.41_5_.jpeg?​200|}}
  
-**Development Environment:​** +===== Software ​Design ​=====
- +
-The firmware was developed using the **Arduino IDE**, chosen for its simplicity and built-in support for common microcontroller platforms such as Arduino Uno. The environment supports both code compilation and serial monitoring. +
- +
-**Libraries and 3rd-Party Sources Used:** +
- +
-^ Library Name           ^ Purpose ​                                                                ^ +
-| FastLED.h ​             | Controls WS2812 RGB LED matrices with high-performance animations ​       | +
-| Adafruit_NeoPixel.h ​   | Alternative library for driving NeoPixel (WS2812) LEDs                   | +
-| Servo.h ​               | Controls the servo motor responsible for food dispensing ​    | +
-| EEPROM.h ​              | Store configuration or last feeding timestamp ​                 | +
-| TimerOne.h ​            | Enables time-based control for feeding intervals ​              | +
- +
-**Algorithms and Planned Structures:​** +
- +
-The firmware is structured into two main parts: +
- +
-  * **1. LED Animation Control** +
-    - Handles 3 predefined animations using FastLED (`snake`, `vortex`, `int_ext`). +
-    - A **button** is used to switch between animation modes (via external interrupt). +
-    - A **potentiometer** adjusts the color of animations in real-time. +
- +
-  * **2. Cat Feeder Logic (to be implemented in Stage 3)** +
-    - Uses a **proximity sensor** to detect the presence of the cat. +
-    - When the cat is present and enough time has passed since the last feeding: +
-        - A **servo motor** rotates to release food. +
-        - A light animation or color feedback is shown to indicate successful feeding. +
- +
-===== Software ​Implementation ​=====+
  
 <note important>  ​ <note important>  ​
-This section documents the current state of the software implementation for the **PurrGlow Feeder** project, including development decisions, feature validation, and sensor calibration.  ​+This section documents the current state of the software implementation for the **PurrGlow Feeder** project, including development decisions, feature validation, and sensor calibration. The firmware was developed using the **Arduino IDE**, chosen for its simplicity and built-in support for common microcontroller platforms such as Arduino Uno. The environment supports both code compilation and serial monitoring.  ​
 </​note>​ </​note>​
  
Line 188: Line 164:
 We reused and extended concepts from the labs: We reused and extended concepts from the labs:
  
- * **Laborator ​0 (GPIO)** – Used for ultrasonic trigger/​echo,​ servo control, LED signal, and button input + * **Lab 0 (GPIO)** – Used for ultrasonic trigger/​echo,​ servo control, LED signal, and button input 
- * **Laborator ​2 (Interrupts)** – External interrupt on D2 allows seamless light mode switching via button + * **Lab 2 (Interrupts)** – External interrupt on D2 allows seamless light mode switching via button 
- * **Laborator ​3 (Timere, PWM)** – Servo is controlled via Servo.h, which uses PWM on pin D5 + * **Lab 3 (Timere, PWM)** – Servo is controlled via Servo.h, which uses PWM on pin D5 
- * **Laborator ​4 (ADC)** – The potentiometer is read as analog input to control LED speed or color + * **Lab 4 (ADC)** – The potentiometer is read as analog input to control LED speed or color
- * **Laborator 5 (SPI)** – Indirectly applied via the WS2812B communication handled by FastLED+
  
 **Project Architecture** **Project Architecture**
Line 216: Line 191:
  * Noise filter: Brief readings under 300 ms are ignored  * Noise filter: Brief readings under 300 ms are ignored
  
-**Optimizations Performed** 
- 
- * Brightness capped at 10/255 → limits power draw to ~200 mA 
- * Animation auto-stop after 22 seconds to conserve energy 
- * Removed unused light games (e.g., arrow()) to reduce flash size 
  
 **Sources and Implemented Functions** **Sources and Implemented Functions**
Line 237: Line 207:
  
 **Demo Video** **Demo Video**
 +Video link: https://​youtube.com/​shorts/​k56aoU-vjDw?​feature=share
  
 The video shows: The video shows:
Line 246: Line 216:
  * Color/speed tuning with potentiometer  * Color/speed tuning with potentiometer
  
 +Source code: https://​github.com/​AndraBel/​PurrGlow-Feeder/​tree/​main
 +
 +
 +===== Conclusion =====
 +
 +Working on the PurrGlow Feeder project has been a very interesting and rewarding experience. I spent a lot of time and effort especially on assembling the LED cube, combining five separate matrices into a clean, functional structure was far more difficult than expected. The feeder system itself also posed its own challenges, particularly in calibrating the servo movement and integrating it with the sensor logic. Even though it took a good amount of trial and error, I'm proud that both the animation system and the food dispensing logic now work. The whole project came together nicely, and seeing it function in real life made all the effort worthwhile.
  
-==== Conclusion ==== 
pm/prj2025/eradu/andra.belceanu.1747644809.txt.gz · Last modified: 2025/05/19 11:53 by andra.belceanu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0