Police Siren
Alternating red + blue LEDs with a wailing 600–1500 Hz buzzer
What you will learn
- How tone() generates a square wave at a given frequency
- How to use millis() to keep time without blocking the loop
- How to alternate between two states (high tone / low tone) smoothly
- How PWM + millis() lets one Arduino drive 3 outputs in different patterns at the same time
What you will need
| Component |
|---|
| 1× Arduino Uno R3 |
| 1× red LED |
| 1× blue LED |
| 2× 220Ω resistor |
| 1× buzzer (piezo) |
| 1× breadboard |
| 7× jumper wires |
Step by step
-
Step 1
Place the Arduino Uno on the breadboard. (Self-powered like USB is plugged in — no battery needed.)
-
Step 2
Red LED: Arduino D9 → 220Ω resistor → red LED anode (long leg). LED cathode (short leg) → Arduino GND.
-
Step 3
Blue LED: Arduino D10 → 220Ω resistor → blue LED anode (long leg). LED cathode (short leg) → Arduino GND.
-
Step 4
Buzzer: Arduino D8 → buzzer + terminal. Buzzer − terminal → Arduino GND.
-
Step 5
Click ▶ Run — the red and blue LEDs flash alternately and the buzzer wails up and down, just like a real police siren.
Take it further
- Change the tone frequencies in the code to make it sound like a fire engine or an ambulance.
- Add a third LED in white and flash all three in sequence.
- Use a potentiometer to control the siren's volume (via PWM on the buzzer pin).
Practise it before you build it
Wire this circuit in the ThinkEdge Learn simulator first. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so the LED on screen actually lights when the current is right — no hardware, no burnt components, and a class can try it in a browser.
Related projects
Guides that use this project
One guide on the site build this project as part of a longer explanation. The guide says why the circuit works; this page says how to wire it.
Where this project sits
It is also part of these lists, which is how a class usually finds it.
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.