Skip to content

Commit

Permalink
docs: Embellish explanation of piezo buzzer types.
Browse files Browse the repository at this point in the history
Expand the introduction to piezo buzzers to explain that there are two
types with slightly different uses.  It is important that the student/user
be using an active buzzer for the example code to work.

Also add text stating that a passive piezo buzzer could be used as an
alternative to a speaker and updated the warning to say that active piezo
buzzers shouldn't be used.
  • Loading branch information
ScottDWebster authored and dpgeorge committed Sep 6, 2021
1 parent ab95281 commit e8df727
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
15 changes: 10 additions & 5 deletions docs/tutorials/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ when you plug in circuits and other devices via the pins.
Bleeps and Bloops
+++++++++++++++++

The simplest thing we can attach to the device is a Piezo buzzer. We're going
to use it for output.
The simplest thing we can attach to the device is a Piezo buzzer. There are two
types of piezo buzzers. The simplest type to use are called active buzzers.
Active buzzers contain an oscillator that produces a tone at a predetermined
pitch when a current is passed through them. Passive buzzers require an
oscillating current to be passed through them to produce a tone at the frequency
of the oscillation. In short, active buzzers are simple to use but produce only
one tone, while passive buzzers are slightly more complicated to use but can
produce a variety of tones.

.. image:: piezo_buzzer.jpg

These small devices play a high-pitched bleep when connected to a circuit. To
attach one to your BBC micro:bit you should attach crocodile clips to pin 0 and
GND (as shown below).
We're going to use an active piezo buzzer for output. To attach one to your BBC
micro:bit you should attach crocodile clips to pin 0 and GND (as shown below).

.. image:: pin0-gnd.png

Expand Down
9 changes: 5 additions & 4 deletions docs/tutorials/music.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ Music

MicroPython on the BBC micro:bit comes with a powerful music and sound module.
It's very easy to generate bleeps and bloops from the device *if you attach a
speaker*. Use crocodile clips to attach pin 0 and GND to the positive and
negative inputs on the speaker - it doesn't matter which way round they are
connected to the speaker.
speaker or passive piezo buzzer*. Use crocodile clips to attach pin 0 and GND
to the positive and negative inputs on the speaker/buzzer - it doesn't matter
which way round they are connected to a speaker, but a piezo buzzer may be
polarized (check for a "+" marking the positive terminal).

.. image:: pin0-gnd.png

.. note::

Do not attempt this with a Piezo buzzer - such buzzers are only able to
Do not attempt this with an active Piezo buzzer - such buzzers are only able to
play a single tone.

Let's play some music::
Expand Down

0 comments on commit e8df727

Please sign in to comment.