Toddler Tunes - A Digital Music Box · Part 1 of 5

One song at bedtime: from a chat to an ordered board

A claude.ai chat turned a one-song music box for a toddler into an architecture, a parts list and a rough schematic. The owner then revised the circuit, laid out the board by hand and ordered it from JLCPCB.

  • Published
  • Worked Oct 14 – 20, 2026
  • Claude Opus 5.5
  • kicadrp2350jlcpcbpower-latcharchitecture

A song that has to play every time

Toddler Tunes is a battery-powered music box for a toddler: one large button, a volume knob, and songs loaded from a computer over USB. The first version is built and in use. This post covers its first week, from a claude.ai chat on October 14 to the board order on October 20.

Me

Every night before bed I dance with my daughter to “Beauty and the Beast”, Angela Lansbury’s recording from the film. We usually play it on Alexa, which sometimes fails because of network or AWS service problems. I want a digital music box that plays only that song. It needs modest but good-quality sound, power and programming over USB-C, and it should also run on AA batteries.

Claude

Keep the song in the microcontroller’s own flash, so nothing depends on a network: an RP2040 with 16 MB of flash. A MAX98357A class-D amplifier takes I2S directly and drives one 2–2.5″ full-range driver. Use three AA cells, not four. Four fresh alkalines exceed the amplifier’s 5.5 V maximum, while three span about 4.5 V down to 3.0 V. A soft power latch keeps standby draw near zero. The toddler rules start here too: a screw-secured battery door, no small parts or button cells, and a firmware cap on the maximum volume.

Five architectures in an afternoon

Twenty-four minutes after that first answer, the owner added the first of four constraints, one message at a time.

Me

Can I use a 3D-printed enclosure? I want to be able to order everything, or nearly everything, assembled from JLCPCB.

Claude

Yes. For a toy that is also a speaker box, MJF PA12 nylon is the pick. It survives being dropped and thrown, where SLA resin can crack into sharp pieces, and it is dense enough for a sealed box, where FDM parts are porous. Dye it rather than paint it, since a toddler will chew it. For the button, put a 12 mm tactile switch on the board under an oversized printed cap whose flange is captured inside the shell. The battery door takes a captive screw.

Me

Let’s work out the rough design a bit more first. A XIAO dev board is fine: I can hand-solder it and leave JLC to assemble the rest. I’ll also do all of the through-hole soldering, since JLC charges extra to assemble through-hole parts.

Claude

That changes the microcontroller. The song lives in the XIAO’s flash, and the XIAO RP2040 and RP2350 have only 2 MB, about 1 MB of filesystem after firmware. A 2:45 track would fit only at about 48 kbps mono. The XIAO ESP32-S3 has 8 MB. The XIAO also makes its USB-C the product’s port, and its 5 V pin is tied to VBUS. So the cells feed a boost to 5 V, an LM66100 ideal diode feeds that pin, and the latch sits ahead of the boost. A toddler’s tap is shorter than boot, so an RC on the latch holds power for about 2 s until firmware takes over.

Why does the XIAO's 5 V pin shape the power path?

On the XIAO, the 5 V pin and the USB-C connector’s VBUS are the same node. Whatever feeds that pin from the board also appears on the USB connector, and whatever a USB host supplies arrives on the board.

The ideal diode between the boost and that pin does three jobs. With USB plugged in, VBUS sits higher, the diode blocks and the boost idles. On batteries, the boost feeds both the amplifier and the XIAO. And it keeps the boost from pushing current back into a host computer.

The boost itself gives the amplifier a constant 5 V, so loudness doesn’t sag as the cells run down, and the XIAO’s regulator gets a clean input instead of browning out near the end of the cells’ life. The chat first put the latch ahead of the boost, because many synchronous boost converters leak input voltage to the output when disabled. That changed once a specific part was chosen, as the next chapter shows.

Me

Use the RP2350 version, and include an SD card slot in the design to hold the song.

Claude

That works, and the pin budget comes out exact. Using only the front castellations, so there are no bottom pads to hand-solder, the eleven GPIOs cover SPI to the card, I2S to the amplifier, HOLD, the button and two ADC inputs for the volume pot and the battery. CircuitPython’s I2S on the RP2 needs LRCLK on the GPIO after BCLK, so they go on D4 and D5. HOLD does two jobs: it keeps the latch on, and it drives the amplifier’s SD_MODE through a resistor. The button is sensed with an internal pull-up, which avoids the RP2350’s E9 pull-down erratum.

Me

This is only ever going to play one song, so the SD card doesn’t need to be removable. Would it be better to pick an SPI EEPROM or flash chip instead?

Claude

