Member-only story

Hack 555 Toy Piano for Better Sound Quality

recalculate the resistor values

circuit4u
5 min readNov 16, 2019

There are many cheap DIY 555 timer soldering kits on eBay (for example search: NE555 piano), which can generate sounds at different frequencies, with 8 push-buttons.

They are sold as toy pianos. But the piano notes are way off. So don’t expect to play any piece of music on these toys, unless you are willing to do some hacking.

Fortunately this one on eBay comes with its schematic

This is a typical 555 astable oscillator circuit that outputs square waveform to drive a speaker. As one of the keys from S1 to S8 is pressed, the C2 and different resistor path determine the RC time constant that sets the frequency of the square waveform.

The circuit is configured such that from right to left, subsequent key press (from S8 down to S1) adds additional resistor into the RC time constant, thus longer the period = lower the frequency, just like a piano keyboard does.

One reason that it doesn’t sound like a piano is because the frequency of the notes are way off. However we can “re-tune” the piano by replacing these resistors with the correct values.

Scale on the Piano

Here is a very nice introduction about the scale (i.e. frequencies) on a piano keyboard

So the key (pun-intended) is to generate these frequencies with the steps: 2 2 1 2 2 2 1, out of the 2^ n/12 power

[ scale =: +/\ 0 2 2 1 2 2 2 1
[ freq_factor =: 2^ scale % 12
1 1.12246 1.25992 1.33484 1.49831 1.68179 1.88775 2

These are the multipliers in front of a major frequency, to get all the notes in a scale. For example, C major scale, the major frequency is 130.813Hz

freq_factor * 130.813130.813 146.833 164.814 174.614 195.998 220 246.942 261.626

--

--

circuit4u
circuit4u

Written by circuit4u

memento of electronics and fun exploration for my future self

No responses yet

Write a response