As it happens, it’s the final stage of the project where the two most important parts of the whole finally come together, these being the servo rig and the coding.
To begin, the servo rig needs to be just right. It has to be stiff enough so as not to move, whilst still allowing the pick to be adjusted up, down and sideways so as to position the tip of the pick just so; critically plucking just enough string whilst remaining at the right angle & depth so as to stay clear & not get stuck – or it would never pluck the string at all.
The picks themselves are real guitar picks which are bent so the pick point is parallel to the strings, with the relatively soft, rather than the harder picks being better for plucking the strings. The picks are affixed to the servo horns by a screw at the pivot and a small pin made from a piece of copper (from a cat6 data cable), which when inserted through the end of the horn and the pick, acts like a staple, thus making the servo and the pick one element. The servos are siliconed to small aluminium angles with slotted holes filed in the top to allow adjustment.
Another important part is the control architecture and getting the Pi and Arduino co-ordinating as intended, with each of these devices being better suited for certain tasks. For example, the Arduino is better at doing proper PWM (Pulse Width Modulation) which is required to control the position of servos, whilst the Pi offered a familiar Ubuntu/Python programming environment, wireless access for NTP and ssh, additional GPIOs and the flexibility to develop the code. The Pi is also used as a platform to write the Processing sketch which is then uploaded to the Arduino itself via the command line Arduino IDE ‘ino’. Communication between the Pi and the Arduino is done via a serial connection.
One of the interesting tasks in the coding was that the system needs to keep track of the state of each pick (i.e. its location, is it to the left or right of the string) so it knows in which direction to move the servo. This element is programmed on the Arduino, which sets up all the picks at the initial state when the system initially boots, and then operates whichever servo the Pi asks it to via the serial connection, whilst (importantly) also updating a “pick state” array, storing the current position of each of the six servos, thus keeping state. This part took some coding and testing, but once done it was set and forget.
Other design aspects include LED lighting to illuminate the white picks with blue light. I used the waterclear type LED’s instead of the diffused type because I wanted beams of light to really illuminate the picks. I glued the LEDs under the breadboard and also underneath the Pi to give a nice glowing effect with no direct light source visible. At the last minute I also drilled a small hole in the Perspex slab the Arduino sits on and inserted an LED to see what it would look like, and I think it looks real nice!
Altogether there are six yellow manual buttons to operate and tune each pick up and down individually, and two more buttons to run pre-programmed routines. The six tuning buttons are monitored by the Arduino and the other two pre-programmed buttons are monitored by the Pi.
The main frame is made from stained pine, clamped together around the body of the guitar by means of threaded rods, while the foam padding serves to further protect the guitar. Furthermore, in terms of visual appeal I wanted the wiring, circuitry and mechanics to be raw, fairly tidy but definitely not hidden, so the viewer appreciates what goes on behind the scenes.
Finally, as my nephew rightly points out, the frets are in the substantial need of some robotic attention. I agree, however this is enough for now and yes, another maker project is added to the list…
Each Friday is PiDay here at Adafruit! Be sure to check out our posts, tutorials and new Raspberry Pi related products. Adafruit has the largest and best selection of Raspberry Pi accessories and all the code & tutorials to get you up and running in no time!