Differences

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

Link to this comparison view

pm:prj2025:eradu:iulian_adrian.andrei [2025/05/26 00:37]
iulian.andrei2608
pm:prj2025:eradu:iulian_adrian.andrei [2025/05/26 18:15] (current)
iulian.andrei2608
Line 97: Line 97:
  
 ===== Software Design ===== ===== Software Design =====
- 
- 
-<note tip> 
-Descrierea codului aplicaţiei (firmware): 
-  * mediu de dezvoltare (if any) (e.g. AVR Studio, CodeVisionAVR) 
-  * 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>​ 
  
 === Development Environment === === Development Environment ===
Line 143: Line 134:
       - Normal,       - Normal,
       - Hyperglycemia.       - Hyperglycemia.
-    * A corresponding LED is lit using PWM pins (`D5``D6``D10``D11`) for visual alert.+    * A corresponding LED is lit using PWM pins (D3, D5, D6, D9, D10, D13) for visual alert.
     * The result is also displayed on the I2C LCD, showing both the glucose level and category.     * The result is also displayed on the I2C LCD, showing both the glucose level and category.
  
 === Current Implementation Status === === Current Implementation Status ===
  
-  * Analog signal reading via ADC (`A2`) – fully functional.+  * Analog signal reading via ADC (A2) – fully functional.
   * Glucose calculation and classification – implemented and verified.   * Glucose calculation and classification – implemented and verified.
   * PWM output on LEDs (pins D3, D5, D6, D9, D10, D13).   * PWM output on LEDs (pins D3, D5, D6, D9, D10, D13).
   * LCD display via I2C – correctly displays readings and thresholds.   * LCD display via I2C – correctly displays readings and thresholds.
