Search on blog

Follow us on facebook

Top sellers

Information

The Onboard Speaker of the IoT Proto Shield Plus

Published : 04/01/2022 09:32:25
Categories : IoT Proto Shield Plus , Proto Shield Plus


The onboard SPEAKER of the IoT Proto Shield Plus

The SPEAKER can be used as a buzzer or to create frequency modulated tones.
It can also be used to play mp3 files in addition with the MP3 Mini Player, but in this article we will see how to use it as a buzzer or to create frequency modulated tones.


SPEAKER Section of the IoT Proto Shield Plus
SPEAKER section of the IoT Proto Shield Plus

Since the speaker is primarily used to play MP3 files in addition with the MP3 mini Player, to use it to play frequency modulated tones two jumper wires are required.


Schematic of the IoT Proto Shield Plus SPEAKER Section

Schematic of the SPEAKER section of the IoT Proto Shield Plus

To let the SPEAKER work as a tone buzzer you have to:

  • Remove the DFPlayer Mini MP3 module from the BRD3 socket (in case you are using it)
  • Use a jumper wire to connect BRD3 pin #1 (Vcc) to BRD3 pin #6 (SPK1)
  • Use a wire to connect J21 pin #2 to J23

Connections needed to work with the speaker used as a tone buzzer


Default connctions


According to the above schematics, U_TX will drive the buzzer tone. U_TX connects by default to the following pins:

Default connections


Sample Sketches


Download the sample sketches by clicking here.

Location: IoTPSP_Sample_Sketches/IoTPSP_SPEAKER

Use the IoTPSP_SPEAKER_NANO sketch to test the SPEAKER with ARDUINO NANO boards.

The IoTPSP_SPEAKER_NANO is based on the tone() function of the Arduino base library.
Information about the Arduino tone() function can be found at this link: https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/
The function does not work on NANO33 BLE (at least at the moment of writing this article).


Use the IoTPSP_SPEAKER_ESP32 sketch to test the SPEAKER with ESP32 boards.

The IoTPSP_SPEAKER_ESP32 uses the Tone32 library. The library is downloadable at https://github.com/lbernstone/Tone32
A copy of the library is also contained in the sketch folder.


Use the IoTPSP_SPEAKER_ESP8266 sketch to test the SPEAKER with ESP8266 boards.

The IoTPSP_SPEAKER_ESP8266 is based on the tone() function of the Arduino base library.
Information about the Arduino tone() function can be found at this link: https://www.arduino.cc/reference/en/language/functions/advanced-io/tone/


Share this content