Yes: SPI NOR flash, a W25Q128JV with 16 MB. There’s no choke-sized card, no socket to eject it in a drop, and JLC solders it on. An EEPROM won’t do, because the largest SPI EEPROMs hold about 512 KB, a few seconds of audio. NAND parts would bring bad-block management for no benefit. The cost is loading the song. CircuitPython won’t present an external SPI flash as the USB drive on the RP2 port, so the firmware has to expose the chip as a mass-storage drive itself.

The first constraint arrived at 12:18 and the flash question at 12:53. Each revised architecture came back, with its reasoning and part numbers, one to two minutes after the owner’s message. In 36 minutes the design went through five versions: the original RP2040 board, the same with a 3D-printed enclosure, the XIAO ESP32-S3, the XIAO RP2350 with an SD card, and the XIAO RP2350 with a soldered flash chip.

A parts list, and a schematic that caught its own flaw

Me

Give me a BOM first.

Claude

The BOM went out as a spreadsheet: 26 line items for JLC’s assembly line, five parts for you to hand-solder (the XIAO, battery holder, button, pot and speaker connector), and LCSC numbers I looked up that day, with a Calcs tab for the design math. Building it pinned down the speaker, a Dayton DMA58-8: 2″, 8 Ω. In a 0.3 L sealed box it gives Qtc ≈ 0.66 and Fc ≈ 203 Hz, so the firmware high-pass moves to about 180 Hz, not the 120–150 Hz I had suggested. It also pinned down the latch capacitor. It goes gate-to-source on the FET, because wired gate-to-ground, inserting batteries would start the song.

Two days later, on October 16, the owner came back to the same chat.

Me

Can you sketch me a rough schematic?

Claude

I drew it as a page to keep open beside KiCad while entering the circuit: a power-and-latch sheet, an MCU, audio and flash sheet, a latch timing diagram, the full net list and a checklist. I built the circuit as SVG from a generator script, rendered each sheet, read the renders back, adjusted the generator and rendered again before publishing.

The rough schematic page: a "What changed from the BOM" summary, the power-and-latch sheet, the MCU, audio and song-storage sheet, a latch timing diagram, the net list and a checklist for before layout

Claude

Working through the latch for the drawing, I found a real flaw in the version in my own BOM. Q2 switched the battery and turned off slowly through its linear region. As the rail sagged, the XIAO could brown out, its load would drop, the rail could recover, and the fresh boot would raise HOLD and play the song again. The fix leaves the cells on the boost permanently: the TPS61023 draws about 0.1 µA in shutdown and fully disconnects its output. The latch now drives the boost’s enable pin, which decays on its own RC whatever the load, so the boost turns off about 2 s after the fade-out. I also set the boost to about 4.8 V, under USB VBUS, so the ideal diode rarely feeds a host.

The page ended with a checklist for before layout. Two items were open: the TPS61023’s enable thresholds, and whether the XIAO has a diode between VBUS and its 5 V pin. The ordered board settles the second. The XIAO wires its 5 V pin straight to VBUS, with no diode.

From a sketch to an order

The chat ends there. The next record is the board order, four days later.

Me

I drew the KiCad schematic myself from that page, and revised the circuit with Gemini as I went. The ordered board adds a 2.7 V supervisor that pulls the boost’s enable low on a low battery, and a switch that disconnects the battery divider whenever the XIAO is unpowered. The boost feedback became 470k/68k for 4.71 V, the amplifier’s mode resistor 510k, and the HOLD path resistor 22k.

The divider switch matters because the RP2350’s ADC pins aren’t tolerant of voltage while the chip is unpowered. Without the switch, the divider would hold about 2.4 V on one of them whenever the player is off.

Me

I had only a rough idea of the overall product, and I wanted the board’s shape settled before working on an enclosure. The chosen speaker set the minimum diameter, so the board is a Ø90 mm circle. I hand-solder the XIAO after JLCPCB assembles the rest, so I deleted its bottom pads from the footprint, keeping the castellations and the ground pad.

JLCPCB's order preview of the round rev 0 mainboard: the XIAO's castellated footprint at the top, the speaker terminal on the left, the volume-pot terminal on the right, the button at the bottom, and "Toddler Tunes Rev 0" on the silkscreen

Me

After the schematic capture and layout, I moved to Claude Code. I wanted it to check my work, and I wanted to find out whether it could help me build working hardware.

The order commit came from a Claude Code cloud session whose record hasn’t survived. It holds the KiCad project, a symbol library for the TPS61023, the JLCPCB production files, 3D models for the XIAO, the button, the battery holder and the volume pot, and a first enclosure. It records the board and the enclosure as ordered. The enclosure is the subject of the next post.