This is a fully functional 8-note electronic piano built from discrete components. It produces musical notes from middle C to C' (261.6 Hz to 523.3 Hz) using an NE556 dual timer IC. The piano features a built-in adjustable tremolo effect, dual power supply (6V battery or 5V USB), volume control, and fits in a compact 17 by 8 by 6 centimeter enclosure. The total bill of materials cost less than HKD 20.
Why did I build it?I chose an electronic piano because it combines analog circuit design with practical music generation, it requires precise frequency calculation and component matching, it leaves room for creative features like the tremolo effect, and the final product is fun to use and demonstrate.
The challenge was to generate eight distinct, accurate musical notes using passive components only, stay under budget, and add at least one original feature beyond the basic requirements.
How does it work?Core Tone Generation
The first half of the NE556 timer is configured in astable multivibrator mode.
C is a fixed 0.1 microfarad ceramic capacitor. Ra is a fixed 18 kilo ohm resistor. Rb varies based on which key is pressed.
When you press a tact switch, it completes the circuit for a specific Rb resistor, generating a unique frequency. There are 8 keys producing the notes C, D, E, F, G, A, B, and C prime.
The resistor values used are shown below.
Audio Amplification
The output from the NE556 timer passes through a volume control potentiometer before entering the LM386 low-voltage audio amplifier. The LM386 drives an 8 ohm, half-watt loudspeaker.
Tremolo Effect (Key Innovation)
I repurposed the second timer of the NE556 as a Low-Frequency Oscillator or LFO. This generates a square wave that drives an NPN transistor connected in series with the audio signal path. The transistor acts as a voltage-controlled attenuator, rapidly turning the audio signal up and down to create the tremolo effect.
Two potentiometers control the tremolo. The rate knob adjusts the LFO frequency from approximately 1 Hertz for a slow warble to 10 Hertz for a rapid pulse. The depth knob controls how much the transistor attenuates the signal, from subtle to intense modulation.
Dual Power Supply
The piano can run on either a 6 volt battery pack using 4 AAA batteries, which provides full volume with slight noise, or a 5 volt USB connection via micro-USB, which provides reduced volume but stable operation. An SPDT switch selects between power sources. An LED indicates when the piano is powered on.
Schematic DiagramThe schematic shows the complete circuit including the NE556 astable configuration for tone generation, the push-button resistor network, the LM386 amplifier stage, and the second timer configured as LFO for the tremolo effect.
PCB LayoutI designed a compact PCB layout using PADS Layout. The design groups components into four functional modules: tone generation using the NE556 and resistor network, audio amplification using the LM386 and volume control, power supply with USB and battery switching, and the tremolo effect using the LFO and transistor attenuator. This modular grouping minimizes noise and crosstalk between sensitive analog signals.
Case DesignThe enclosure was designed using SolidWorks and measures 17 by 8 by 6 centimeters. It houses the PCB, battery holder, and speaker, and provides access holes for the keys, knobs, switches, and USB port.
Test ResultsI tested the piano using an oscilloscope and digital multimeter in the laboratory. I also simulated the circuit in TinkerCAD when the lab was not accessible.
The note frequency accuracy was within plus or minus 5 percent of theoretical values. Battery mode at 6 volts produced full volume with slight noise. USB mode at 5 volts produced reduced volume but stable operation. The tremolo rate range was adjustable from 1 to 10 Hertz. The tremolo depth range was adjustable from subtle to intense modulation. Power consumption was within expected range. The PCB dimensions were 17 by 8 centimeters, fitting inside the enclosure.
Issues encountered and fixed included initial noise issues resolved by adding decoupling capacitors, the battery connection order was reversed in early testing and corrected, the case cover fitment required revision in week 12, and a low battery caused no output which was resolved by replacing the batteries.
Cost BreakdownTone generation including the NE556, resistors, and capacitor cost HKD 3.30. Audio amplification including the LM386, speaker, and capacitors cost HKD 4.20. The tremolo effect including resistors, capacitors, and transistor cost HKD 3.20. The power supply including battery holder, USB, LED, and diodes cost HKD 3.40. Switches including power switch, tremolo switch, and 8 tact switches cost HKD 5.00. Sound improvement components including capacitors and a resistor cost HKD 1.30. The total cost was HKD 19.30.
Final Product PhotosFirst, insert 4 AAA batteries into the holder or connect a micro-USB cable. Second, flip the power switch and the LED will light up. Third, press the black tact switches to play notes. Fourth, turn the volume knob to adjust loudness. Fifth, flip the tremolo switch to enable the effect. Sixth, adjust the two tremolo knobs: one for rate which controls speed, and one for depth which controls intensity.
This project taught me how to calculate and implement precise frequencies using RC timing circuits, PCB layout techniques to minimize noise in analog audio circuits, how to repurpose a dual timer IC for two independent functions such as tone generation and tremolo, practical soldering and troubleshooting skills, and 3D case design for electronics enclosures.









































Comments