Differences

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

Link to this comparison view

pm:prj2025:avaduva:sorin.popescu2306 [2025/05/25 19:49]
sorin.popescu2306 [Software Design]
pm:prj2025:avaduva:sorin.popescu2306 [2025/05/26 00:06] (current)
sorin.popescu2306 [Rezultate Obţinute]
Line 153: Line 153:
  
 The software combines interaction,​ sound, and visual elements to create an engaging user experience. The software combines interaction,​ sound, and visual elements to create an engaging user experience.
 +
 +
 +==== Justification for Using Laboratory Functionalities in the Project ====
 +
 +=== OLED Display and I2C Communication (Lab 6 - I2C) ===
 +The OLED screen is used to display menus, game instructions,​ and feedback to the user. It communicates via the I2C protocol using the Wire library. Functions such as <​code>​display.begin()</​code>,​ <​code>​display.clearDisplay()</​code>,​ and <​code>​display.display()</​code>​ reflect the practical application of Lab 6 concepts.
 +
 +=== Buzzer and Tone Generation (Lab 3 - PWM) ===
 +The buzzer is used to provide audio feedback in the "Match the Weight"​ game. The <​code>​tone()</​code>​ function utilizes the PWM feature to generate audio signals. As the weight approaches the target value, the rhythm speeds up, demonstrating real-time control over frequency generation.
 +
 +=== Weight Reading via HX711 (Lab 4 - ADC) ===
 +The weight sensor is interfaced using the HX711 ADC module, which reads analog signals from a load cell. This directly implements the analog-to-digital conversion concepts introduced in Lab 4. The function <​code>​scale.get_units()</​code>​ reads these values in digital form.
 +
 +=== Matrix Keypad Input (Lab 0 - Digital Inputs) ===
 +The 4x3 matrix keypad allows the user to input commands and navigate the menu. It is scanned to detect key presses by reading digital signals, which aligns with the digital input techniques introduced in Lab 0.
 +
 +=== Serial Communication (Lab 1 - USART) ===
 +<​code>​Serial.print()</​code>​ and <​code>​Serial.println()</​code>​ are used for debugging and displaying values such as the current weight. This is a practical use of USART, as explored in Lab 1.
 +
 +=== Timing and Delays (Lab 2 / Lab 3) ===
 +Delays using <​code>​delay()</​code>​ are introduced to manage user interaction timing (e.g., allowing the user to see feedback before the next step). These practices relate to timing management topics covered in Labs 2 and 3.
 +
 +== Summary Table ==
 +
 +|-
 +| OLED (I2C) || Lab 6 || Display via I2C; menu and feedback interface
 +|-
 +| Buzzer (PWM) || Lab 3 || Audio feedback using PWM and tone frequency
 +|-
 +| HX711 (ADC) || Lab 4 || Reading analog signals via ADC
 +|-
 +| Matrix Keypad || Lab 0 || Digital input and key scanning
 +|-
 +| Serial Communication || Lab 1 || Debugging and displaying weight values
 +|-
 +| Menu / State Logic || Lab 2 || Event-based state handling
 +|-
 +| Timing / Delays || Lab 2 / Lab 3 || Managing time-based interactions
 +|}
 +
 +==== Project Structure and Feature Interaction ====
 +
 +=== OLED Display (Adafruit SSD1306 128x64) ===
 + Shows the main menu, game instructions,​ user prompts, and results.
 + ​Provides all visual feedback to the user during setup and gameplay.
 +
 +=== HX711 Weight Sensor + Load Cell ===
 + ​Accurately measures the weight of objects placed on the device.
 + Used in both games to set or check the weight value.
 +
 +=== 4x3 Keypad ===
 + Lets the user navigate menus, select game modes, and enter numerical guesses or commands (such as start, confirm, or return to menu).
 +
 +=== Buzzer ===
 + ​Outputs audio signals for feedback.
 + Plays different tones to indicate success or to help the user get closer to the target weight in the matching game.
 +
 +=== Arduino Board ===
 + ​Central controller that runs the main program.
 + Reads inputs from the keypad and weight sensor, updates the display, and controls the buzzer.
 +
 +==== Functionalities Validation ====
 +To test the weight sensor, I weighed an object with a kitchen scale and checked if the values matched.
 +
 +==== Sensor Calibration ====
 +For the weight sensor, I used an object with a known weight (75 grams) and observed the sensor reading (approximately 148,500). Based on this, I calculated the calibration factor as (sensor_value / actual_weight).
 +
 +==== Optimization ====
 +
 +Used modular functions for clarity and easier maintenance.
 +
 +Limited display updates to only when changes occur, reducing flicker.
 +
 +Grouped hardware initialization in setup for faster start.
 +
 +Provided immediate feedback with the buzzer for better user experience.
 +  ​
 +Used keypad library debouncing for reliable input.
 +
 +Calibrated the weight sensor once for consistent measurements.
 +
  
 ===== Rezultate Obţinute ===== ===== Rezultate Obţinute =====
  
-<note tip> 
-Care au fost rezultatele obţinute în urma realizării proiectului vostru. 
-</​note>​ 
  
 +**Demo**
 +
 +<​html><​iframe width="​560"​ height="​315"​ src="​https://​youtube.com/​embed/​iKKtlptE3Co"​ title="​YouTube video player"​ frameborder="​0"​ allow="​accelerometer;​ autoplay; clipboard-write;​ encrypted-media;​ gyroscope; picture-in-picture;​ web-share"​ referrerpolicy="​strict-origin-when-cross-origin"​ allowfullscreen></​iframe></​html>​
 ===== Concluzii ===== ===== Concluzii =====
  
 ===== Download ===== ===== Download =====
  
-<note warning>​ +{{:pm:prj2025:avaduva:guesstheweight.zip}}
-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ă ;-). +
- +
-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**. +
-</​note>​+
  
 ===== Jurnal ===== ===== Jurnal =====
pm/prj2025/avaduva/sorin.popescu2306.1748191750.txt.gz · Last modified: 2025/05/25 19:49 by sorin.popescu2306
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