This project aims to design and implement an Arduino-based smart siren alarm system. Using the Arduino microcontroller, you will control a siren or buzzer to produce a loud, wailing sound for alarms or warnings. You can use this system in security setups or emergency alert systems. Additionally, the system uses LEDs for visual alerts, offering a multi-sensory warning. You will also integrate a push button that triggers different alarms based on user interaction.
Materials to use
Circuit diagram
Connect the buzzer to digital pin 12 on the control board, the button on pins 3 and 9, and the LEDs to pins 4 through 11.
Figure: Schematic diagram
Figure: Components used to make connection on the board
Arduino Code
After verifying and uploading the code, pressing the button will trigger the buzzer to change its sound, while the LEDs switch colors, acting as an alarm system.
Result
This project controls a sequence of 8 LEDs and a buzzer based on the state of a button connected to pin 3. Here’s what you can expect as the visible output and the program’s behavior:
Initial State: All LEDs (led1 to led8) and the buzzer are OFF.
When you press the button:
- All LEDs (led1 to led8) turn ON sequentially. Each LED lights up in order (led1 → led2 → … → led8) for 500 milliseconds before turning OFF.
- Activates the buzzer: The buzzer produces a tone with varying frequencies corresponding to the current LED pin (e.g., frequency 4 Hz for led1). The tone plays for 3 seconds (3000 ms) before moving to the next LED.
This loop repeats for all LEDs, creating a pattern where each LED turns ON/OFF with a buzzer tone.
When you release the button:
- LEDs (led1 to led8) light up sequentially.
- The buzzer produces a short tone (500 ms) at varying frequencies, corresponding to the LED pin. LEDs turn ON for 10 ms and then OFF as the loop progresses.
Behavior Summary
Pressing the button activates:
A slower sequence: LEDs light up one at a time for 500 ms, with a long buzzer tone (3 seconds) for each LED.
Releasing the button activates:
A faster sequence: LEDs light up one at a time for 10 ms, with a short buzzer tone (500 ms) for each LED.