Raspberry Pi Learning Resources

Buzzers

There are two main types of buzzer: active and passive.

A passive buzzer emits a tone when a voltage is applied across it. It also requires a specific signal to generate a variety of tones. The active buzzers are a lot simpler to use, so these are covered here.

Connecting a buzzer

An active buzzer can be connected just like an LED, but as they are a little more robust, you won't be needing a resistor to protect them.

Set up the circuit as shown below:

buzzer

Coding a buzzer

Now you can sound the buzzer by using the code below:

buzzer on

Or even make the buzzer beep:

buzzer bleep

What Next?

  • Have a go at making a set of traffic lights, with a pedestrian crossing signal.

Back to Physical computing with Scratch