Mechanical Keyboard Application - Musical Keyboard

edited November 2022 in Projects

This article shows how to use multiple mechanical keyboards to simulate piano keys by pico control, producing different tones.Since the mechanical keyboard we use only has 12 keys, we only set tones between C4 and G5.Even so, we can still play a simple song.

Materials: Step 1: Disassemble the Mechanical Keyboard

We need to remove 12 keyboard keys from the acrylic base first.

Step 2: Prepare Dupont Wires

As shown in the figure above, we need to prepare 12 male to male Dupont wires and cut them in half to get 24 cut Dupont wires.Two Dupont wires are used for each keyboard key position.

Step 3: Strip the Cable, Connect the Port

Use wire strippers to strip the insulating outer surface layer at the ends of two DuPont wires, and directly wind it around the two ports at the bottom of the keyboard key position.

If wire strippers are not available, use scissors to gently trim the outer layer of the insulator.

Step 4: Welding



Using a soldering iron and tin wire, weld the Dupont wire and the keyboard key ports together completely.

Follow steps Step3 to Step4 for the other 11 keyboard keys.

Step 5: Reassemble Onto Acrylic Base


After we weld all the keyboard keys with Dupont wires, we need to reassemble them on the acrylic firmware that we took apart before.

Step 6: Connect the Pico


Connect one of the Dupont lines of all keyboard keys to the negative column on the bread board, and connect the other Dupont line to the corresponding pin port of Raspberry PI pico in an orderly arrangement. (Connecting pins are 4-15)
In the same way, connect the horn to the breadboard.(Connecting pin is 2)

Step 7: Download the Program

Open the Thonny software, set the interpreter to MicroPython, then save the program to the Raspberry PI Pico master and rename it "main.py".

Step 8: Program Running
After uploading the program successfully, you can control the sound by pressing the keyboard keys!

Click here to watch the video.
Tagged:
Sign In or Register to comment.