Angled front view of the square mini speaker with mounting tabs and Dupont lead

4 Ohm 3W Square Mini Speaker with 150mm Dupont Lead | ShillehTek Product Manual

ArduinoESP32Raspberry PiPicomanual-product-10645386133791
$4.99 USD Only 3 left · Order by 3pm ET, ships today

Overview

This square mini speaker is a simple way to give a project a voice. It is a passive 4 Ω driver with a supplier-listed 3 W rating (the supplier calls it a “2831 type”), mounting tabs on the frame, and a 150 mm red-and-black lead that ends in a two-pin Dupont-style connector — small enough for handheld builds, loud enough for alarms, spoken prompts, MP3 playback, and game sound effects.

“Passive” is the important word: there is no amplifier inside. A 4 Ω load on a 5 V signal would try to draw more than an amp, while a microcontroller pin can supply only a few tens of milliamps — so the speaker always connects to the output of an audio amplifier, never to a GPIO pin. Good matches are small 5 V Class-D boards: an I2S amplifier such as the MAX98357 (up to 3.2 W into 4 Ω at 5 V), an analog-input module such as the PAM8406, or an MP3 player module with its own speaker output.

This manual covers how to connect the speaker to the common amplifier options for Arduino, ESP32, Raspberry Pi, and Pico, what the 4 Ω and 3 W numbers mean for volume and power-supply sizing, which wire is which, and short test programs to confirm everything works.

At a Glance

Impedance
4 Ω
Rated Power
3 W (supplier-listed)
Type
Passive — needs an amplifier
Lead
150 mm, 2-pin Dupont-style
Polarity
Red + / Black − (by convention)
Amplifier Match
5 V Class-D rated for 4 Ω

Specifications

Parameter Value
Speaker type Passive dynamic mini speaker, square frame with mounting tabs (supplier “2831 type”)
Nominal impedance 4 Ω (supplier nominal value)
Power rating 3 W, supplier-listed (continuous vs. peak not specified)
Voltage at rated power About 3.5 V RMS across the speaker (√(3 W × 4 Ω))
Current at rated power About 0.87 A RMS
Lead 150 mm, red and black wires
Connector Two-pin Dupont-style, 2.54 mm pitch
Polarity Not marked in the supplier data — red is + by convention
Amplifier Required (no amplifier inside the speaker)
Not specified Frequency response, sensitivity, frame dimensions
In the box 1 speaker with attached lead

Wiring Guide

Three rules cover every setup: the speaker goes across an amplifier’s two speaker terminals and nowhere else; neither speaker wire ever connects to ground, because small Class-D outputs are bridge-tied; and the amplifier needs a supply that can deliver about 1 A at full volume. If your amplifier has no matching header pins, bridge the Dupont connector with two jumper wires, or trim it off and strip the two leads for screw terminals.

Arduino + Analog-Input Amplifier (PAM8406-class)

An Uno or Nano has no DAC, so the tone() output passes through a small RC filter into the amplifier’s input. The amplifier — not the Arduino — drives the speaker.

Connection Goes To Details
Arduino D9 1 kΩ resistor → amplifier input (INL) Signal only — almost no current
Amplifier input (INL) 100 nF capacitor → GND RC low-pass that softens the square wave
Amplifier VCC / GND Arduino 5V / GND Shared ground; USB 5 V is fine for test beeps
Amplifier +L / −L Speaker red / black Across the output pair only
Warning: Never wire the speaker between an Arduino pin and ground. A 4 Ω load asks for far more current than a GPIO can supply and can damage the pin. The only things connected to the speaker are the amplifier’s two output terminals.
Tip: Using an MP3 module instead? Boards such as the MP3-TF-16P or DFPlayer Mini have a small speaker amplifier on board — connect red and black straight to SPK_1 and SPK_2, never to GND.

ESP32 + MAX98357 I2S Amplifier

I2S keeps the audio digital all the way to the amplifier, so there is no PWM filtering to get right. Any free GPIOs work; these match the code below.

Amplifier Pin ESP32 Pin Details
VIN 5V (VIN) 2.5–5.5 V supply; 5 V gives full power
GND GND Common ground
BCLK GPIO 26 Bit clock
LRC GPIO 25 Left/right (word) clock
DIN GPIO 22 Audio data
Speaker + / − Speaker red / black The amplifier’s speaker terminal or pads
Tip: Leave the SD and GAIN pins unconnected to start. On most MAX98357 breakouts that gives the standard gain with left and right mixed to mono — check your module’s documentation before changing them.

Raspberry Pi + MAX98357 I2S Amplifier

The Pi sends audio over its PCM/I2S pins on the 40-pin header. No sound card or 3.5 mm jack is needed.

Amplifier Pin Pi Pin Details
VIN Pin 2 (5V) Amplifier supply
GND Pin 6 (GND) Common ground
BCLK Pin 12 (GPIO 18) PCM clock
LRC Pin 35 (GPIO 19) PCM frame sync
DIN Pin 40 (GPIO 21) PCM data out
Speaker + / − Speaker red / black Across the output pair only
Note: The amplifier also needs a software step. In the Pi’s config.txt, put a # in front of the dtparam=audio=on line and add a new line reading dtoverlay=max98357a, then reboot. The exact commands are in the Code Examples section below.

Raspberry Pi Pico + MAX98357 I2S Amplifier

MicroPython’s I2S driver on the Pico needs the word-clock pin to be the GPIO directly after the bit-clock pin, which is why GP16 and GP17 are used together.

