Skip to content
This repository has been archived by the owner on Apr 7, 2024. It is now read-only.

devancakra/Alat-Musik-Piano-Berbasis-STM32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Source Love License: MIT GitHub last commit Project

Alat-Musik-Piano-Berbasis-STM32

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.



Project Requirements

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)



Download & Install

  1. Arduino IDE

    https://bit.ly/ArduinoIDE_Installer
    

  2. ST-Link USB Driver

    https://bit.ly/STLink_USB_Driver
    

  3. STM32CubeProgrammer

    https://bit.ly/STM32_Cube_Programmer_Installer
    



Project Designs

Block Diagram Pictorial Diagram
Block-Diagram Pictorial-Diagram
Wiring
Wiring



Basic Knowledge

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.



Arduino IDE Setup

  1. Open the Arduino IDE first, then open this project by clicking File -> Open :

    pianomini_stm32.ino


  2. Fill in the Additional Board Manager URLs in Arduino IDE

    Click File -> Preferences -> enter the Boards Manager Url by copying the following link :

    https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
    

  3. Board Setup in Arduino IDE

    How to setup the STM32F103C8T6 board

    • Click Tools -> Board -> Boards Manager -> Install STM32 MCU based boards.

    • Then click Tools -> Board -> STM32 boards groups -> Generic STM32F1 series.


  4. Change Board Part Number in Arduino IDE

    Click Tools -> Board part number -> BluePill F103C8


  5. Change U(S)ART Support in Arduino IDE

    Click Tools -> U(S)ART Support -> Enabled (generic 'Serial')


  6. Change Upload Method in Arduino IDE

    Click Tools -> Upload method -> STM32CubeProgrammer (SWD)


  7. Install Library in Arduino IDE

    Download all the library zip files. Then paste it in the: C:\Users\Computer_Username\Documents\Arduino\libraries


  8. Before uploading the program please click: Verify.

  9. 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.

  10. If there is still a problem when uploading the program, then try checking the driver / port / programmer tool / others section.



ST-Link/V2 Setup



Notes:

• The JTAG or Serial Cable Debugging (SWD) interface module is basically used to communicate with the STM32 board.

• You can see the wiring between the ST-Link/V2 and the STM32 board in the picture above.

• To upload the program, besides using the ST-Link/V2, you can also use other programming tools such as: CP2102 USB, CH340 USB, PL2303 USB, or with FTDI USB.

• Based on experience, I admit that using the ST-Link/V2 is much better than other programming tools because the process is easier, faster, and more stable.



Get Started

  1. Download and extract this repository.

  2. Make sure you have the necessary electronic components.

  3. Make sure your components are designed according to the diagram.

  4. Configure your device according to the settings above.

  5. Please enjoy [Done].



Highlights

pianomini-stm32



Appreciation

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.



LICENSE

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.

Releases

No releases published

Packages

No packages published