This is a basic Arduino beginner project where a buzzer sounds only when the button is pressed.
No button logic is written in the code — the button is connected in series with the buzzer, so control is handled by hardware.
- 🧠 Concept: Hardware-based control (Series connection)
- 🔊 Output Device: Buzzer
- 🔘 Input Device: Push Button
- 💻 Platform: Arduino (Uno / Nano / Mega)
| Component | Quantity |
|---|---|
| Arduino Board | 1 |
| Buzzer | 1 |
| Push Button | 1 |
| Jumper Wires | As required |
GND → Buzzer (-) → Buzzer (+) → Button → Arduino Pin 2
- Buzzer negative terminal → GND
- Buzzer positive terminal → Button
- Button other terminal → Arduino Digital Pin 2
#define buzzer 2
void setup() {
pinMode(buzzer, OUTPUT);
}
void loop() {
digitalWrite(buzzer, HIGH);
}-
Arduino pin D2 is always set to HIGH
-
Button is connected in series with the buzzer
-
🔘 Button pressed → circuit completes → 🔊 buzzer ON
-
🔘 Button released → circuit breaks → 🔇 buzzer OFF
-
❌ No digitalRead() or software button logic used
| Button State | Buzzer Status |
|---|---|
| Pressed | 🔊 ON |
| Released | 🔇 OFF |
-
Understanding series circuit connection
-
Difference between hardware control vs software control
-
Basic use of Arduino digital OUTPUT
-
Real-world switch operation
Bishnupriya
/image.png)