Introduction: Paper Electronics: Make Interactive, Musical Artwork With Conductive Ink

If you've ever wanted to bring a piece of paper to life, now is your chance. This instructable will take you through all the necessary steps to create an amazing interactive flyer or artwork. This event flyer is no ordinary piece of print. It is printed using Bare Conductive ink. This means that when it is brought along to the event it can be plugged in and transformed into a musical instrument!

The large printed circle acts as a distance sensor allowing you to control the pitch of the audio while the three printed circles along the bottom act as buttons allowing you to control the frequency.

This instructable will show you not only how to create the flyer with conductive ink, but also how to create the hardware and cable. 

Below is a video of it in  action (this is also going through some fun audio effects on stage)...


Step 1: Create the Flyer

Before you go crazy with your conductive ink, there are a few constraints to your artwork.

1. There must be four separate sections of conductive ink. One acts as a distance sensor and will eventually control the pitch of the audio. This part of the artwork should ideally be as large as possible as the larger it is, the more sensitivity the sensor will have. The other three sections  will act as buttons that will allow us to control the frequency of the audio and don't need to be as large. It is important that none of these sections touch each other.

2. The four sections should have traces (a painted/printed line no thinner than 1mm) taking them to the edge of the paper terminating in a 5mm x 5mm square of ink. These squares of ink should be side by side with a 5mm gap in-between. This is clearly shown in the image of my print on the bottom right hand corner. This print was A5 in size.

When it comes to creating your artwork it doesn't really matter how you do it, but the two easiest ways are to either paint by hand or to screen print. Screen printing means that not only do you get a high quality print, but you can print as many as you like easily.

Painting is easy, just remember to follow the constraints above.

Screen printing with Bare Conductive is a little trickier as it tends to dry quickly in the screen. To get around this I found it best to dilute Bare Conductive with roughly 1 part water 10 parts Bare Conductive. This makes the whole process a hell of a lot less stressful. When it comes to selecting a good screen for the ink, I recommend using a textiles screen with a mesh of around 90t.


Step 2: Create the Electronics

The hardware and the Arduino code for this project have been developed from the wonderful Proximity Sensor tutorial from Bare Conductive:

http://www.bareconductive.com/capacitance-sensor

The hardware required for this project consists of:
1x Arduino
4x 1 mega Ohm resistors
2x LED (not necessary)
1x male 4-way jack
1x female 4-way jack socket
1x speaker
A selection of jumper cables

This is a relatively easy circuit to create. To begin with we need to connect a 1 mega ohm resistor between 4 pairs of outputs on the Arduino; these pairs are 2 and 4, 5 and 6, 8 and 9, 10 and 11. We now take a wire from pins 4,6,9 and 11, these are our sensor inputs. Pin 4 will eventually go to our distance sensing painted area, and pins 6,9 and 11 will go to the painted buttons. At this stage we want to connect these 4 sensor cables to the 4-way female jack socket.

The Audio output will come from pin 7. This means we need to wire in a speaker or headphone socket between pin 7 and ground on the Arduino.

I decided it would be nice to have some LEDs on the device to allow you to see what was going on. I wired up a 'power on'  LED between 3.3V and ground on the Arduino and a 'Frequency Indicator' between pin 13 and ground on the Arduino.

The Arduino is powered via the Vin socket on the board. I decided to wire in a toggle switch in here to make it nice and easy to turn it on and off.

That was easy, wasn't it? Now for the code...

Plug your Arduino into your computer and download the following code. This code requires the CapSense library, so if you don't have it, head over to the Arduino site and download it there.

For the sake  of testing and calibrating it is worth just crocodile clipping your four sensor cables to your four conductive painted/printed areas.

This is where it all gets a bit unpredictable... As everyone is going to be painting or printing different sizes of Bare Conductive touch points with different thicknesses of ink, a spot of calibration is needed. Hopefully it is just the distance sensor that will need calibrated. That should be pretty easy to do by playing about with the total2 value in the code (you should see the values coming from the sensor in the serial monitor). If that doesn't work for you you may need to try other values of resistor. I'm afraid this step is a bit trial and error.



Arduino Code:

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <CapSense.h>



CapSense   cs_2_4 = CapSense(2,4);         // 1 megohm resistor between pins 4 & 2, pin 2 is  distance sensor pin, add Bare Paint
CapSense   cs_5_6 = CapSense(5,6);         // 1 megohm resistor between pins 6 & 5, pin 5 is sensor pin, add Bare Paint
CapSense   cs_8_9 = CapSense(8,9);         // 1 megohm resistor between pins 9 & 8, pin 8 is sensor pin, add Bare Paint
CapSense   cs_10_11 = CapSense(10,11);     // 1 megohm resistor between pins 11 & 10, pin 10 is sensor pin, add Bare Paint
const int ledPin = 12;
const int ledPin2 = 13;

int duration;


