Skip to main content
Version: FILS English

Electric Piano

An electric piano made using mainly buttons and the Raspberry Pico 2W

info

Author: Preda Vlad
GitHub Project Link: Github

Description

This project aims to create a functional electric piano using the Raspberry Pico's many GPIO ports. Alongside the standard function to play notes, I aim to implement several others, such as a metronome, the choice between 5 separate instruments, a delay feature, the option to offset the used octaves and a playback feature. The main shell of the project will essentially be a 3D printed hull whose keys will press down on buttons that activate a specific GPIO to play a specific note. On command, a signal will be sent which will play an audio file specific to the current settings through a speaker.

Motivation

For a few years now, I've been learning to play the piano, using an old keyboard that I received a long time ago. Aside from the pleasure of playing, I have been interested in recreating the specific functions that my keyboard has, but also really wished it had more. The delay and playback features are not present on the keyboard I play, yet I feel my creativity could have fun with these features. Therefore, I chose such a topic out of love for music, but a desire to not be held back by the functionality of what I currently own.

Architecture

Diagram

Diagram

Components

The 2 Raspberry Pi Picos are used to control the entire project. One of them, on top of being used as a debugger, also lends its GPIO ports for the numerous buttons. For the note buttons, they cover 2 octaves + a note, and connect to GPIO pins from both Picos. The function buttons each cover a different purpose. There's a power supply which is needed to power a PAM8430 audio amplifier, which feeds into a speaker to play the sound of the note.

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

  • Raspberry Pico 2W: The brain of the project, it handles all the the input/output signals regarding keys and other features.
  • Speaker: Used in order to play the sound files, hooked up to an amplifier.
  • Potentiometer: Used to change volume.
  • Buttons: Used for keys, as well as supplementary features.

Schematics

Schematic

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller39.66 RON
Header pinsPins for the microcontroller + other modules2 RON
Amplifier module PAM8403Module for the speaker4 RON
3x BreadboardBreadboards for picos and other components30 RON
10k WH148 PotentiometerControlling volume2.39 RON
Cap for potentiometerCovers the potentiometer1 RON
Micro USB cableConnecting to the microcontroller4 RON
40x ButtonKeys + other functions
10cm Male-to-Male jumper wiresConnections between components5 RON
10cm Male-to-Female jumper wiresConnections between debug and main pico3 RON

Software

LibraryDescriptionUsage
embassy-rpThe HAL implements both blocking and async APIs for many peripherals.
defmtAdds several debugging featuresLogging/Debugging along the way
cortex-m-rtContains all the required parts to build a no_std application
embassy-timeTime management libraryUsed for time-based operations such as delays
  1. RP2350 Documentation
  2. Inspiration