Wiring — Raspberry Pi Zero W
The Zero W build is a Pi Zero W, the InnoMaker amplifier HAT, two speakers and the ESP32 that drives the light strip. The Wi-Fi bedside button needs no wiring to the Pi.
The 40-pin header at a glance
Section titled “The 40-pin header at a glance”The HAT sits on the Zero’s header (same 40 pins and numbering as the Pi 3). Pin numbers are physical pin numbers. Odd pins on the left (inner row), even pins on the right (outer row, nearest the board edge); pin 1 is the square pad.
Finding the pins when the HAT hides the names
Section titled “Finding the pins when the HAT hides the names”With the amplifier fitted, the names printed on the Pi are covered. Find a pin by position, not by name:
- Turn the board so the SD card slot is on your left and the 40-pin header runs along the top edge.
- The header has two rows of 20 pins. The top row (nearest the board edge)
is the even pins
2, 4, 6 … 40; the bottom row is the odd pins1, 3, 5 … 39. - Count from the left end: pin 1 is the first of the bottom row, pin 2 the
first of the top row. Pin
nis the ⌈n ÷ 2⌉-th pin of its row.
| Pin | Row | Count from the left | Function here |
|---|---|---|---|
| 2 | top | 1st | 5 V → ESP32 VIN |
| 6 | top | 3rd | GND → ESP32 |
| 8 | top | 4th | TXD → ESP32 D18 |
| 10 | top | 5th | RXD ← ESP32 TX2 |
Check you are on the right pin with a continuity tester, everything
unpowered: pin 6 must beep with pins 9, 14, 20, 25, 30, 34 and 39 (all ground), and
pin 2 must beep with pin 4 (both 5 V) and with nothing else. If not, you are one
position off, or on the wrong row: pin 1 right next to pin 2 is 3.3 V, and
wiring that to VIN would starve the ESP32.
The other highlighted pins belong to the HAT (I²C, I²S): no wire of yours goes there.
1. Audio — InnoMaker HiFi AMP Pro Mini (MA12070P)
Section titled “1. Audio — InnoMaker HiFi AMP Pro Mini (MA12070P)”You need: Pi Zero W, the InnoMaker HAT, a regulated 19–20 V DC supply, 4 A or more, with a 5.5 mm jack (see Power tolerances below), two passive 4–8 Ω speakers.
- Fit the HAT on the Zero’s header, all 40 pins seated (solder the header on the Zero first if it has none).
- Connect both speakers, respecting polarity. Do not join the two “−” wires.
- Leave the Zero’s
PWRmicro-USB empty. - Connect the supply last, then switch it on. The HAT is expected to feed the Zero with its 5 V (as the bench notes found); if the Zero stays dark, switch off and check that the header is fully seated before trying anything else.
Power tolerances
Section titled “Power tolerances”| What | Value | Source |
|---|---|---|
| Amplifier chip (MA12070P) supply, recommended | 4 – 26 V | Infineon datasheet, table 6-1 |
| Amplifier chip, absolute maximum | 27.5 V (damage above) | datasheet, table 5-1 |
| HAT DC input (5.5 mm jack or green terminal) | 9 – 24 V | InnoMaker AMP Pro page (the Mini has the same power inputs) |
| Jack and green terminal together | forbidden — one source only | InnoMaker |
| Speaker load | 4 – 8 Ω per channel; never below 3.2 Ω | datasheet table 6-1 (bridged output) |
| Supply power to provide | 1.1 – 1.3 × the combined speaker power | InnoMaker |
| Ratings | 2 × 30 W continuous (8 Ω, 22 V) · 2 × 80 W peak (4 Ω, 26 V) | InnoMaker / Infineon |
| Hot-plugging the supply | not allowed (inrush, sparks) | InnoMaker |
What it means for this build:
- Use a regulated 19 or 20 V adapter (a laptop-style brick). That sits inside the HAT’s 9–24 V window and the chip’s 26 V limit with margin: even +5 % is 21 V.
- Do not use a “24 V” adapter. InnoMaker warns that some surge to 30 V or more at switch-on, above the chip’s 27.5 V absolute maximum. Avoid unregulated supplies for the same reason.
- Current: for the full 2 × 30 W, 1.3 × 60 W ≈ 78 W, so 20 V and about 4 A. InnoMaker’s example is 20 V / 5–6 A. A 3 A supply is enough only if the volume stays moderate; the project’s rule is 25 % margin over the measured peak, so measure it first (3 A is fine if the peak is under 2.4 A).
- Never put two speakers in parallel on one channel unless the result stays at or above 4 Ω: two 8 Ω speakers in parallel make 4 Ω, two 4 Ω make 2 Ω, which is below the chip’s limit.
- Only one 5 V source for the Zero. The HAT powers it through the header
(InnoMaker: “the HAT will provide power to the Raspberry Pi”) and warns
that extra 5 V into the Pi may damage it. So: nothing in the
PWRmicro-USB, and a computer cable on the data port must be data-only. - Order: plug the supply into the HAT first, and only then switch the adapter on. Never hot-plug the DC jack.
- Unknown: the current the HAT’s 5 V rail can deliver to the Pi is not documented. A Zero W needs roughly 0.1 – 0.35 A; if it reboots while the amp plays loud, measure the 5 V at header pin 2 under load.
- Speaker terminals (Mini): InnoMaker states the right speaker is on
PIN-3(+) andPIN-4(−) of the speaker connector; the left speaker is then presumably onPIN-1andPIN-2(not stated). Read the silkscreen: the Mini is wired differently from the full-size AMP Pro.
Sources: Infineon MA12070 datasheet (V1.0, 2018-07-17) and InnoMaker AMP-Pro.
2. Light — ESP32 and LED strip
Section titled “2. Light — ESP32 and LED strip”The ESP32 and the strip are wired exactly as on the Pi 3 (see Wiring — current setup). Two things differ on the Zero: the UART pins are shared with the amplifier HAT, and the Zero has no free USB port, so the ESP32 takes its 5 V from the header.
- Pass the continuity check above.
- Join all grounds: Pi pin 6, ESP32 GND, strip GND, 5 V supply GND.
- Wire the UART: Pi pin 8 → ESP32
D18, Pi pin 10 ← ESP32TX2. - 330 Ω in series on the data line, close to the strip’s
DIN; the strip’s+5V/GNDcome from the 5 V supply, not from the ESP32 or the Pi. - Power the ESP32 from the HAT’s 5 V: header pin 2 (or 4) → ESP32
VIN.pi_lightruns without Wi-Fi, so it draws about 50–80 mA; the strip has its own supply. The HAT’s 5 V budget is not documented, so measure pin 2 under load if the Zero resets. - Flash the ESP32 from your computer over its USB-C cable; on the Pi 3 it is
flashed through the Pi, which is not set up on the Zero. Unplug the
VINwire first, and never leave USB-C andVINpowered at the same time: many DevKits have no diode between them and the 5 V can back-feed. - From the web interface, start a sunrise or the reading light.
3. Bedside button
Section titled “3. Bedside button”The Wi-Fi button calls the clock over Wi-Fi: no wire goes to the Zero, so it does not conflict with the HAT. See Wiring — Wi-Fi bedside button. The LoRa button receiver (SPI on pins 19/21/23/24) is not available on the Zero with this HAT: chip select GPIO8 is claimed by the amplifier overlay.
4. First access, before Wi-Fi
Section titled “4. First access, before Wi-Fi”The Zero W has no Ethernet. The firmware turns its micro-USB data port (the
one nearer the middle of the board, labelled USB) into an Ethernet gadget
(usb0).
Two 5 V sources (the computer’s USB and the HAT) feeding the Zero at once is the
risk to avoid. Once Wi-Fi is configured (ROBINE_WIFI_SSID /
ROBINE_WIFI_PASSPHRASE in .env at build time) the cable is no longer needed.
First power-up checks (audio)
Section titled “First power-up checks (audio)”- Unpowered, with a continuity tester: pin 16 goes to the amplifier chip’s error output and pin 11 to its booster control (pins 8 and 10: see the continuity check in section 2). If not, the overlay does not match your board.
- Power the HAT alone (not on the Zero) and measure the header: pin 1 should be 3.3 V or nothing, SDA and SCL (pins 3 and 5) 0 V or 3.3 V — never 5 V.
- Fit it on the Zero, power up at low volume, and play a manual test sound from the web interface.
- The firmware’s volume curve was tuned on the HiFiBerry; the MA12070P master volume starts from −144 dB. Raise the level in small steps.
If the card does not appear (no sound, snd_rpi_merus_amp absent), the HAT
does not answer on I²C address 0x20, or the overlay does not fit it.
Reference table
Section titled “Reference table”| Function | Pin | GPIO | Note |
|---|---|---|---|
| I²C data / clock | 3 / 5 | 2 / 3 | amplifier control, address 0x20 |
| I²S clock | 12 | 18 | bit clock |
| I²S frame | 35 | 19 | left/right clock |
| I²S data out | 40 | 21 | audio to the amplifier |
| ESP32 UART TXD / RXD | 8 / 10 | 14 / 15 | ttyS0; not the amplifier enable/mute (overlay merus-amp-uart) |
| Booster | 11 | 17 | overlay booster_gp |
| Amplifier error | 16 | 23 | overlay error_gp |
| 5 V out of the HAT | 2, 4 | — | powers the Zero |
The audio chain is limited to 48 kHz by the Linux driver: music and alarms play normally at 44.1 or 48 kHz.