Design of an Electronic Piano Based on the 51 Microcontroller

This design includes Proteus simulation, program, design report, and explanatory video.

1. Development Environment

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

Simulation Diagram: Proteus 8.17 (lower versions available)

Program Compiler: Keil 4/Keil 5

Programming Language: C

Design Number: P23

2. Main Functions:

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

Design an electronic piano. Using the provided keyboard with keys 1, 2, 3, 4, 5, 6, 7, and 8, it can produce 8 different tones. It is required that pressing a key produces sound, and releasing it stops the sound after a delay, allowing another key to be pressed to produce a different tone.

When the system detects a key pressed on the keyboard, it quickly identifies which key is pressed, then the microcontroller’s timer is activated to emit a pulse at a certain frequency. This frequency pulse, when input to the buzzer, will produce the corresponding tone. If another key is pressed while the previous key is still sounding, the interrupt system is activated, stopping the sound of the previously pressed key and switching to the sound program of the later pressed key.

The difficulty of this project lies in implementing music playback, which can be achieved using a timer counter. By loading different initial count values, square waves of different frequencies can be generated and input to the buzzer (SOUNDER) to produce sounds of varying frequencies. In this design, the microcontroller’s crystal oscillator is 11.0592MHz. By calculating the frequencies of each musical scale, we can assign the initial values for the timer to 64580, 64684, 64777, 64820, 64898, 64968, 65030, and 64655 for the 7 tones.

Main Hardware: 51 Microcontroller, Digital Tube, Independent Keys

(Currently fully compatible with the PuZhong 51 Experiment Board 234; other PuZhong development board models require wiring.)

Design of an Electronic Piano Based on the 51 Microcontroller

Note that the 51 microcontroller chip in the simulation is compatible; AT89C51 and AT89C52 are specific models of the 51 microcontroller, with the same core. In the same schematic, whether STC or AT, the pin functions are the same, the programs are compatible, and the chips can be replaced with STC89C52/STC89C51/AT89C52/AT89C51 and other 51 microcontroller chips.

Download Link for Materials:

P Series Microcontroller Design Download Link (copy to browser to open)

https://docs.qq.com/doc/DS2pPenNRaHB6SlR1

Design of an Electronic Piano Based on the 51 Microcontroller

The following are display images of the design materials:

3. Physical Images:

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

4. Simulation Design

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

Open the simulation project, double-click the microcontroller in Proteus, select the hex file path, and then start the simulation.

At the beginning of the simulation, the first digit of the digital tube displays 8.

Design of an Electronic Piano Based on the 51 Microcontroller

When key 1 DO is pressed, the digital tube displays 1, and the buzzer emits the audio DO. When the key is released, the sound stops.

Design of an Electronic Piano Based on the 51 Microcontroller

When key 7 XI is pressed, the digital tube displays 7, and the buzzer emits the audio XI. When the key is released, the sound stops.

Design of an Electronic Piano Based on the 51 Microcontroller

5. Program Code

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

Use Keil 4 or Keil 5 to compile. The code is commented, and you can understand the meaning of the code in conjunction with the video.

Design of an Electronic Piano Based on the 51 Microcontroller

6. Design Report

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

8261-word design report, including hardware design, software design, soft and hardware block diagrams, debugging, conclusions, etc.

Design of an Electronic Piano Based on the 51 Microcontroller

7. List of Design Materials & Download Links

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

The design materials include simulation, program code, explanatory video, functional requirements, design report, and soft and hardware design block diagrams.

Design of an Electronic Piano Based on the 51 Microcontroller

0. Common usage issues and solutions – must read!!!!

1. Program

2. Proteus simulation

3. Functional requirements

4. Soft and hardware flowcharts

5. Project proposal

6. Design report

7. Programming tools

8. Explanatory video

9. Physical images

Altium Designer installation and cracking

KEIL + Proteus microcontroller simulation design tutorial

KEIL installation and cracking

Proteus component search

Proteus installation

Proteus simple usage tutorial

Microcontroller learning materials

Relevant data sheets

Defense skills

Common descriptions in design reports

Double-click to open and find the Jiasheng microcontroller 51 STM32 microcontroller course graduation design.url

Download link for materials:

https://docs.qq.com/doc/DS2pPenNRaHB6SlR1

More resources click the link below:

https://docs.qq.com/sheet/DS0xIa0llTmtNakRW

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

WeChat Official Account

Jiasheng Microcontroller

Website|www.eemcu.cn

Design of an Electronic Piano Based on the 51 MicrocontrollerDesign of an Electronic Piano Based on the 51 Microcontroller

Leave a Comment