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
bread board
wires
transistors
resistors
soldering iron and solder
RGB LED strip (non-addressable)
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

#define FADESPEED 5

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

if (readCapacitivePin(capSensePin) > touchedCutoff) {

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(readCapacitivePin(capSensePin));

Serial.println(trigger);

}

if (readCapacitivePin(capSensePin) >=250){ //sensitivity

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;

}

}

}

// readCapacitivePin

// 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.

uint8_t readCapacitivePin(int pinToMeasure){

// 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.

byte bitmask;

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

port = &PORTD;

ddr = &DDRD;

bitmask = 1 << pinToMeasure;

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

*port &= ~(bitmask);

*ddr |= bitmask;

delay(1);

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

*ddr &= ~(bitmask);

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

int cycles = 16000;

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

if (*pin & bitmask){

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.

*port &= ~(bitmask);

*ddr |= bitmask;

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.

Comments

author
lglira (author)2016-02-02

Great optical effect and nice design

author
Lopany (author)2015-12-16

Very good but I think that chris.antonopoulos.5 table was a little better executed and for that I vote for him

author
Mr grapple (author)2015-12-08

this is a project I really want to try it it looks amazing.

author
mrodz (author)Mr grapple2015-12-08

Thank you so much!

author
Mr grapple (author)mrodz2015-12-09

No problem I would keep it in my living room and when people come over they get a futuristic feeling

author
judy72649 (author)2015-12-08

Wouldn't it be easier to use an RGB LED strip light instead? Amazon & Ebay sell them for around $15.

author
itsmescotty (author)2015-12-08

I think infinity are 'neat' and this one is really nice. I've not gotten into Arduino or Pi but one day. . . Don't know if joy could incorporate it or not but there are, on eBay, $2-5 controllers that change color, speed and intensity of the led strips. If you could incorporate one of those into your table it would elevate it to awesom

author
mrodz (author)itsmescotty2015-12-08

It was for a class project and we were required to use an arduino. It is definitely possible to just buy a kit, but like I said, I had rules to follow for the project. Thanks for the suggestion. :)

author
itsmescotty (author)mrodz2015-12-08

Haven't programmed since I was a kid so I'm lost with Arduino and Pi. Totally understand parameters for a project. It's got me thinking and devising. Saw, online, how to DIY a mirror so might give it a try with convex and concave mirror and a flat two way mirror. Won't use Arduino since I don't know how but will use one of those $5 controllers. Used one of those controllers with rgb LEDs on an internally laser etched sculpture - turned out great, cycling thru different colors, intensities, and pulsations. Too bad the sculpture wasn't mine, sigh.

author
itsmescotty (author)2015-12-08

was this one string layer of lights? What would happen if you used two, side by side or one on top of the first. As in two (or more) rows side by side or stacked. I just might have to do some experimenting. I wonder if you could make a circular one with a concave (or convex) mirror(s) to make the illusion focus to a cone? I'm thinking. . .

author
mrodz (author)itsmescotty2015-12-08

I honestly have no clue. I found the infinity mirror concept on here and just kind of ran with it. Let me know if you figure it out... I'm sure it would be awesome!

author
anuj1993 (author)2015-12-06

looks amazing..want to try asap

author
mrodz (author)anuj19932015-12-07

Thanks! :)

author
ElJ4 (author)2015-12-06

Awesome idea! Thanks for sharing. It's a gotta-make-someday for me

author
mrodz (author)ElJ42015-12-07

Thank you! :)

author
DIY Hacks and How Tos (author)2015-12-05

This is awesome and I need to make this.

About This Instructable

30,744views

571favorites

License:

More by mrodz:Infinity mirror color changing touch table
Add instructable to: