0% found this document useful (0 votes)
205 views

How To Make A Siren Using Arduino

This document describes how to make a siren using an Arduino board. The siren plays different tones when a button is pressed and uses LEDs to create flashing light patterns for each tone. The circuit connects 10 LEDs, a piezo buzzer, button, and resistors to the Arduino. The Arduino code uses functions to play tones on the buzzer and control the LED patterns. It debounces the button input and switches between the functions. Delays are used to sync the tones and flashing lights.

Uploaded by

Maskulun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
205 views

How To Make A Siren Using Arduino

This document describes how to make a siren using an Arduino board. The siren plays different tones when a button is pressed and uses LEDs to create flashing light patterns for each tone. The circuit connects 10 LEDs, a piezo buzzer, button, and resistors to the Arduino. The Arduino code uses functions to play tones on the buzzer and control the LED patterns. It debounces the button input and switches between the functions. Delays are used to sync the tones and flashing lights.

Uploaded by

Maskulun
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

instructables

How to Make a Siren Using Arduino

by Jigneshk5

My project is a button controlled Siren with different LED transitions. You can change the Siren sound( eg. police
or ambulance siren etc.) for each press. I have added 2 different led patterns for each siren using 10 LEDs. I have
added a total of 4 Siren tones. You can checkout the Arduino code and the Explanation here:
https://youtu.be/Q22AfdbFTq8

How to Make a Siren Using Arduino: Page 1


Step 1: Hardware Required

Arduino board, I am using an Arduino Uno

Solderless breadboard

5 Red and 5 Blue LED

Jumper wire

Piezo buzzer/Speaker and 100ohm resistor

Push button and 10K resistor

DC Power supply (9 V Battery)

How to Make a Siren Using Arduino: Page 2


Step 2: Circuit & Connections

STEP A: ( Connecting LED) Now, its time to connect our buzzer and the
pushButton with the Breadboard. Connect the Piezo
As we basically building a siren so, red and blue flash buzzer with a 100ohm resistor to the negative rail and
looks cool. So take 5 red and 5 Blue LEDs. Now, positive end of buzzer connected to pin 13.
connect the negative terminal of these led's with a
220ohm resistor (current limiting) to the negative rail STEP C: (Connecting pushButton)
of the breadboard as shown in the circuit diagram.
Positive ends of red leds are connected to pin 3 to pin Connect one out of four pins of pushButton with pin 2
7 while the positive ends of Blue leds are connected of and connect down it to GND rail using a pull down
to pin 8 to pin12 of Arduino's digital pin. resistor of 10k ohm. Connect 5V with another button
pin as shown in the circuit diagram.
STEP B: (Connecting Piezo Buzzer)

How to Make a Siren Using Arduino: Page 3


Step 3: Programming

1. Since we are using button press to switch between the tones so we have to remove the problem of button
debouncing, which I removed by software implemention using a boolean Debounce function.

2. The conditional if else is used after it for Switching between different functions.Here one() and oneA() are for 1st
tone with two different led transition, similar for other functions too. And the tones for each function is synced with
led transition using delay() appropriately.

HOW SYNC WORKS

tone() uses one of the builtin timer on the arduino and that timer operates independently of the delay(). Or In other
words we can say that if you want to play distict beats, you should check the difference between the delay time
and duration of tone() as both the function are working parallel. Now what I did is that divide the delay in smaller
parts to use it with different sets of Leds. If you want a video tutorial on this. Check this out:

//www.youtube.com/embed/1_LMAgO14z0

Let us take three() as an example to understand it.

void three() { //This function produces the 3rd siren (AMBULANCE sound).<br>tone(buzz,440,200);
<p>delay(300);<br>for(int i=3;i<=6;i++)
digitalWrite(i,HIGH);
noTone(buzz);
tone(buzz,494,500);
delay(300);
for(int i=3;i<=6;i++)
{ digitalWrite(i,LOW);
digitalWrite(i+6,HIGH); }
noTone(buzz);
tone(buzz,523,300);
delay(200);
digitalWrite(7,HIGH);
delay(50);
digitalWrite(8,HIGH);
delay(50);
noTone(buzz);
}</p>

After the last tone()...I divided the delay of 300ms into 200,50 and 50 so that the led at pin 7 and 8 have a blinking
effect at the end of 523hz tone while the tone is continuous in the background for 300ms ( Since there is no
difference between delay and tone duration as explained above).

Here is the complete code of my project.Now it's your turn to make some cool tone using my Project and explore
all the possibilities.

https://github.com/jigneshk5/Siren-Code-Arduino

How to Make a Siren Using Arduino: Page 4


Step 4: Video Tutorial

If It Helps, Please Subscribe

//www.youtube.com/embed/Q22AfdbFTq8

Great Arduino tutorial. Projects like this are great for teaching the basics on output pin controls.

Thaks Bro..

How to Make a Siren Using Arduino: Page 5

You might also like