void setup()                
{
   cs_2_4.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an example  
      cs_5_6.set_CS_AutocaL_Millis(0xFFFFFFFF);
   cs_8_9.set_CS_AutocaL_Millis(0xFFFFFFFF);
   cs_10_11.set_CS_AutocaL_Millis(0xFFFFFFFF);
   Serial.begin(9600);
       pinMode(13, OUTPUT);
    pinMode(12, OUTPUT);
}

void loop()                   

{   

long start = millis();   
long total1 =  cs_2_4.capSense(30);  
long total2 = total1 - 100;  //callibration for pad...

long totalA =  cs_5_6.capSense(30);
long totalB =  cs_8_9.capSense(30);
long totalC =  cs_10_11.capSense(30);

Serial.println(total2);                                  


{
if (total2 < 150){        //Start generating different tones for different distances. This will need callibrating by altering the value of total2
   noTone(7);
}
  if  (total2 > 150 and total2 < 200){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,131,5000);
delay(duration);
noTone(7);
digitalWrite(ledPin2, LOW);
delay(duration);
}

   if  (total2 > 250 and total2 < 300){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,147,5000);
delay(duration);
noTone(7);
digitalWrite(ledPin2, LOW);
delay(duration);
}
   if  (total2 > 350 and total2 < 400){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,165,5000);
delay(duration);
noTone(7);
digitalWrite(ledPin2, LOW);
delay(duration);
}
   if  (total2 > 400 and total2 < 450){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,175,5000);
delay(duration);
noTone(7);
digitalWrite(ledPin2, LOW);
delay(duration);
}
   if  (total2 > 450 and total2 < 500){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,196,5000);
delay(duration);
noTone(7);
digitalWrite(ledPin2, LOW);
delay(duration);
}
   if  (total2 > 500 and total2 < 550){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,220,5000);
delay(duration);
noTone(7);
delay(duration);
}
   if  (total2 > 550 and total2 < 600){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,247,5000);
delay(duration);
noTone(7);
digitalWrite(ledPin2, LOW);
delay(duration);
}
   if  (total2 > 600 ){
   //turn LED on
      digitalWrite(ledPin2, HIGH);
tone(7,262,5000);
delay(duration);
noTone(7);
digitalWrite(ledPin2, LOW);
delay(duration);

}

}

if (totalA > 800){              //if input one is pressed change duration between tones
   //turn LED on
   digitalWrite(ledPin2, HIGH);
   duration = 500;
   Serial.println("500 delay");

if  (totalB > 800){             //if input two is pressed change duration between tones
   //turn LED on
   digitalWrite(ledPin2, HIGH);
   duration = 100;
   Serial.println("100 delay");

}
if  (totalC > 800){             //if input three is pressed change duration between tones
   //turn LED on
   digitalWrite(ledPin2, HIGH);
   duration = 25;
   Serial.println("25 delay");

}

  else {
   //turn LED off
   digitalWrite(ledPin2, LOW);
}

                                        // arbitrary delay to limit data to serial port
}

char getcap(char pin)
{
char i = 0;
DDRB &= ~pin;          // input
PORTB |= pin;          // pullup on
for(i = 0; i < 16; i++)
   if( (PINB & pin) ) break;
PORTB &= ~pin;         // low level
DDRB |= pin;           // discharge
return i;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Step 3: Create the Electroincs Housing

To house the electronics I decided to create a box that references old fashioned audio and DJ equipment. You can make it whatever you want, or even not bother with it at all. 

This box was created by laser cutting white acrylic. The acrylic was then bent using a heat gun, spray painted black and details etched using the laser cutter. The sides of the box were made from a nice cherry wood I had lying around. The LEDs, female socket, toggle switch, power socket and audio out sockets were all then mounted on the acrylic body.

Step 4: Create the Connector

A special connector was made in order to ensure a good connection to the paper for all four sensors. 

Materials needed:
1x 40mm wide bulldog clip
4-core cable
2x 10mm x 40mm x 3mm acrylic
1x 10mm x 40mm copper board

This connector is a hacked bull-dog clip. To begin with we need to drill a hole in the back of the bulldog clip to allow the cable to feed in. The 2 small peices of acrylic are superglued inside the bulldog clip, one to each side (this reduces the agression of the clamp). Now score three lines down the copper board to create four separate copper squares. Strip the end of the cable that was threaded through the bulldog clip to expose the copper on all four of its cables. Carefully solder each one of these cables to the separate sections on the copper board. Try to solder them as close to the edge as possible, being careful to keep a low profile solder joint. At this point it is important to make sure the correct sensor cable is connected to the section of copper board that will eventually connect with your conductive ink touch points. You will be able to figure out which sensor cables go where when you look at your wiring on the Arduino end. 


Now we want to carefully glue the wired up copper board onto the inside of the acrylic lined bulldog clip so that the copper is facing into the bite of the bulldog.

At the other end of the cable we can now wire in the 4-way male jack.

Step 5: Plug in and Play

Plug it all together and make some noise! 

Enjoy!

Pocket Sized Electronics

First Prize in the
Pocket Sized Electronics

DIY Soundhack Contest

First Prize in the
DIY Soundhack Contest