

PianoCH323V
Um piano desenvolvido com o microcontrolador CH32V002
- Size
- 124.5 × 42.1 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 33
- Nets
- 31
- Pads
- 100
- Tracks, vias
- 178, 0
- Pours
- 1
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 10 Oct 2026
- Updated
- 10 Oct 2026
Overview
PianoCH323V is an open-source printed circuit board by dquadros, from the dquadros/ch32v_piano repository on GitHub, published under the MIT licence. It is a 2-layer board of 124.5 × 42.1 mm with 33 parts on 31 nets, routed with 178 tracks and 0 vias.
It is built around the S8050. Its parts include 12 resistors, 7 switches, 3 connectors, 2 capacitors and 1 IC. It belongs with the RISC-V boards of this library.
Main components
1README
README.mdPiano com CH32V002
(english documentation at the end)
Português
A ideia básica deste projeto é usar o PWM de um microcontrolador para tocar uma nota conforme a tecla apertada. A inspiração veio de um kit chinês que utiliza um 555.
Hardware
Eu utilizei um CH32V002A4M6, um microprocessador RISC-V de 32 bits, operando a 48MHz, com 4 kbytes de RAM e 16 kbytes de Flash e encapsulamento SOP16. É uma escolha certamente exagerada para o projeto, mas foi baseada no meu interesse pelo CH32V00x e ter 50 destes chips na gaveta. O CH32V003A4M6, com menos memória, provavelmente seria mais apropriado.
Após algumas experiências, optei por pegar a saída do PWM (uma onda quadrada), passar por um filtro RC e amplificar usando um transistor S8050.
Os botões estão todos ligados a uma única entrada analógica. A tecla apertada é inferida a partir da tensão presente na entrada.
Um trimpot é usado para realizar a afinação e um LED foi acrescentado para o debug.
A alimentação pode ser feita pelo conector de programação ou (no caso da PCI) por um conector micro USB.
Software
O software foi desenvolvido com o ch32vfun, uma infraestrutura de baixo nível (a programação é feita em C, acessando diretamente os registradores do microcontrolador).
No momento em que escrevo isso, a maioria dos exemplos no ch32Vfun é para o CH32V003 e requer ajustes para os demais modelos (como o CH32V002).
A programação do ADC para a leitura dos botões e do trimpot é relativamente simples. O código realiza várias leituras consecutivas para tentar pegar valores estáveis.
A programação do PWM é mais trabalhosa, mas é simples mudar a frequência uma vez feita a iniciação.
No uso normal, o trimpot de afinação é lido somente na iniciação e usado para ajustar todas as notas. Ligando o circuito com uma tela pressionada, entra-se no modo de afinação. Uma nota é tocada continuamente e sua frequência é atualizada periodicamente conforme a posição do trimpot.
Placa de Circuito Impresso
Uma placa foi projetada com o Kicad e está atualmente em produção.
Diretórios
Este repositório possui os seguintes diretórios:
- Hardware: esquema e projeto da PCI, feito com o Kicad 10
- Imagens: logotipo usado na PCI e imagem renderizada da PCI
- Outros: planilha excel para cálculo da programação do PWM
- Software: fontes e executáveis
English
The basic idea behind this project is to use a microcontroller's PWM to play a note corresponding to the key being pressed. The inspiration came from a Chinese kit that uses a 555 timer.
Hardware
I used a CH32V002A4M6, a 32-bit RISC-V microcontroller operating at 48 MHz with 4 KB of RAM and 16 KB of Flash in an SOP16 package. It is certainly an overkill for the project, but the choice was driven by my interest in the CH32V00x series and the fact that I had 50 of these chips in my drawer. The CH32V003A4M6, which has less memory, would likely have been more appropriate.
After some experimentation, I opted to take the PWM output (a square wave), pass it through an RC filter, and amplify it using an S8050 transistor.
The buttons are all connected to a single analog input. The specific button pressed is determined based on the voltage present at the input.
A trimpot is used for fine-tuning, and an LED has been added for debugging purposes.
Power can be supplied via the programming connector or (in the case of the PCB) via a micro-USB connector.
Software
The software was developed using ch32vfun, a low-level framework (programming is done in C, directly accessing the microcontroller's registers).
At the time of writing, most ch32vfun examples are designed for the CH32V003 and require adjustments for other models (such as the CH32V002).
Programming the ADC to read the buttons and the trimpot is relatively straightforward. The code performs several consecutive readings to obtain stable values.
Programming the PWM is more involved, though changing the frequency is simple once initialization is complete.
During normal operation, the tuning trimpot is read only at startup and is used to adjust all notes. Powering on the circuit while a key is pressed enters tuning mode; a note plays continuously, and its frequency is periodically updated based on the trimpot's position.
Printed Circuit Board
I used Kicad to design a PCB, it is currently in production.
Directories
This repository contains the following directories:
- Hardware: schematic and PCB design, created with KiCad 10
- Images: logo used on the PCB and a rendered image of the PCB
- Other: Excel spreadsheet for calculating PWM settings
- Software: source code and executables
Parts
33| Qty | Value | Footprint | References |
|---|---|---|---|
| 7 | SW_Push | Button_Switch_THT:SW_PUSH-12mm | SW1, SW2, SW3, SW4, SW5, SW6, SW7 |
| 4 | , , , | ||
| 3 | 100k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R3, R4, R6 |
| 3 | 1k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R1, R2, R12 |
| 1 | 100k | Potentiometer_THT:Potentiometer_Runtron_RM-063_Horizontal | RV1 |
| 1 | 100nF | Capacitor_THT:C_Disc_D4.3mm_W1.9mm_P5.00mm | C2 |
| 1 | 100uF | Capacitor_THT:CP_Radial_D5.0mm_P2.50mm | C1 |
| 1 | 12k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R10 |
| 1 | 220k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R5 |
| 1 | 22k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R9 |
| 1 | 33k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R8 |
| 1 | 4.7k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R11 |
| 1 | 47k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal | R7 |
| 1 | CH32V002A4M6 | Package_SO:SOP-16_4.55x10.3mm_P1.27mm | U1 |
| 1 | LED | LED_THT:LED_D3.0mm | D1 |
| 1 | LOGO | LOGO | G*** |
| 1 | PGM | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Horizontal | J3 |
| 1 | S8050 | Package_TO_SOT_THT:TO-92_Inline | Q1 |
| 1 | SPK | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Horizontal | J1 |
| 1 | USB_B_Micro | Connector_USB:USB_Micro-B_Wuerth_629105150521_CircularHoles | J2 |
Similar boards
- 2 layers60 × 40 mm

- 10 layers224.5 × 160 mm

Haasoscope pro adc fpga board
drandyhaas/HaasoscopePro
Affordable 2 GHz 3.2 GS/s 12 bit open-source open-hardware expandable USB real-time oscilloscope
586 parts485MIT - 2 layers100 × 57 mm

- 4 layers74 × 104 mm

- 2 layers189.5 × 204.9 mm

SmartSpin2k Panelized
doudar/SmartSpin2k
Transform your spin bike into a Smart Trainer!
749 parts292GPL-2.0 - 2 layers13.7 × 21.4 mm

- 4 layers43 × 49 mm

- 2 layers85 × 56 mm

Questions
How big is the PianoCH323V PCB?
It measures 124.5 × 42.1 mm and has 2 copper layers, 1.6 mm thick.
What parts does the PianoCH323V use?
33 parts, built around the S8050. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the PianoCH323V KiCad files?
From the dquadros/ch32v_piano repository on GitHub, at the commit this page was made from: the board is hardware/PianoCH323V.kicad_pcb and its schematic hardware/PianoCH323V.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the PianoCH323V design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).