Detachable Instrument
Wearables
2022.12 | Class Project | 4 Weeks | Arduino
A musical instrument costume in which the parts of the instrument are detachable and can play different notes and melodies depending on where it is placed.
Material list
Adafruit circuit playground express
Ultrasonic sensor
Jumper wires(female)
T-shirt
Battery pack
Felt paper
Snaps and VELCRO sticky back strips with adhesive
Conductive thread
Code Implementation
I first connected the ultrasonic sensor to the circuit playground express board based on the online tutorial. Then I used the map function to change the pitch according to the distance.
Then, using the tilted rotation reference, I added a check rotation pitch part to the code to determine whether the detached instrument is placed vertically or horizontally.
Different songs are played depending on the placement circumstances. The instrument in the vertical position imitates a violin to play various pitches, while the instrument in the horizontal position imitates a guitar to play sweeping chords.
I also altered the color of the led lights to distinguish between placement in the horizontal and vertical directions. When placed vertically, the number of led lights will vary depending on the distance; When placed horizontally, they will only turn on when the movement is detected.
Sewing and Fabrication