Smart Environment Control System
A sensor-driven environment monitor built on an Arduino Uno, designed and simulated in Tinkercad and programmed in the Arduino IDE. The system reads three analog inputs and one button: a TMP36 temperature sensor, a photoresistor for ambient light, a potentiometer that sets the alarm temperature between 25 and 45 °C, and an emergency pushbutton. It reports its state with green, yellow and red LEDs and a 1 kHz buzzer. Temperature drives four system states. Below 25 °C the system is NORMAL (green LED). From 25 to 35 °C it is in WARNING (yellow LED). At 35 °C and above it is in DANGER (red LED and buzzer). Independently of this, the potentiometer sets an adjustable alarm threshold, and the buzzer sounds whenever the temperature reaches it. The photoresistor adds an ambient-light layer: in the dark, the yellow LED blinks every 500 ms (while the temperature is below the danger level). The emergency button overrides everything: pressing it switches off the other LEDs, turns on the red LED and the buzzer, and sets the system to EMERGENCY. It is built for reliable behaviour. Timing uses millis() instead of delay(), so the board keeps reading the sensors and the button while the LED blinks and the monitor updates. The button uses the board's internal pull-up resistor, so no external resistor is needed, and the emergency message prints once per press instead of flooding the serial output. Every second, the serial monitor reports the temperature, alarm threshold, light level and status, system status and buzzer command. The simulation was tested step by step with the potentiometer, the photoresistor and the button, as shown in the second screenshot. Where it applies: the same logic can serve as the core of a server-room or lab temperature monitor, a greenhouse or incubator alarm, or a cold-storage warning panel, wherever an operator needs a clear colour-coded status, an adjustable alarm point and a manual emergency button.
Source Code
if (emergencyPressed) // overrides everything
{
redState = true;
buzzerState = true;
systemStatus = "EMERGENCY";
}
else if (temperatureC < 25.0) // NORMAL
{
greenState = true;
systemStatus = "NORMAL";
}
else if (temperatureC < 35.0) // WARNING
{
yellowState = true;
systemStatus = "WARNING";
}
else // DANGER
{
redState = true;
buzzerState = true;
systemStatus = "DANGER";
}
// Adjustable alarm point from the potentiometer (25-45 C)
if (temperatureC >= alarmTemperature)
buzzerState = true;