An Electronic Keyboard using an Integrated Circuit
A Brief Description of How it Works

When a key is pressed the keyboard circuit sends an alternating electrical current to the speaker. The alternating current has the following shape:

This type of signal is called a "square wave." The square wave input to the speaker causes the speaker cone to vibrate producing the buzzing sound. The pitch of the output buzz or tone depends upon the frequency of the square wave signal. As was determined in the earlier sound laboratory, a higher frequency signal results in a higher pitch output from the speaker. Conversely, a lower frequency electrical signal at the speaker causes a lower pitch output.


 


How is the frequency of the output signal determined? The frequency of the output signal is determined by the integrated circuit (LM324) in combination with the resistors and capacitors. To understand how a tone is produced, it is necessary to understand the function of the resistors and capacitors.

The resistors are the small cylinders with the colored bands or stripes. A resistor can be used to limit the amount of current flowing in a particular part of a circuit. As explained in the laboratory procedure, resistors can take on different values of electrical resistance. Electrical resistance is measured in units called ohms. With all other things kept equal, a resistor with a higher resistance (more ohms) will allow less current to flow than a resistor with a lower resistance (less ohms).

Another important component is the capacitor. In the simple keyboard only one capacitor is used. This the small green object. The function of capacitors is to store electrons. The storage capacity of a capacitor is measured in units called: "farads." A one farad capacitor connected to a one volt battery, can store 6,280,000,000,000,000,000 electrons. Usually this large a capacity is not required. Typical applications use capacitors with rating of about 1 microfarad, meaning 1 millionth of a farad. Microfarad is abbreviated: "mfd." The capacitor we are using has a rating of 0.1 mfd. The process of adding electrons to a capacitor is called charging. As a capacitor is charged, its voltage increases. When the capacitor is charged to capacity, the voltage stabilizes at a constant value.

When a key is pressed, the capacitor begins charging. While the capacitor is charging the output of the LM324 integrated circuit is at its maximum of about 6 volts. This is the upper part of the square wave. When the capacitor reaches maximum charge, the output of the LM324 switches to near 0 volts and the capacitor discharges. This is the bottom part of the square wave. If the key is still pressed, the capacitor begins charging again and the LM324 output returns to 6 volts. The charging-discharging cycle continues to repeat as long as the key is pressed. The 6-0-6-0-6-0 etc. volt cycle is sent to the speaker resulting in the buzzing tone that we hear.

The pitch of the tone depends on the time required for the capacitor to reach full charge. If the capacitor charges slowly the square wave has a low frequency and the output pitch is low. If the capacitor charges quickly the square wave going to the speaker has a higher frequency and the output pitch is higher.

The rate of capacitor charging and hence the pitch of the output sound is controlled by the resistor connected to each key. The current of electrons to charge the capacitor must flow through the resistor connected to that key. A higher resistance results in less current and consequently a longer charging time. The longer charging time causes a lower pitch output. Thus the higher the resistance the lower the pitch.

Why do some of the keys have more than one resistor? The keyboard is set up so that the keys approximate an octave of a musical scale. To do this, each key must produce a pitch corresponding to each note on a scale. The output pitch depends on the resistance connected to the capacitor. To achieve the desired pitch, the resistance must have a specific value. When resistors are purchased they are only available in certain standard values. To reach some of the values needed in the keyboard circuit, two standard value resistors must be added together.

What is happening when a hand or other object is passed over the photocell causing a changing pitch of the output sound? The photocell is a type of resistor in which the resistance varies with the amount of light hitting the cell. When very little light hits the cell the resistance is high. This results in a low pitch. As more light reaches the surface of the photocell the resistance decreases causing an increase in pitch. This type of photocell is also called a photoresistor because the resistance changes with changing light levels. The photocell is made up of the elements cadmium and sulfur. Light hitting the cell is absorbed by electrons. The electrons increase in energy levels eventually moving away from the atoms to which they were bound. These free electrons lead to an increase in the ability of the cadmium sulfur material conduct electricity and a decrease in resistance.


© 2001 John J. Krupczak, Jr.
All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of the author is prohibited.