This is an old revision of the document!
Fodor Mihnea-Stefan 331CA
The smart ambient station automatically monitors temperature and adjusts a cooling fan's speed based on predefined thermal thresholds. It also displays the current real-time clock and allows full manual control via an infrared remote.
The purpose of the project is to maintain a comfortable local climate through automated cooling, while providing visual feedback and auditory alerts. It includes a critical safety mechanism that immediately halts all operations if the device is tilted or knocked over.
The starting concept was a standard thermostat, which evolved into a robust embedded system featuring a state machine, hardware-level safety interrupts and custom communication protocol implementations without relying on heavy third-party Arduino libraries.
For the user it serves as a practical desktop cooling and timekeeping gadget. It offers a highly affordable alternative to commercial cooling devices, while providing the flexibility of full manual control to suit personal comfort.
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.
Bill of materials:
Development Environment:
Libraries: <avr/io.h>, <avr/interrupt.h>, <util/delay.h>, <math.h>, <stdlib.h>, <stdio.h>.
Algorithms:
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.
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.
The module correctly renders the current time fetched from the DS3231 via custom functions.
The project successfully bridges analog signal processing, digital communication and power management within a single 8-bit microcontroller architecture. It was an interesting challange both for software and hardware, needing some creative solutions for a few problems.