Puitar: Raspberry Pi electric guitar project
By Lucy Hattersley. Posted

What can you do with a Pi Zero and an old electric guitar? Nicola King channels her inner Dave Grohl and finds out
Advertisement
Starter electronics: how to build and program circuits with a Raspberry Pi or Raspberry Pi Pico.
When Behruz Farshi picked up his brother’s old electric guitar, he began to ponder the endless possibilities if he turned it into a digital instrument. The result is Puitar: an electronic guitar that's easy to play.
- The Puitar can output MIDI sounds, including a piano
- Puitar is currently monophonic, but a polyphonic version is possible
- The matrix requires more GPIO pins than the Pi Zero has…
- So an IO Pi Plus board is used to expand the number of pins
- Power is supplied by a battery pack with a switch
Raspberry Puitar! A Raspberry Pi Zero Guitar! from r/raspberry_pi
Upon first attempting to play the guitar, Behruz found it very hard work on his fingers: “I was thinking it would be nice to have some kind of instrument that can be played casually, but still is every bit of the real thing,” he tells us.
Well, a digital guitar wouldn’t need as much tension in the strings and also it could make any sounds you program it to make! So I ordered a Pi Zero and made a prototype.
Additionally, this was Behruz’s first Raspberry Pi-related project, as he explains: “I chose it because it is small, has all the hardware to make it convenient to do something quick, and runs Linux.”
Armed with his new Pi Zero, Behruz took around four days to develop both the hardware and the software for his project, with the most time-consuming aspect being the hardware element of the fretboard:
“As the idea was to use real guitar parts and space is very limited, it was not easy to assemble it.”
Puitar: Building an electric guitar with Pi Zero
The Puitar features a keypad matrix of 22 frets and six strings. When the player presses a string on a fret, they are connected, which means electricity can flow between them. This is detected on one of the Raspberry Pi’s GPIO pins and the appropriate note is played. “To find out which frets are pressed, we loop over the strings, setting [them] high, one at a time and checking which fret turns to show high,” explains Behruz. “The rest is a simple software project to make sounds for the pressed frets.”
To create the matrix, he drilled holes in the fretboard and soldered wires to the frets from below. After building the first prototype, however, he found that he frets would sometimes link the strings and make the guitar malfunction. “The solution is very simple: cut each fret in six parts that are separated, and connect them by diodes instead so they will conduct the electricity only in one direction, and separate the strings, although doing that manually with real fret wire will take ages.”
Puitar: Repeat performance
With this experience behind him, Behruz is now planning a second version of the Puitar:
“My plans are a body as close as possible to a real electric guitar (I have already done most of it). And, most importantly, the fretboard with the separated frets – without it, it is not possible to reliably play frets close to each other, as the strings will be connected unintentionally. On the software side, the plan would be to turn the whole project into a MIDI guitar so that I could just connect it over USB to the PC or a smartphone and play any sounds I want.”
As it is, this ingenious upgrade of an old electric guitar is music to our ears.
See also:
- Making music with a Raspberry Pi
- Giant guitar: The 12-foot electric guitar built using Raspberry Pi
- Pianola: the self-playing piano

Lucy is Editor of Raspberry Pi Official Magazine.
Subscribe to Raspberry Pi Official Magazine
Save up to 37% off the cover price and get a FREE Raspberry Pi Pico 2 W with a subscription to Raspberry Pi Official Magazine.
More articles

Starter Electronics in Raspberry Pi Official Magazine 157
After you’ve built your own simple circuit, why not think a little bit bigger – like building a product, and getting that product verified as officially Powered By Raspberry Pi? We take a look at some of the brilliant gadgets with Raspberry Pi at their heart. If you want to build a submarine, you might […]
Read more →

Win one of three Raspberry Pi 500 desktop kits
Everything you need for a PC, add your own monitor
Read more →

Picocomputer 6502
The Picocomputer 6502 is truly open-source hardware.
Read more →
Sign up to the newsletter
Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.