Double-clap light switch
Clap twice and the lights come on. Clap twice again to switch them off.
Shop by category
Shop all componentsAn active buzzer has its own oscillator inside: give its signal pin HIGH and it sounds a fixed tone, give it LOW and it stops. That makes it the easiest way to add sound to a project. The sketch beeps half a second on, half a second off; change the delay to 100 ms and you have an alarm.
Every part for this build comes in the Geekobot Spark Kit box, a Geekobot exclusive, together with the parts for all 24 projects, from a first blinking LED to a smart fan and a reaction game. The wiring below is the kit's own wiring.
Tick anything you already have and the total updates.
The brain of every Spark Kit project
Active buzzer module: beeps by itself when its pin is HIGH
Female-to-female or male-to-female leads for the modules
Sensor Shield v5.0 from the kit: every pin has its own G, V, S header, so modules plug in with female jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
spark_kit_07_buzzer_beep.inoVerify & upload in Electrolark// Spark Kit 07: buzzer beep
int buzzer = 11;
int beepMs = 500; // try 100 for a fast alarm
void setup() {
pinMode(buzzer, OUTPUT);
}
void loop() {
digitalWrite(buzzer, HIGH);
delay(beepMs);
digitalWrite(buzzer, LOW);
delay(beepMs);
}
Use the kit's USB cable (some phone cables carry power only), install the CH340 driver on Windows if the port does not appear, and pick Tools > Board > Arduino Uno.
You may have the passive buzzer: it only clicks with HIGH/LOW. Use the active one (sealed top, often with a sticker).
Some modules are active LOW. Swap HIGH and LOW in the sketch.
An active buzzer makes its own tone from DC. A passive buzzer needs a changing signal, which is how project 08 plays notes.
Not with the code. Put a piece of tape over the hole, or use a short beep.
Yes. It is one of the 24 projects in the Geekobot Spark Kit, and every part on the list comes in the kit box. You can also buy the parts one by one from the list above.
No. Every Spark Kit project is wired on the breadboard or the Sensor Shield with jumper wires.
5 parts: Uno R3 CH340G ATmega328p Compatible Development Board, Arduino USB-A to USB-B Data Cable for UNO/MEGA, PCB Mounted Active Buzzer Module, Dupont Jumper Wires (40 pcs) and Arduino Sensor Shield V5 Expansion Board. On this page you can tick the parts you already have and add only the rest to your cart.
It is a beginner project and takes about 15 minutes. The build on this page has 4 steps.
No. This page has the complete, tested code (spark_kit_07_buzzer_beep.ino).
About ₹423 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Driving an active buzzer; Sound generation from a digital pin; Changing a rhythm with timing.
Clap twice and the lights come on. Clap twice again to switch them off.
Plays a friendly ding-dong whenever someone walks into the shop or room.
Beeps and flashes any message in Morse, or key your own by hand.
Turn a membrane keypad into a two-octave piano.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.