Solo Project: STM32-based Piano Instrument
Piano is a melodic musical instrument that can produce tones when pressed. This musical instrument is in demand by many people because of its beautiful sound harmonization. However, its expensive price in the market makes some people unable to afford it. Therefore, this project was created with the aim of letting the general public know that pianos can actually be assembled by themselves, so price will no longer be a barrier. This will certainly be very beneficial for the wider community, because in addition to cutting costs, you can also customize it. This project has been done and took approximately 4 days. The results of this study show that the system can function properly.
Part | Description |
---|---|
Development Board | STM32F103C8T6 |
Code Editor | Arduino IDE |
Programmer Tools | ST-Link/V2 |
Driver | ST-Link USB Driver |
Communications Protocol | Universal Asynchronous Receiver-Transmitter (UART) |
Application Support | STM32CubeProgrammer |
Programming Language | C/C++ |
Arduino Library | • SoftwareSerial (default) • DFRobotDFPlayerMini |
Actuators | Speaker |
Other Components | • Micro USB cable - USB type A (x1) • Adaptor DC 5V (x1) • Jumper cable (1 set) • DF-Player Mini MP3-TF16P (x1) • Micro SD card: SanDisk (x1) • Breadboard (x2) • Resistor (x1) • Electrolytic capacitor (x1) • Push button 12 x 12 mm (x8) |
-
Arduino IDE
https://bit.ly/ArduinoIDE_Installer
-
ST-Link USB Driver
https://bit.ly/STLink_USB_Driver
-
STM32CubeProgrammer
https://bit.ly/STM32_Cube_Programmer_Installer
Block Diagram | Pictorial Diagram |
---|---|
Wiring |
---|
Basically, a device can be communicated with other devices either wirelessly or by cable. Communication between commonly used hardware is Serial Communication
. It can be known that there are three types of Serial Communication
, which include: UART (Universal Asynchronous Receiver-Transmitter)
, SPI (Serial Peripheral Interface)
, and I2C (Inter Integrated Circuit)
. There are two kinds of UART Serial Communication
, namely Hardware Serial
and Software Serial
. Hardware serial communication
can be done by connecting the TX
and RX
pins crosswise
on each development board, for example: RX-TX
, then TX-RX
. The TX
pin is for sending data
, while the RX
pin is for receiving data
. Serial Software Communication
is more or less the same as Serial Hardware Communication
in terms of cabling, but there are differences in terms of coding. By using this Serial Software
you can overcome the constraints of the limitations of RX
and TX
pins on the development board. To communicate with this Serial Software
is quite easy, namely by using certain Digital Pins
as a substitute for TX pins and RX pins
.
-
Open the
Arduino IDE
first, then open this project by clickingFile
->Open
:pianomini_stm32.ino
-
Fill in the
Additional Board Manager URLs
in Arduino IDEClick
File
->Preferences
-> enter theBoards Manager Url
by copying the following link :https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
-
Board Setup
in Arduino IDEHow to setup the
STM32F103C8T6
board• Click
Tools
->Board
->Boards Manager
-> InstallSTM32 MCU based boards
.• Then click
Tools
->Board
->STM32 boards groups
->Generic STM32F1 series
.
-
Change Board Part Number
in Arduino IDEClick
Tools
->Board part number
->BluePill F103C8
-
Change U(S)ART Support
in Arduino IDEClick
Tools
->U(S)ART Support
->Enabled (generic 'Serial')
-
Change Upload Method
in Arduino IDEClick
Tools
->Upload method
->STM32CubeProgrammer (SWD)
-
Install Library
in Arduino IDEDownload all the library zip files. Then paste it in the:
C:\Users\Computer_Username\Documents\Arduino\libraries
-
Before uploading the program please click:
Verify
. -
If there is no error in the program code, the next step is to use the
STM32
programming tool according to the procedure. Then click:Upload
. -
If there is still a problem when uploading the program, then try checking the
driver
/port
/programmer tool
/others
section.
Notes:
• The JTAG or • You can see the wiring between the • To upload the program, besides using the • Based on experience, I admit that using the |
-
Download and extract this repository.
-
Make sure you have the necessary electronic components.
-
Make sure your components are designed according to the diagram.
-
Configure your device according to the settings above.
-
Please enjoy [Done].
If this work is useful to you, then support this work as a form of appreciation to the author by clicking the ⭐Star
button at the top of the repository.
MIT License - Copyright © 2024 - Devan C. M. Wijaya, S.Kom
Permission is hereby granted without charge to any person obtaining a copy of this software and the software-related documentation files to deal in them without restriction, including without limitation the right to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons receiving the Software to be furnished therewith on the following terms:
The above copyright notice and this permission notice must accompany all copies or substantial portions of the Software.
IN ANY EVENT, THE AUTHOR OR COPYRIGHT HOLDER HEREIN RETAINS FULL OWNERSHIP RIGHTS. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, THEREFORE IF ANY DAMAGE, LOSS, OR OTHERWISE ARISES FROM THE USE OR OTHER DEALINGS IN THE SOFTWARE, THE AUTHOR OR COPYRIGHT HOLDER SHALL NOT BE LIABLE, AS THE USE OF THE SOFTWARE IS NOT COMPELLED AT ALL, SO THE RISK IS YOUR OWN.