[ad_1]
The idea
Element14 Presents host Katie Dumont is not any stranger to integrating electronics into Lego units, as her earlier Lego Raspberry Pi HQ Digicam and Raspberry Pi Lego Practice tasks have demonstrated. This time round, her son, John, requested that she take a Lego guitar and make it play actual music with out many modifications, which might require some artistic use of inputs so no electronics may very well be simply seen.
Capacitive contact sensing
The vast majority of toy guitars depend on built-in pushbuttons to sign {that a} notice needs to be performed when it’s pressed, however as a result of the truth that this guitar is supposed to be taken aside, the answer is much from superb. As a substitute, capacitive contact sensors can be utilized identical to a standard pushbutton, besides they use the physique’s pure electrical discipline to detect modifications in a conductor’s capacitance and report it again through a sensor. For her venture, Dumont chosen the Seeed Studio MPR121 Contact Sensor Board which communicates over I2C and may sense throughout a number of channels.
Programming
Primarily based on a Raspberry Pi 3A, the Python program that Dumont wrote begins with initializing the MPR121 sensor by writing just a few configuration values and clearing any present knowledge. Subsequent, it enters into an infinite loop that constantly checks the MPR121 for which, if any, channels have been touched, and if they’ve, play the related sound through the Pygame library.
Taking part in the guitar
As soon as the copper tape was in place and coated with a skinny color-matched vinyl wrap, John bought to jam out together with his new Lego guitar. Making issues much more convincing is how Dumont positioned the Pi, its speaker, and amp right into a mini Lego electrical guitar amp, thus finishing the set. To see extra about how this venture was made, you may watch the video right here on the Element14 Presents YouTube channel.
[ad_2]