From a working prototype to a reusable audio module
In the first part of this project, I looked at a simple way of generating sound with a low-cost microcontroller. The proof of concept used an LPC802 evaluation board, PWM generation, a passive reconstruction filter, and an external audio amplifier.
It worked, and it was enough to establish that a small microcontroller could produce useful electronic chimes without requiring a dedicated audio subsystem.
The next challenge was turning that experiment into something other projects could actually integrate.
This meant designing a compact PCB containing the microcontroller, the analog signal-conditioning circuit, and the audio amplifier. I wanted it to be versatile enough to serve as a standalone module, a convenient development platform, and a reliable reference design.
This is Stage 1 of Ehrenpreis: translating the proof of concept into hardware.
Choosing the microcontroller variant
The evaluation board was invaluable for firmware development, but the final module called for a more specific device configuration. I selected the LPC802M011JDH20 for the PCB layout.
One key advantage is its dual-supply capability. Another is simply that I had a few units left over from a previous build. The module is designed to run on a 5 V supply for the audio amplifier, while an onboard LDO steps this down to 3.3 V for the core microcontroller supply.
The I/O supply domain, VIO, is brought out separately. This allows the digital interface to match the host system's logic level within the microcontroller's electrical ratings. When a separate I/O voltage isn't required, VIO can be tied directly to 3.3 V using a configuration jumper or a 0 Ω link.
The LPC802's 5 V-tolerant inputs are helpful here, with one crucial caveat: the supply rails must never be tied to ground while 5 V is present at the inputs.
This power architecture strives to make the module much easier to drop into existing systems without forcing every host board to share the exact same logic rail.
Getting the analog interface right
The PWM output isn't enough to drive the low-pass filter directly under every operating condition.
The planned RCRC filter can draw an input current of up to approximately 4 mA. That exceeds what I wanted to demand from the microcontroller outputs, which are specified for a drive capability of 4 mA across the operating temperature range. While the LPC802 does feature higher-drive pins, they are unfortunately restricted to the VIO side—not where I wanted to route this particular signal path.
The solution is a discrete buffer placed between the microcontroller and the filter. The footprint accommodates logic gates such as the 74LVC1G125 and 74LVC1G17, and the LVC series delivers up to a massive ±24 mA
It is a minimal component addition, but it significantly hardens the electrical interface, ensuring the analog filter's loading characteristics don't compromise the microcontroller outputs.
I also allocated a significant amount of board real estate for power-supply filtering. Even if some of those positions go unpopulated in the final configuration, having the footprint ready is far better than discovering later that the layout left no room for noise mitigation.
The same philosophy guided the audio amplifier stage. Rather than locking the design into a single part, the layout accommodates a versatile family of audio ICs, including the LM4990, TS4994, SSM2305, and PAM8302.
These devices are not strictly pin-compatible, meaning the schematic required a more creative, multi-option routing approach. While it took extra effort to design, it provides welcome flexibility when sourcing components or experimenting with different amplifier topologies.
A board that is easy to integrate
The initial target was a snug 40 × 40 mm square. Once connectors, mounting geometry, and circuit options were placed, the footprint settled at 45 × 45 mm.
Mechanical mounting is handled by four M3 holes in the corners on a 35 mm grid. For the speaker connection, the design uses a standard two-pin JST XH connector or a compatible equivalent.
The main system connector is a six-pin, 2.0 mm-pitch Molex Micro-Blade. While it's an older, discontinued family – largely superseded by the ubiquitous 1.25 mm Pico-Blade in modern designs – I chose it because I already had stock on hand. Furthermore, the layout can accommodate various 2.0 mm upright connectors without locating bosses, meaning alternatives like JST PH-style connectors and similar parts can be easily substituted depending on what you have available.
The PCB itself is a four-layer stack-up.
While a two-layer board could work with more routing optimization, the posibility of using a Class D audio amplifier made the superior EMC performance and clean ground planes of a four-layer board well worth it.
For a small prototype batch, spending hours squeezing a two-layer layout makes little economic sense when prototype fabrication services make four-layer boards inexpensive and straightforward.
Ordering the first revision
With the schematic and layout finalized, I submitted the first PCB order to a standard prototype manufacturer.
This is a major milestone, but it doesn't mean the hardware is verified yet. The filter component values still need thorough simulation and real-world bench testing. LTspice remains an invaluable tool here for validating frequency response before soldering.
A preliminary review of the board layout also revealed a minor mechanical oversight: one of the mounting holes is positioned 0.5 mm too far to the left.
It’s not a functional showstopper, but it’s precisely the kind of detail design verification should catch. It's going straight onto the revision checklist. Even for simpler boards, cross-checking mechanical drawings and connector clearances is just as critical as validating net connections.
Project status
As of November 2026, the Stage 1 schematic and PCB layout are complete, and the initial boards are in production. Filter tuning, component assembly, and hardware verification lie directly ahead.
Stage 2 will shift focus back to firmware. The proof-of-concept code needs to be ported to the module's specific microcontroller variant, configuration strapping must be handled, and the I2C slave functionality – not on the original evaluation board – needs to be implemented.
You can follow the hardware and firmware development in the Ehrenpreis repository on GitHub. Future updates will cover filter simulation, board bring-up, and firmware integration.
A quick note on AI: The hardware design, PCB layout, and core firmware logic are 100% my own manual work, with AI only assisting briefly with firmware code cleanup. The heaviest use of AI was actually writing the blog posts – I fed my personal bullet points into a free-tier LLM to generate the prose, then went through and edited it myself to make sure everything reads accurately.

