PCB Design · Analog Audio
In this project I designed a stylophone as a Christmas present for my girlfriend. It was one of the first PCBAs that I designed, so there are a plethora of mistakes that I made which I would love to fix in a later revision. This board is a 2-layer PCB that centers around the classic 555-timer and LM386 audio amplifier. A baxandall volume circuit was used instead of a standard potentiometer for volume control. In addition, I added a small 1W speaker output which is enough to hear well in a quiet room.
At a Glance
Audio Path Overview
Virtual ground at VCC/2 allows single-supply operation. Coupling cap blocks DC from speaker.
From Simulation to Board
This project started because I wanted to build something for my girlfriend for Christmas. She plays piano, so I thought this would be perfect for her. I did some research and found an instructables page here that I pulled heavily from for the schematic design.
The idea behind the core functionality is that the keys are connected to a resistor on the PCB. When the stylus presses on a key, it completes a circuit and forms a voltage divider with R6 and R7. That voltage changes based on what key you press, and the voltage sets the output frequency from the 555 timer. Therefore, by carefully choosing the values of your resistors, you can output the necessary frequencies for piano notes. I did an initial simulation in LTSpice to verify that the circuit functioned as expected before moving on to KiCAD.
Baxandall volume control involves adding in two op amps to the standard potentiometer used to decrease the volume. The high impedance input buffer and inverting output amplifier does two main things: it gives a linear potentiometer a logarithmic volume response which is better for human hearing, and the transfer function is not a function of the pot track resistance or any other discrete resistances.
The output stage includes an LM386 audio amplifier and a 1W speaker. The LM386 was chosen because a single ic can supply enough current on the output to drive the 1W speaker, and it is relatively simple to set up, requiring only a few peripheral components such as decoupling and input/output capacitors to block DC.
The 2-layer board was laid out in KiCAD. Power is routed and utilizes polygon pours as opposed to dedicated power planes due to the low signal speed and low power of the design. Additionally, there are very few components and no controlled impedances, so no more than 2 layers are needed.
LTSpice — Stylophone
Full Circuit Diagram
KiCAD Design Files
What's Next
The project is functionally finished, but there are still things I would like to measure and evaluate or improve on such as: