## Introduction: Infinity Mirror Color Changing Touch Table

When I was given this assignment for my Interactive Design class, which involved the use of an Arduino uno, a combination of events led to the creation of my touch infinity mirror table. Searching through a variety of Instructables, while simultaneously renovating my childhood playroom for a holiday surprise for my mother, I created a table that was the perfect fit for my vision that would also complement the décor of the room. I used this table as a frame for my touch-capacitive infinity mirror because I wanted to create a piece of art that is both interactive and satisfying to the eye and mind of the observer.

Materials:

arduino uno
wires
transistors
resistors
soldering iron and solder
regular mirror
2-way mirror
aluminum frame
12 V power supply
jigsaw
sander with sand paper
drill
screws
wooden planks
electrical tape

## Step 1: Table, Mirrors, and Getting Started

I found a local glass shop that sold one-way and two-way mirrors and they assisted in cutting one of each to the size and specifications that I wanted for my table. (I created my own table, but any sturdy table will do for this project)

## Step 2: Measuring the Mirrors and Cutting the Table

I took the pre-cut mirrors and laid them on the table and measured out the desired space on the table that would eventually house the mirrors. I proceeded to drill holes in the four corners of the area that was to be cut prior to using a jigsaw to finish cutting out the hole. After cutting the table, I sanded down the edges of the newly hollowed-out area.

## Step 3: Under-the-table-framework

I created a framework out of a piece of wood that would be placed on the underside of the table in order to support the future mirror inserts.

## Step 4: Code, Changing Colors, and Touch Capacitive

I used a non-addressable LED strip for my table.

With the help of my teacher and TA, I was able to combine a few different resources to make a code that worked specifically for my table's needs.

CODE

// Pin for the LED

int LEDPin = 13;

int trigger = 0;

int r, g, b;

// Pin to connect to your drawing

int capSensePin = 2;

// This is how high the sensor needs to read in order

// to trigger a touch. You'll find this number

// by trial and error, or you could take readings at

// the start of the program to dynamically calculate this.

int touchedCutoff = 20;

#define REDPIN 5

#define GREENPIN 6

#define BLUEPIN 3

void setup(){

Serial.begin(9600);

// Set up the LED

pinMode(LEDPin, OUTPUT);

digitalWrite(LEDPin, LOW);

pinMode(REDPIN, OUTPUT);

pinMode(GREENPIN, OUTPUT);

pinMode(BLUEPIN, OUTPUT);

}

void loop(){

// If the capacitive sensor reads above a certain threshold,

// turn on the LED

digitalWrite(LEDPin, HIGH);

}

else {

digitalWrite(LEDPin, LOW);

}

// Every 500 ms, print the value of the capacitive sensor

if ( (millis() % 500) == 0){

Serial.print("Capacitive Sensor on Pin 2 reads: ");

Serial.println(trigger);

}

trigger++;

if (trigger >5){

trigger =0;

}

switch(trigger){ //these are the lighting schemes

case 0:

digitalWrite(REDPIN,255);

digitalWrite(GREENPIN,255);

digitalWrite(BLUEPIN,255);

break;

case 1:

digitalWrite(REDPIN,0);

digitalWrite(GREENPIN,255);

digitalWrite(BLUEPIN,0);

break;

case 2:

digitalWrite(REDPIN,0);

digitalWrite(GREENPIN,255);

digitalWrite(BLUEPIN,255);

break;

case 3:

digitalWrite(REDPIN,255);

digitalWrite(GREENPIN,0);

digitalWrite(BLUEPIN,255);

break;

case 4:

digitalWrite(REDPIN,0);

digitalWrite(GREENPIN,0);

digitalWrite(BLUEPIN,0);

break;

}

}

}

// Input: Arduino pin number

// Output: A number, from 0 to 17 expressing

// how much capacitance is on the pin

// When you touch the pin, or whatever you have

// attached to it, the number will get higher

// In order for this to work now,

// The pin should have a 1+Megaohm resistor pulling

// it up to +5v.

// This is how you declare a variable which

// will hold the PORT, PIN, and DDR registers

// on an AVR

volatile uint8_t* port;

volatile uint8_t* ddr;

volatile uint8_t* pin;

// Here we translate the input pin number from

// Arduino pin number to the AVR PORT, PIN, DDR,

// and which bit of those registers we care about.

if ((pinToMeasure >= 0) && (pinToMeasure <= 7)){

port = &PORTD;

ddr = &DDRD;

pin = &PIND;

}

if ((pinToMeasure > 7) && (pinToMeasure <= 13)){

port = &PORTB;

ddr = &DDRB;

bitmask = 1 << (pinToMeasure - 8);

pin = &PINB;

}

if ((pinToMeasure > 13) && (pinToMeasure <= 19)){

port = &PORTC;

ddr = &DDRC;

bitmask = 1 << (pinToMeasure - 13);

pin = &PINC;

}

// Discharge the pin first by setting it low and output

delay(1);

// Make the pin an input WITHOUT the internal pull-up on

// Now see how long the pin to get pulled up

int cycles = 16000;

for(int i = 0; i < cycles; i++){

cycles = i;

break;

}

}

// Discharge the pin again by setting it low and output

// It's important to leave the pins low if you want to

// be able to touch more than 1 sensor at a time - if

// the sensor is left pulled high, when you touch

// two sensors, your body will transfer the charge between

// sensors.

return cycles;

}

## Step 5: Framing the Mirror

I took the two-way mirror portion of my infinity mirror to a custom frame shop to get an aluminum frame. (The mirror is facing down in the frame, with the “see-through” side facing up)

## Step 6: Putting It All Together

Using the remaining half-inch of the frame under the mirror, I wrapped a strip of LED lights around the inner perimeter of the mirror, leaving space for the connecting wires to stick out to connect to my arduino uno.

I placed the one-way mirror portion of the infinity mirror facing upwards in the table, then I placed the framed two-way mirror portion with the attached LED strip on top of the one-way mirror in the hole in the table, making sure that the wires used to connect the mirrors to the arduino uno stuck out on the underside of the table and out of plain sight.

## Step 7: Finishing Up

I secured the protoboard and ardunio to the underside of the table, then I connected the wires from the LED strip to the Arduino and soldered the wire of the Arduino to the aluminum frame underneath in order to make it touch-capacitive.

I connected a plugged-in 12-V power source to the ardunio, and was able to change the color of the lights within the infinity mirror by touching the frame.

### Attachments

Second Prize in the
Furniture Hacks Contest

Participated in the
Make It Glow! Contest

Participated in the
Tech Contest