This shows you the differences between two versions of the page.
|
pm:prj2026:bianca.popa1106:mihnea_stefan.fodor [2026/05/06 15:59] mihnea_stefan.fodor |
pm:prj2026:bianca.popa1106:mihnea_stefan.fodor [2026/05/16 17:24] (current) mihnea_stefan.fodor [Bibliography/Resources] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Smart ambient climate station ====== | + | ====== Ambient climate station ====== |
| Fodor Mihnea-Stefan 331CA | Fodor Mihnea-Stefan 331CA | ||
| ===== Introduction ===== | ===== Introduction ===== | ||
| Line 12: | Line 12: | ||
| ===== General Description ===== | ===== General Description ===== | ||
| + | |||
| + | The ATmega328P runs a continuous state machine. In Auto Mode, it reads the ADC, calculates the temperature using the Steinhart-Hart equation and adjusts the PWM output to the fan. In Manual Mode, the IR receiver triggers an interrupt that decodes the NEC signal, allowing the user to override the fan speed, toggle RGB disco mode or trigger alarm. The Tilt Sensor has the highest priority: if triggered, it overrides all states, cuts power to the fan, and displays an error (----) on the clock display. | ||
| {{block-schema_fodor_mihnea-stefan.png?600}} | {{block-schema_fodor_mihnea-stefan.png?600}} | ||
| Line 17: | Line 19: | ||
| ===== Hardware Design ===== | ===== Hardware Design ===== | ||
| - | <note tip> | + | Bill of materials: |
| - | Aici puneţi tot ce ţine de hardware design: | + | * ATmega328P |
| - | * listă de piese | + | * 10k NTC thermistor |
| - | * scheme electrice (se pot lua şi de pe Internet şi din datasheet-uri, e.g. http://www.captain.at/electronic-atmega16-mmc-schematic.png) | + | * DS3231 mini RTC module |
| - | * diagrame de semnal | + | * TM1637 4-digit display |
| - | * rezultatele simulării | + | * VS1838B infrared receiver & IR remote |
| - | </note> | + | * SW-520D tilt sensor |
| + | * sunon maglev 5V DC fan | ||
| + | * buzzer | ||
| + | * RGB LED | ||
| + | * NPN transistor 2N2222 | ||
| + | * resistors | ||
| + | * wires | ||
| + | |||
| + | {{circuit_image_fodor_mihnea-stefan.png?600}} | ||
| ===== Software Design ===== | ===== Software Design ===== | ||
| + | Development Environment: | ||
| + | |||
| + | * Visual Studio Code with the PlatformIO extension | ||
| + | |||
| + | * AVR-GCC managed automatically through the PlatformIO framework | ||
| + | |||
| + | Libraries: <avr/io.h>, <avr/interrupt.h>, <util/delay.h>, <math.h>, <stdlib.h>, <stdio.h>. | ||
| + | |||
| + | Algorithms: | ||
| + | |||
| + | * State machine implemented via a switch-case and global volatile flags (sistem_blocat, mod_manual, sistem_pornit) to manage transitions between states. | ||
| + | * Steinhart-Hart equation used to convert raw 10-bit ADC values from the NTC thermistor into accurate Celsius temperature readings. | ||
| + | * NEC protocol decoder that measures high/low pulse durations using a delay-based timer to reconstruct the 32-bit hexadecimal IR code. | ||
| + | * Instantaneous triggering on INT0 for the tilt sensor to immediately halt the system. | ||
| + | * BCD to decimal conversion. | ||
| + | ===== Results Obtained ===== | ||
| + | |||
| + | The system successfully modulates fan speeds and updates RGB indicators based on real-time temperature fluctuations without blocking the main loop. | ||
| + | |||
| + | The custom NEC decoder accurately captures 32-bit remote codes, allowing seamless toggling between Auto and Manual modes, speed adjustments and effects. | ||
| - | <note tip> | + | The hardware initially suffered from false tilt-sensor triggers due to buzzer vibrations. This was successfully resolved via software debouncing logic and hardware piece arrangement. |
| - | 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> | + | |
| - | ===== Rezultate Obţinute ===== | + | The module correctly renders the current time fetched from the DS3231 via custom functions. |
| + | ===== Conclusions ===== | ||
| - | <note tip> | + | The project successfully bridges analog signal processing, digital communication, and power management within a single 8-bit microcontroller architecture. It was an interesting challenge for both software and hardware, requiring creative engineering solutions to overcome several technical obstacles. |
| - | Care au fost rezultatele obţinute în urma realizării proiectului vostru. | + | |
| - | </note> | + | |
| - | ===== Concluzii ===== | + | ===== Bibliography/Resources ===== |
| - | ===== Download ===== | ||
| - | <note warning> | + | ATmega328P Microcontroller: https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf |
| - | 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**. | + | DS3231 RTC: https://www.analog.com/media/en/technical-documentation/data-sheets/ds3231.pdf |
| - | </note> | + | |
| - | ===== Jurnal ===== | + | TM1637 datasheet: https://www.puntoflotante.net/DATASHEET-TM1637.pdf |
| - | <note tip> | + | VS1838b datasheet: https://www.sivago.com.cn/upload/pdf/2022/VS1838B.pdf |
| - | Puteți avea și o secțiune de jurnal în care să poată urmări asistentul de proiect progresul proiectului. | + | |
| - | </note> | + | |
| - | ===== Bibliografie/Resurse ===== | + | NEC Infrared: https://www.sbprojects.net/knowledge/ir/nec.php |
| - | <note> | + | Steinhart-Hart euation for thermistors: https://en.wikipedia.org/wiki/Steinhart%E2%80%93Hart_equation |
| - | Listă cu documente, datasheet-uri, resurse Internet folosite, eventual grupate pe **Resurse Software** şi **Resurse Hardware**. | + | |
| - | </note> | + | |
| - | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | ||