Capacitive Symphony

by Drew-Marla-Abby-Object in Circuits > Arduino

332 Views, 2 Favorites, 0 Comments

Capacitive Symphony

12-14-2.JPG
12-14.JPG
Screen Shot 2021-12-15 at 10.41.20 PM.png
Schematic.jpg
capacitive.mov

We began this project with a goal; to create an environment where one can creatively express themself without having to hone a skill. Then, the idea of the Capacitive Symphony was born. It was to be a musical machine with easy to learn controls for people of all ages to use in order to express themselves.

We first began with structures similar to those of church organs. The design soon became more sleek and much more suited for resting on a table or being put up on a wall. It would work by using capacitive sensors (made from copper tape) to sense the presence of a hand hovering above it and then play a type of note depending on the pad hovered over and an octave slider we planned on implementing. The installation would also be powered by a wall socket rather than a pack of batteries, making it an installation that would require little maintenance.

Supplies

66077110678__650187E7-3EA6-494F-AEC6-6D42109F6C0A Small.jpeg
66093754545__AF68C7BA-5D13-4D81-B903-D55B71472BE7 Small.jpeg
IMG_3809.jpeg
IMG_3776 Small.jpeg

-Arduino Nano

-Arduino Uno

-(6) ATTiny85

-Adafruit Music Maker

-Adafruit Music Maker Amplifier

-2 Speakers

-Assorted Wire

-Laser Cutter

-3D Printer

-Neopixel Strip

-Power Switch

-Plywood

-Wood Glue

-4 Inch PVC Pipe

-Power supply - 12V 5A

Test Capacitive Touch With an LED

IMG_8329

We began testing capacitive touch in relationship to an LED very early on. We soon discovered that capacitive touch sensing has some upsides and some downsides. Upsides: it was an awesome way to trigger something. Downsides: it was very finicky, especially when you tried to implement more than one capacitive sensor in the same system. We learned this is because any wire extending from a capacitive plate would also carry a great amount of sensitivity and be subject to a lot of interference from other sensors! This would be one of our greatest challenges moving forward. Additionally, one challenge of this step was using the capacitive touch library with the Attiny microcontrollers. If we were going to have a solid grasp of what our microcontrollers were sensing, we had to figure out how to communicate with them. We used software serial with the Attiny to print our serial values and make sure our capacitive sensing was responsive.

Design & Build the Enclosure

IMG_8388 Small.jpeg
IMG_8389 Small.jpeg
IMG_8427 Small.jpeg
66104843848__CFC3913D-2435-48CB-BA9D-C7FE44B3196F.jpeg
IMG_4651 Small.jpeg
IMG_4652
IMG_8459 Small.jpeg

Early on, we ran into an issue with having multiple copper plates in close proximity to one another. Capacitive sensors are very sensitive. This makes them very useful on their own but in a group, they tend to interfere with each other and cause the entirety of the plate piece, wire and all, to be a sensor. The entire machine would go off at once and get stuck in an endless cacophony of sound and buzzing.

At first, we considered switching over to light sensors or physical touch sensors rather than use the copper tape. A clever solution soon emerged in the form of a troop of ATtiny85s. These tiny chips would work as a brain for each of the 6 sensors. this would allow for the sensor to be smaller eliminate the issue of "hot" wires running back to a single microcontroller, resulting is huge amounts of cross wire interference.

In order to bring attention to both the selected instrument and what sensor was active at any given note activation, we added very long strips of Neopixels under the buttons and the sensor spots. The colors would change for each note to show that it had been activated more than once and would dim and fade under buttons to show that it recognized the selection, whether it be the same instrument selected a second time or a brand new instrument.

3D Print Parts and Cut PVC Pipe

IMG_8381 Small.jpeg
IMG_8383 Small.jpeg
FJ32XP6KX7JSNGL.jpeg
IMG_8395 Small.jpeg
FK4R9HSKX7JSNFC.jpeg
FJKMRZXKX7JSNIB.jpeg
FAWV1KOKX7JSNH1.jpeg
F12FDUCKX7JSNH3.jpeg

The first step in putting together the interior of our project was to print out various 3D printed parts and cut out six even PVC Pipe rounds in order to elevate certain elements of the circuit while they are inside the enclosure.

Internal Assembly

66097062923__955FD911-BDC9-426D-B77C-6A4691EAB3B5 Small.jpeg
IMG_3777 Small.jpeg
IMG_8402 Small.jpeg
IMG_4583 Small.jpeg

Once we had tested every element of our system, it was time to assemble the insides of our device and get everything in place. We attached 4 inch pvc pipe with 3D printed joints, mounted button brackets, taped soldered LED strips in place, mounted our microcontrollers, amp, and speaker, and added the button rail, and of course assembled all of our breadboards.

Code

Although we had been continually working with code throughout this project, the final step in our process was getting our code where it needed to be for final presentation. That mean: adding functionality for changing octaves and instruments, adding changing light functionality for our drums, adding lights under the buttons, writing code on our ATTinys to handle our readings. Perhaps our biggest coding challenge of the project was finding a creative solution to the capacitive reading problem. That problem being: With how sensitive the capacitive touch sensors are, it is highly unlikely that we are going to get consistent reading across all 6 of our sensor plates. Any wire slightly out of place could result in much different readings. Therefore, if we were to write code that had a hard-coded threshold for triggering the sounds, our sensor would probably not perform the same. Our solution: a vector based long term averaging plan - the idea is to take the current capacitive sensor reading every N loops through our main loop, when that reading is taken, push that value to the vector, and calculate the average in an efficient manner. Then, we can say "trigger the light if the current reading ever goes X above the long term average." That way, we have dynamic, self calibrating sensors that will never get "stuck" triggering themselves over and over again.