MONK MAKES B07V4NDCQM Amplified Speaker 2 Instruction Manual
- June 16, 2024
- MONK MAKES
Table of Contents
MONK MAKES B07V4NDCQM Amplified Speaker 2
Specifications
- Product Name: MonkMakes Amplified Speaker 2
- Compatibility: Raspberry Pi 1 to 4, Raspberry Pi Pico and Pico W
Product Usage Instructions
Connecting to Raspberry Pi 1 to 4
- Connect your Raspberry Pi to the MonkMakes Amplified Speaker 2 using female-to-female jumper wires.
- Refer to a GPIO template like the Raspberry Leaf (available at https://monkmakes.com/leaf) to determine the pin connections.
Selecting Audio Output
By default, if you have an HDMI monitor attached to your Raspberry Pi, audio
will be routed through that and not the audio jack. To redirect it to the
audio jack:
- Go to the Raspberry Pi desktop.
- Select “Analog” from the top right corner.
Testing Audio
You can use VLC Player or a web signal generator like
https://www.szynalski.com/tonegenerator/
to play sound on the Raspberry Pi.
Connecting to Raspberry Pi Pico and Pico W
- Use female-to-female jumper wires to connect the Amplified Speaker 2 directly to a Pico.
- Alternatively, use a solderless breadboard and male-to-female jumper wires.
Note: The breadboard shown above is customized to show the Pico’s pins. For more information, visit https://www.monkmakes.com/pico_bb.html.
Playing Samples
To play a sound file, follow the instructions provided
here.
Please note that this process requires installing MicroPython libraries onto
the Pico by manually moving files.
FAQ
- Q: Can I use the Amplified Speaker 2 with a Raspberry Pi 5 or Zero model without an audio jack?
- A: In theory, it should be possible. However, finding a reproducible way of redirecting audio to GPIO pins seems to be problematic. If you manage to make it work, please let us know.
INTRODUCTION
The MonkMakes Amplified Speaker 2 is an easy-to-use, low-power amplified speaker on a PCB. The board needs a 3.3 to 6V power supply that can be provided by a Raspberry Pi, Raspberry Pi Pico, Arduino, or any other microcontroller capable of supplying power at 300mA between that voltage range. Audio input can use the 3.5mm stereo audio jack socket (great for a Raspberry Pi 1 to 4). Stereo audio is mixed to a mono signal as there is just a single speaker on the board. The board also has header pins that provide a line-in and low-pass filtered inputs, for use with PWM audio from microcontrollers. The board can be powered from 3.3V to 6V with a maximum current consumption of 300mA.
DOWNLOADING THE EXAMPLES
To download the ZIP archive containing example programs for all platforms,
visit https://github.com/monkmakes/amp_spkr_2
Click on the Code button, select Download ZIP, and then extract the downloaded ZIP archive. If you are familiar with git and would prefer to download the examples using the command line, then you can do so with the command:
$ git clone https://github.com/monkmakes/amp_spkr_2
With the extracted archive, you will find folders containing example programs for:
- Arduino – Arduino and other boards that can be programmed with the Arduino IDE
- pico – MicroPython examples for the Raspberry Pi Pico and Pico W
RASPBERRY PI 1-4
The MonkMakes Amplified Speaker 2 is a great way to add sound to your
Raspberry Pi 1 to 4, using the Raspberry Pi’s audio jack and female-to-female
jumper wires to connect the Raspberry Pi to the Amplified Speaker.
Connecting
Connect your Raspberry Pi to the MonkMakes Amplified Speaker 2 using female-
to-female jumper wires as shown below. It’s much easier to work out which pin
is which if you use a GPIO template like the Raspberry Leaf
(https://monkmakes.com/leaf).
The connections are:
- GND to GND
- 5V on the Raspberry Pi to 3-6V on the Amplified Speaker 2
Then use a 3.5mm audio lead to connect the two audio sockets.
Selecting Audio Output
By default, if you have an HDMI monitor attached to your Raspberry Pi, audio will be routed through that and not the audio jack. To redirect it to the audio jack, select Analog from the top right of the Raspberry Pi desktop.
Testing Audio
There are many ways of playing sound on the Raspberry Pi. You can use VLC
Player or a web signal generator like this: https://www.szynalski.com/tone-
generator/
Raspberry Pi 5 and GPIO Pins
In theory, you should be able to use the GPIO pins of a Raspberry Pi 5, or one
of the Zero models without an audio jack, but in practice, finding a
reproducible way of redirecting audio to GPIO pins seems fraught with
problems. If you get it to work, please let us know.
RASPBERRY PI PICO AND PICO W
The connections are as follows for a Pico or Pico W:
- GND to GND
- 5V on the Pico to 3-6V on the Amplified Speaker 2
- Pin 2 on the Pico to Line on the Amplified Speaker 2.
You can use female-to-female jumper wires to connect the Amplified Speaker 2 directly to a Pico or use a solderless breadboard and male-to-female jumper wires, as shown below.
Note that the breadboard shown above is customized to show Pico’s pins. For more information on this product see: https://www.monkmakes.com/pico_bb.html
Simple Tone Generation
You can play simple tones (rough-sounding square waves) using MicroPython’s PWM feature. The frequency determines the time and the duty cycle volume. You will find an example of this in the file simple_tone.py.
Playing Samples
The instructions for playing a sound file are adapted from here:
https://www.coderdojotc.org/micropython/sound/07-play-audio-file/
It’s a bit tricky to set up your Pico to do this, as it requires installing a few MicroPython libraries onto the Pico, that have to be installed by actually moving files, rather than using the Thonny. When you have done this, the Pico will contain the files shown in the bottom left of the Figure below.
The process for putting files onto Pico’s file system is:
- Download the file onto your computer
- Navigate to the file using the ‘This computer’ section of Thonny
- Right-click on the file and select ‘Upload to /’
Here’s a list of the files and the URL from which the file can be downloaded:
- chunk.py – https://raw.githubusercontent.com/joeky888/awesome-micropython-lib/master/Audio/chunk.py
- wave.py – https://raw.githubusercontent.com/joeky888/awesome-micropython-lib/master/Audio/wave.py
- myDMA.py – https://raw.githubusercontent.com/danjperron/PicoAudioPWM/main/myDMA.py
- myPWM.py – https://raw.githubusercontent.com/danjperron/PicoAudioPWM/main/myPWM.py
- wavePlayer.py – https://raw.githubusercontent.com/danjperron/PicoAudioPWM/main/wavePlayer.py
- school_bell.wav – From the pico folder of the examples download for this product.
Once the files are all copied onto the Pico, open the file play_file.py from the product examples download (see Page 4) and run it. You should hear the sound of a bell ringing. You can make your own WAV files using audio software such as Audacity. But you only have 2Mbytes of flash memory, which also has to contain all the libraries etc, so make them 8kHz and small!
**ARDUINO
**
In this section, we will use the popular Mozzi audio library for Raspberry Pi. Mozzi comes with a whole load of examples that you can load up and try out with your Amplified Speaker 2.
The connections are as follows:
- GND on the Arduino to GND on the Amplified Speaker 2
- 5V on the Arduino to 3-6V on the Amplified Speaker 2
- Pin 9 on the Arduino (or see Mozzi documentation) to PWM on the Amplified Speaker 2
Simple Tones
You can play simple tunes on the Arduino Uno using the tone command. You will
find an example of this in the download for this product (see Page 4) inside
the Arduino folder. The sketch is called simple_scale. Upload the sketch and
you should hear a rising scale repeating. The tone command will work on any
pin of the Uno.
Samples and Wave Synthesis
Follow the instructions here for installing the Mozzi Arduino library and its
examples. https://github.com/sensorium/Mozzi
Running Examples
In the Arduino IDE, select the File menu, and then in the Examples submenu,
find the Mozzi section at the bottom and pick an example to try.
Interesting examples to get started with are:
- FM Synth from 06 Synthesis
- PWM Phasing from 06 Synthesis
- Sample Table Arrays from 08 Samples
- Sample from 08 Samples
TROUBLESHOOTING
Problem : The orange power LED in the MonkMakes logo does not light.
Solution : Check the jumper wires are connected correctly. Jumper wires
can also fail, so try using different wires.
Problem : The orange power light fluctuates in brightness and the speaker
sounds very distorted.
Solution : This is likely due to whatever is supplying power to the board
is not capable of supplying sufficient current. The Speaker will draw a peak
current of 300mA.
Problem : There is a lot of hiss, or hum, even when no sound is playing.
Solution : Check that the jumper wires are not close to any sources of
electrical noise like AC power leads. Also keeping the jumper wires short may
help. If using jumper wires for the audio connection, try both input pins (PWM
and Line), one may be better than the other.
Problem : The sound is a bit ‘tinny’ and not very loud.
Solution : This is a small low-power speaker. You are never going to get
good sound quality out of it.
**SUPPORT
**
You can find the Product’s information page here: https://monkmakes.com/amp_spkr_2 including a datasheet for the product. If you need further support, please email support@monkmakes.com.
BOOKS
The designer of this product (Simon Monk) also writes books about
electronics. You may find some of these interesting.
MONKMAKES
As well as this product, MonkMakes makes all sorts of kits and gadgets to
help with your electronics projects. Find out more, as well as where to buy
here: https://www.monkmakes.com/products you can also follow MonkMakes on
Twitter @monkmakes.
References
- GitHub - monkmakes/amp_spkr_2: Example code for the MonkMakes Amplified Speaker 2
- GitHub - sensorium/Mozzi: sound synthesis library for Arduino
- micro:bit - electronic kits | MonkMakes
- micro:bit - electronic kits | MonkMakes
- raw.githubusercontent.com/danjperron/PicoAudioPWM/main/myPWM.py
- raw.githubusercontent.com/danjperron/PicoAudioPWM/main/wavePlayer.py
- Electronics Cookbook: Practical Electronic... by Monk, Simon
- Hacking Electronics: Learning Electronics with Arduino and Raspberry Pi, Second Edition: Monk, Simon: 9781260012200: Books
- Programming Arduino: Getting Started with... by Monk, Simon
- Raspberry Pi Cookbook: Software and Hardware... by Monk, Simon
- Playing Audio File - MicroPython for Kids
- micro:bit - electronic kits | MonkMakes
- micro:bit - electronic kits | MonkMakes