Connecting a speaker
Speakers are electromagnetic components used for generating sounds. The internal circuit diagram of a speaker is shown in Figure 12.1. A speaker uses a thin magnetic membrane that can be excited by the electromagnetic field generated by the electric signals created by sound. As shown in the following figure, the North and South poles of the magnet will attract different parts of the membrane and generate different sounds. The faster or slower this membrane vibrates, the higher or lower the frequency of the output sound will be:
Figure 12.1 – Internal circuit diagram of a speaker (courtesy: https://upload.wikimedia.org/wikipedia/commons/4/45/Simplified_loudspeaker_diagram_with_forces.svg)
The Micro:bit V2 has an inbuilt speaker, which is located on the backside of the board. Figure 12.2 shows the location of the inbuilt speaker on the Micro:bit:
Figure 12.2 – Location of the in-built speaker on the Micro...