A simple embedded monitoring system built on the ATmega2560 using AVR Assembly.
This project monitors environmental conditions in a small room or study-area model using three analog sensors:
- LM35 temperature sensor
- LDR light sensor
- KY-038 analog sound sensor
According to the detected conditions, the system activates different outputs:
- Red warning LED for high temperature
- Yellow warning LED for low light
- Green warning LED for sound events
- 5V cooling fan
- Active buzzer alarm
The objective of this project was to design and implement an embedded room-monitoring prototype using the ATmega2560 and AVR Assembly, integrating analog sensing and actuator control under predefined alarm conditions.
This work was developed as part of my Embedded Systems course project.
- Reads three analog sensors through the ADC
- Controls LEDs, fan, and buzzer directly from the microcontroller
- Built almost entirely in AVR Assembly
- Works as a standalone embedded system without requiring a PC during operation
If temperature exceeds the configured threshold:
- Red LED turns on
- Fan turns on
If the environment is dark:
- Yellow LED turns on
If a strong sound event is detected:
- Green LED turns on
To improve event visibility, the sound indicator now uses a short hold window:
- After a valid sound event, the green LED remains active briefly even if the next sample falls below threshold.
- If three abnormal conditions are active at the same time, the buzzer sounds intermittently while active condition LEDs remain on
- If zero, one, or two abnormal conditions are active, the buzzer stays off
- Arduino Mega 2560 / ATmega2560
- LM35
- LDR
- KY-038
- Active 5V buzzer
- 5V fan
- 2N2222 transistor
- 1N4007 diode
- LEDs
- Resistors
- Breadboard and jumper wires
A0-> LM35A1-> LDRA2-> KY-038 analog output
D12-> Red temperature LEDD11-> Fan controlD10-> Yellow light warning LEDD9-> Green sound warning LEDD8-> Buzzer
- Presentation files are available in
docs/. - Build/reference photos are available in
img/. - The printable enclosure models are available in
3d/. - The LDR was used as the sensor selected for the technical explanation of non-linear behavior.
- Threshold values were adjusted experimentally during testing.
- The sound sensor responds better to sharp nearby acoustic events than to continuous speech.
- Current firmware includes a short noise hold (
HOLD_RUIDO) to avoid losing brief sound events between ADC cycles.