Listening to butterflies’ sound

I combined Arduino and paper arts together in this project. You can see four paper butterflies connected to four different -length wires are fixed by nails. When you use your finger to touch the heads of the nails on butterflies, the speaker connected to the work will make sound. When you touch different butterflies, the different sound you will get. You can also play on these different sounds to make your own butterfly song.

You can see the video here:Butterflies’ sound

Originally, I want to make piano keys with different tones, when you use play with these keys, these keys will give you different sounds. However, when I search it on the website, there are many similar works like it. So I decided to make something different.


I still kept my first idea that people can interact with the machine directly. With the help of professor and my classmates, finally, I chose “capacitive sensor” to achieve this goal. Basically, the sensor value can be changed when you touch its input wire. In this situation, I can set the sensor as my input to play the role of switch to control the whole circuit. Meanwhile, I set speaker as an output to make different sound when the input given values.

int noteDurations[] = {
  4, 8, 8, 4, 4, 4, 4, 4

#include <CapacitiveSensor.h>

 * CapitiveSense Library Demo Sketch
 * Paul Badger 2008
 * Uses a high value resistor e.g. 10M between send pin and receive pin
 * Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
 * Receive pin is the sensor pin - try different amounts of foil/metal on this pin

CapacitiveSensor   cs_2_3 = CapacitiveSensor(2, 3);       // 10M resistor between pins 2 & 3, pin 3 is sensor pin, add a wire and or foil if desired
CapacitiveSensor   cs_2_4 = CapacitiveSensor(2, 4);       // 10M resistor between pins 2 & 4, pin 4 is sensor pin, add a wire and or foil
CapacitiveSensor   cs_2_5 = CapacitiveSensor(2, 5);       // 10M resistor between pins 2 & 5, pin 5 is sensor pin, add a wire and or foil
CapacitiveSensor   cs_2_6 = CapacitiveSensor(2, 6);       // 10M resistor between pins 2 & 6, pin 5 is sensor pin, add a wire and or foil

void setup() {
  // put your setup code here, to run once:

void loop()
  long start = millis();
  long total1 =  cs_2_3.capacitiveSensor(30);
  long total2 =  cs_2_4.capacitiveSensor(30);
  long total3 =  cs_2_5.capacitiveSensor(30);
  long total4 =  cs_2_6.capacitiveSensor(30);

  Serial.print(millis() - start);        // check on performance in milliseconds
  Serial.print("\t");                    // tab character for debug windown spacing

  Serial.print(total1);                  // print sensor output 1
  Serial.print(total2);                  // print sensor output 2
  Serial.println(total3);                // print sensor output 3

  delay(10);                             // arbitrary delay to limit data to serial port

  if (total1 >= 20) {
    tone(8, 440, 100);

  } else if (total2 >= 20) {
    tone(8, 500, 200);

  } else if ( total3 >= 20) {
    tone(8, 300, 100);

  } else if ( total4 >= 20) {
    tone(8, 100, 200);

  } else {


After finishing the coding part, I started to make paper butterflies by using paper cutting and carving. I drew the outlines of butterflies and cut them out, then I used knife to carve the details of it. As soon as I got the butterflies, I use different wires to connect those butterflies to the Arduino circuit. In the process of making it, I weld and wind those wires.  One thing important to notice is that we the material I used to connect butterflies and Arduino must to be conductive.


Finally, I have done! You can play with those butterflies and make your own butterfly songs!

Leave a Reply