-  * External interrupt on `D2– used for manual measurement triggering.+  * External interrupt on D2 – used for manual measurement triggering.
  
  
-=== Library Choice Justification ​===+=== Implemented functions ​===
  
-We selected minimal standard libraries to retain low memory usage and ensure high compatibility with the ATmega328P`LiquidCrystal_I2C` simplifies LCD communication,​ while `EEPROM.h` enables storing calibration data without relying on external storage modules.+  * **handleButtonInterrupt()** – Interrupt service routine (ISR) called when the user presses the buttonIt toggles the state of the glucometer (//​glucometerON//​) and sets a flag (//​buttonPressed//​) for state management.
  
-=== Novelty and Educational Value ===+  * **turnOffAllLEDs()** – Sets PWM output of all six LEDs to zero using //​analogWrite//​. This ensures a clean reset when the system is turned off or reinitialized.
  
-The project simulates a glucose meter using accessible components. A **potentiometer** is used to simulate ​the variable current output of an electrochemical test strip, allowing analog simulation of different ​glucose ​levels. This makes the project highly didactic and safe for experimentation.+  ​* **adjustRedPWM(diff)** – Called when hyperglycemia ​is detected. It calculates the intensity of red LEDs proportionally ​to how far the glucose ​level exceeds 150 mg/dL.
  
-=== Use of Laboratory Techniques ===+  * **adjustYellowPWM(diff)** – Called in hypoglycemia cases. It increases the brightness ​of yellow LEDs proportionally to how far below 100 mg/dL the glucose level is.
  
-  * **ADC** (A0): reads the voltage from the OP07 output. +  * **adjustGreenPWM(glucose)** – Called when glucose ​levels are within normal rangeIt calculates ​ratio within ​the 100–150 mg/dL band to smoothly vary the intensity between ​the two green LEDs.
-  ​* **PWM outputs** (D5, D6, D10, D11): control LED brightness based on glucose ​severity. +
-  * **I2C communication** (A4, A5): used for the LCD. +
-  * **External interrupt** (D2): triggers ​reading without blocking ​the main loop. +
-  * **EEPROM usage**: stores and retrieves calibration data. +
-   +
-These features reflect ​the concepts covered in embedded systems lab sessions.+
  
-=== Software Architecture ​===+===== Results Obtained =====
  
-  * **Potentiometer** simulates sensor behavior ​by varying voltage into the op-amp. +During the operation of the project, the current value generated ​by the potentiometer,​ which simulates the current from an electrochemical test strip, is read through the Arduino’s analog input pinBased on this current, the code calculates ​the estimated ​glucose concentration ​and displays ​it on the 1602 LCD screen.
-  * **OP07** outputs a voltage proportional to this signal. +
-  * **Arduino Uno** reads this voltage through `A0` using the ADC. +
-  * The value is converted to glucose concentration ​(mg/dL) using a calibrated linear mapping. +
-  * Glucose level is categorized:​ +
-    - Below threshold → hypoglycemia. +
-    - Within range → normal. +
-    - Above range → hyperglycemia. +
-  * PWM-driven LEDs light up accordingly. +
-  * LCD displays ​current glucose value and category. +
-  * Push button ​on `D2` allows manual triggering of a reading using interrupts. +
-  * EEPROM retains calibration between power cycles.+
  
-Each feature was implemented ​and tested individually before integrationensuring correctness.+According to the calculated glucose level, RGB LEDs are controlled via PWM signals to indicate different glycemic states: 
 +  * For values below 100 mg/dL, yellow LEDs light up, indicating hypoglycemia. 
 +  * For values between 100 and 150 mg/dL, green LEDs are active, indicating a normal level. 
 +  * For values above 150 mg/dL, red LEDs turn onsignaling hyperglycemia.
  
-=== Sensor Calibration ===+These results were validated through manual testing by adjusting the potentiometer and observing the corresponding changes on the display and LED intensity, confirming the correct operation of the system in simulating glucose measurement.
  
-Calibration was done manually using known positions of the potentiometer ​to simulate known glucose levelsFor each setting:+The system responds quickly ​to changes in current and provides a clear user interface through the LCD display and visual LED indicators.
  
-  1. The ADC value was recorded. 
-  2. A glucose value (in mg/dL) was associated with it. 
-  3. A linear mapping formula was derived: 
  
  
 +===== Conclusion =====
  
-===== Rezultate Obţinute ===== +This project successfully demonstrates a basic but functional glucometer built with Arduino. By simulating the sensor signal with a potentiometer and using an operational amplifier, we were able to measure small currents and convert them into glucose levels. The system provides clear feedback through an LCD display and colored LEDs, offering both visual and numerical information to the user.
- +
-<note tip> +
-Care au fost rezultatele obţinute în urma realizării proiectului vostru. +
-</​note>​ +
- +
-===== Concluzii =====+
  
 ===== Download ===== ===== Download =====
  
-<note warning> +Source code: 
-O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectuluisurse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-).+ 
 +https://github.com/​AdrianIulian26/​GlucoMeter
  
-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 =====
Line 226: Line 194:
 ===== Bibliografie/​Resurse ===== ===== Bibliografie/​Resurse =====
  
-<​note>​ +==== Hardware ==== 
-Listă cu documente, datasheet-uri,​ resurse Internet folosite, eventual grupate pe **Resurse ​Software** şi **Resurse Hardware**+ 
-</note>+  OP07 Operational Amplifier Datasheet  
 +    [https://​www.ti.com/​lit/​ds/​symlink/​op07.pdf TI OP07 Datasheet] 
 + 
 +  ​How Electrochemical Glucose Sensors Work   
 +    [https://​www.ncbi.nlm.nih.gov/​pmc/​articles/​PMC6790891/​ PMC Article on Electrochemical Glucose Biosensors] 
 + 
 +  * Principles of Glucose Meter Operation (Explanation) ​  
 +    [https://​www.ncbi.nlm.nih.gov/​pmc/​articles/​PMC3904486/​ NIH PMC Article on Glucose Meter Principles] 
 + 
 +==== Software ​==== 
 +  ​PWM Control with Arduino (Explanation and Examples) ​  
 +    [https://​www.arduino.cc/​en/​Tutorial/​PWM Arduino PWM Tutorial] 
 + 
 +  * Arduino Serial Communication Basics ​  
 +    [https://​www.arduino.cc/​en/​Serial/​Begin Arduino Serial] 
  
 <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​
  
  
pm/prj2025/eradu/iulian_adrian.andrei.1748209054.txt.gz · Last modified: 2025/05/26 00:37 by iulian.andrei2608
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