BURGLAR ALARM - TINKERCAD | ARDUINO

Опубликовано: 04 Сентябрь 2026
на канале: Jumarq Electro
64,491
1k

A house requires an alarm system. In this exercise, we propose that you simulate one. When everyone leaves the house, the last person to leave is responsible for activating the alarm using a 4-digit number. At that moment, the system begins receiving information from the magnetic detectors (reed switches) located at each window and door. The alarm should trigger when a magnetic field alters the state of the reed switch. When the alarm is activated, a sound is emitted, and a visual alarm is also generated. The only way to deactivate the alarm is with a 4-digit numeric code that must be different from the activation code. The steps are described below:

A – A 4-digit integer is received via the serial console. If this number matches the one stored by the system, the alarm system is activated, and the console should display “Alarm activated.”

B – If the reed switch detects a magnetic field, the serial console should display “Intruder detected, system triggered.”

C – Since the alarm has been triggered, the buzzer should activate to generate sound (it is handled as a digital output). Additionally, the yellow and red LEDs should alternate between on and off, emulating the movements of a fire siren at 1-second intervals.

D – To deactivate the alarm, a 4-digit integer code must be entered. If correct, the serial console should display "Alarm deactivated." Otherwise, step C should be repeated until the correct code is entered.

https://www.tinkercad.com/things/2CeP...