SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**MCU Simple Keyboard Design (1)** Designing a simple keyboard involves using seven notes: 1, 2, 3, 4, 5, 6, and 7. Each note corresponds to a specific frequency, which can be generated by the microcontroller. The basic idea is to use these frequencies to create musical tones.

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**Principle:** Music is made up of different scales, each corresponding to a unique frequency. By combining these frequencies, we can generate the desired music. A microcontroller can easily produce various frequencies using its timer/counter. For example, the timer T0 can be used to generate square wave signals. To achieve this, you need to adjust the frequency relationships of the notes in the song. In this design, the microcontroller uses a 12MHz crystal oscillator, resulting in a 1MHz counting frequency. Depending on the working mode, the value of T is calculated as T = 2¹⁶ - (5×10⁵ / frequency). This means that for different frequencies, the timer needs to be set accordingly. Below is a table showing the count values associated with each note:

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**MCU Simple Keyboard Design (2)** The implementation of a keyboard using a microcontroller involves connecting buttons to generate square waves at specific frequencies, which then drive a buzzer to produce sound. Each tone corresponds to a fixed frequency. In music theory, there are seven main notes: 1, 2, 3, 4, 5, 6, 7, and an octave of 1. The frequency of the higher octave is exactly double that of the lower one. To generate a specific tone, the microcontroller’s I/O port can output a square wave signal. After amplification, the buzzer produces the corresponding sound. This can be done using the microcontroller’s timer to generate an overflow interrupt. When the interrupt occurs, the output pin level is toggled, and the counter is reloaded. For example, if the middle C has a frequency of 523Hz, its period is approximately 1912μs, and half of it is 956μs. Given that the MCU’s clock cycle is 1μs (with a 12MHz crystal), the initial value of the timer should be set to 65536 - 956 = 64580. Adjusting the timer’s overflow time for different buttons allows the generation of various frequencies, enabling the creation of a simple keyboard. The following table lists the note names, their frequencies, and the corresponding initial values for the timer T1 when using an 8-octave scale and a 12MHz crystal:

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

The hardware design is straightforward. The P1 port is used for scanning the keyboard buttons, while the P0.1 port outputs the square wave. A transistor amplifies the signal before it drives the buzzer. The system’s hardware layout is shown below:

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**Simple Electronic Keyboard Design Using MCU (3)** **Basic Music Theory** The pitch of a note is determined by its frequency. In polyphonic music, the relationship between pitches is more complex, but it's generally based on the frequency of the individual notes. Each frequency corresponds to a specific tone. In an octave starting with C, the frequencies are listed in Table 1. If a circuit can generate a waveform of a specific frequency and convert it into sound through a speaker, a simple tone generator can be created. Combining this with a keyboard structure results in a functional electronic keyboard.

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

The circuit diagram is shown below:

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

This schematic represents a miniature octave keyboard. There are eight switches, each corresponding to a different note. Only one switch is activated at a time. In practice, to ensure the circuit starts properly, two diodes are often connected in parallel with a resistor, mimicking the behavior of a thermistor. Additionally, the initial signal comes from ambient noise or internal voltage. To make the effect more visible, a capacitor can be charged manually. The operational amplifier LM324 requires ±5V power, so a 7809 voltage regulator and rectifier bridge are used to create a negative power supply. This power supply is integrated with the keyboard circuit to form a complete, usable device. **Simple Computer Keyboard Design (4)** **8-Key Simple Keyboard Using NE555**

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**Physical Layout:**

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**Simple Computer Keyboard Design (5)** **Simple Keyboard Circuit**

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**MCU Simple Keyboard Design (6)**

SCM simple keyboard design plan Daquan (six analog circuit design schematics detailed)

**Circuit Working Principle:** Rp1–Rp13 are the resistance values for the keyboard scales and the oscillator timing. C2 is the discharge capacitor, and S1–S13 are the key switches. When any key, such as S1, is pressed, +6V is charged through Rp1 and S1. Initially, C2 is at 0V, so VT1 remains off. At this point, +6V provides base bias to VT2, turning it on. Current flows through the speaker via the collector and emitter of VT2, creating a high voltage drop across the speaker.

Pneumatic Lifting Column

Pneumatic Lifting Column,Telescopic Pillar Actuator,Telescopic Lifting Column,Telescopic Electric Cylinder

Kunshan Zeitech Mechanical & Electrical Technology Co., Ltd , https://www.zeithe.com