Amplifier Pin Pico Pin Details
VIN VBUS (pin 40) 5 V from USB
GND GND (pin 38) Common ground
BCLK GP16 (pin 21) Bit clock
LRC GP17 (pin 22) Must be the pin right after BCLK
DIN GP18 (pin 24) Audio data
Speaker + / − Speaker red / black Across the output pair only
Warning: Don’t power the amplifier from 3V3(OUT). The Pico’s 3.3 V pin is meant for loads under about 300 mA, and a 4 Ω speaker at volume needs more than that. Use VBUS (USB 5 V) or a separate 5 V supply with the grounds joined.

Code Examples

Each example plays a short test sound so you can confirm the wiring before building anything bigger. Start at low volume.

Arduino (tone test through an amplifier)

speaker_tone_test.ino
// Speaker tone test - Arduino Uno / Nano
// D9 -> 1k resistor -> amplifier INPUT (never straight to the speaker)
// Amplifier output + / - -> speaker red / black

const int AUDIO_PIN = 9;
const int NOTES[] = {262, 294, 330, 349, 392, 440, 494, 523};  // C4 to C5

void setup() {
  Serial.begin(9600);
  Serial.println("Playing test scale...");
}

void loop() {
  for (int i = 0; i < 8; i++) {
    tone(AUDIO_PIN, NOTES[i], 250);   // 250 ms per note
    delay(300);
  }
  noTone(AUDIO_PIN);
  delay(2000);                        // pause, then repeat
}

ESP32 and Pico (MicroPython, I2S test tone)

i2s_tone.py
# I2S test tone - MicroPython with a MAX98357 amplifier
# ESP32 pins: BCLK = 26, LRC = 25, DIN = 22
# Pico pins:  BCLK = 16, LRC = 17, DIN = 18  (LRC must be BCLK + 1)
from machine import I2S, Pin
import math
import struct

BCLK, LRC, DIN = 26, 25, 22   # change to 16, 17, 18 on a Pico

RATE = 22050      # samples per second
FREQ = 441        # Hz - exactly 50 samples per cycle at 22050
VOLUME = 0.25     # 0.0 to 1.0, start low

audio = I2S(0, sck=Pin(BCLK), ws=Pin(LRC), sd=Pin(DIN),
            mode=I2S.TX, bits=16, format=I2S.MONO,
            rate=RATE, ibuf=4000)

# Build one cycle of a sine wave as 16-bit samples
n = RATE // FREQ
cycle = bytearray(n * 2)
for i in range(n):
    sample = int(32767 * VOLUME * math.sin(2 * math.pi * i / n))
    struct.pack_into("<h", cycle, i * 2, sample)

try:
    for _ in range(FREQ * 2):     # about 2 seconds of tone
        audio.write(cycle)
finally:
    audio.deinit()

Raspberry Pi (enable the MAX98357 and test)

setup_i2s_amp.sh
# Raspberry Pi OS Bookworm and later: /boot/firmware/config.txt
# Older releases: /boot/config.txt
sudo nano /boot/firmware/config.txt
#   1) Put a # in front of this line:   dtparam=audio=on
#   2) Add this line:                   dtoverlay=max98357a
sudo reboot

# After the reboot:
aplay -l                        # the MAX98357 card should be listed
speaker-test -c2 -t wav -l 1    # plays a spoken channel test once

Frequently Asked Questions

Can I connect this speaker directly to an Arduino, ESP32, or Pico pin?
No. At 4 Ω it would ask a 5 V pin for more than an amp — far beyond what any GPIO can deliver — and the pin or the whole chip can be damaged. Always put an audio amplifier between the microcontroller and the speaker.
Which amplifier should I pair it with?
Any small amplifier rated for 4 Ω loads. A MAX98357 I2S module delivers up to 3.2 W into 4 Ω from 5 V and suits ESP32, Pico, and Raspberry Pi. A PAM8406-class analog board suits tone() output or line-level audio. MP3 modules such as the DFPlayer Mini can drive speakers under 3 W straight from their SPK pins. Avoid large amplifier boards rated for tens of watts unless you keep the volume very low.
Which wire is positive?
By convention red is + and black is −, although the supplier data does not mark polarity. A single speaker plays the same either way round. Polarity only matters when two or more speakers play together — wire them all the same way so the cones move in step.
Why must I never connect a speaker wire to ground?
Small Class-D amplifiers use bridge-tied outputs: both speaker terminals are actively driven and neither one is ground. Grounding either terminal shorts half of the output stage and can destroy the amplifier. The speaker should touch only the amplifier’s + and − terminals.
The sound distorts or my board resets at high volume. What is wrong?
Either the speaker is being pushed past its 3 W rating or the 5 V supply is sagging. Turn the volume down first. Then power the amplifier from a supply that can deliver about 1 A and add a 100–470 µF capacitor across its power pins. Weak USB ports and long, thin jumper wires are common culprits.
It sounds thin and quiet on the bench. Is it faulty?
Probably not. With a bare driver, sound from the back of the cone cancels much of the sound from the front, which removes most of the bass. Mount it behind a panel with an opening for the cone, or in a small closed box, and it becomes noticeably louder and fuller.
Can I connect two of these speakers to one amplifier channel?
Use one speaker per channel. Two 4 Ω speakers in parallel present 2 Ω, which many small amplifiers are not rated to drive. Two in series present 8 Ω, which is safe but quieter. For stereo, give each speaker its own channel.

Related Tutorials

Datasheets & downloads

Reference documents for the 4 Ohm 3W Square Mini Speaker with 150mm Dupont Lead. This manual covers wiring and code; the documents below carry the full electrical specifications.