Working with a microphone
So far, we have generated different sound outputs using the Micro:bit. The Micro:bit is also equipped with a microphone. This microphone can be used to detect sound from the environment. This section will teach us how to handle speech using a Micro:bit. The microphone is present on the front of the Micro:bit V2. Figure 12.5 shows its location:
Figure 12.5 – Location of the microphone on the Micro:bit V2 (courtesy: https://microbit-micropython.readthedocs.io/en/v2-docs/_images/microphone.png)
The microphone that’s built inside the Micro:bit has a sensitivity of -38dB ±3dB @ 94dB SPL. It has an SNR of 63dB. The microphone can detect frequencies from 100 Hz to 80 kHz. The complete datasheet for this microphone is available at https://www.knowles.com/docs/default-source/model-downloads/spu0410lr5h-qb-revh32421a731dff6ddbb37cff0000940c19.pdf?Status=Master&sfvrsn=cebd77b1_4.
In MicroPython, the microphone can respond...