Blog - Sketching with Hardware

Man in the Mirror – (Mind) bending Infinity Mirror

Published on: | Author: Daniel Seliger | Categories: 2017b, Best Projects, Projects

The Idea

After the topic was announced (“Something old, something new, …”) we tried to come up with old things. Since an old telephone had already been picked by another group we initially planned to modify an old typewriter. But the neatest idea we had was to make it type on its own, which, despite beeing a lot of work, would have been pretty obvious and has been done before. So we decided to build something simple. A mirror is old. An infinity mirror is old. A smart mirror is old. But we haven’t seen a (mind) bending smart infinity mirror before.

The Concept

The concept of an infinity mirror is rather old. One mirror in the back, a partly translucent mirror in the front, a LED stripe in between and voilà – infinity mirror illusion. When we tilt one mirror, the “infinity tunnel” bends. And finally, one thing I always wanted to know: “Is it possible to inject light from behind the rear mirror?” – It is!

infinity_mirrorinfinity_mirror_bentinfinity_mirror_rear_injection

 

Parts list

  • 2x Ikea RIBBA picture frame
  • Privacy window film, at least 23cm by 46cm
  • Patentband
  • 3x Mirror Clips
  • 3x M4 countersunk bolt + nut
  • 3x ball pen spring
  • paper clips
  • heat-shrinking tubing
  • sealing tape + double-sided adhesive
  • Arduino Mega
  • 3x Servo
  • WS2812b LED stripe (60LEDs/m), 196 LEDs
  • 5V power supply, capable to provide at least 15A

 

Building the front frame

The IKEA RIBBA picture frame is a perfect fit for this project. It is cheap and one can fit exactly 52 LEDs (WS2812b, 60LEDs/m) inside the inner frame. We used two RIBBAs for our project because we needed two glass panes and two outer frames. Since the original inner frame was too deep, we laser-cut a new frame that is as deep as the LED stripe is wide and glued the LED stripe to it. We left a small hole in one corner to route the cables through. In most infinity mirrors, the rear mirror is a real mirror (i.e., 100% reflective), but since we wanted to inject light from behind the rear mirror, we applied “privacy window film” (~20% translucent) to both glass panes, which surprisingly didn’t effect the illusion at all. Make sure you secure the front mirror and LED frame in place somehow (we used Scotch Blue). Otherwise, they will be sucked in when the rear mirror moves because there is only little room for air to flow in the gap between the glass panes.
If we sandwich the inner LED frame in between the glass panes, we already have an infinity mirror.

Tilting the mirror

To achieve the “bending” effect, we had to find a way to tilt the rear mirror. Enter: servos!
Using “Patentband”, we mounted 3 servos to the front frame. If you intend to build our project, this would be a perfect application for 3D printed parts, but due to the limited time we went the “quick and dirty” way.

Now comes the most difficult part: How do you attach a servo lever to a glass pane?
After numerous tries with duct tape and copper wire, we finally had an idea that solved multiple problems: mirror clips.
First, it reduced the friction between the glass and the outer frame. Second, we had something to attach a bolt to. And, last but not least, using a countersunk bolt, we had the free play that we needed because of the non-linear movement of the servo.
Using sealing tape and double-sided adhesive, we attached the mirror clips to the rear mirror.
Since the bolt now had too much free play perpendicular to the glass pane, which resulted in different positions depending on whether the bolt was pushed or pulled, we added springs from Kärcher ball pens to hold the bolt in place (other brands may work, but haven’t been tested).

This way, we reduced the problem to: How do you attach a servo lever to a bolt (and nut)?
First solution: yarn. Does work, but rips apart.
Second solution: copper wire. Does work, but bends and gets loose.
Final solution: paper clips and heat-shrinking tubing.

servo_mount_yarnservo_mountservo_mount_clipservos_mounted

 

Make it smart

Unfortunately, we didn’t have a display available that had the right dimensions and was bright enough to be seen through two layers of privacy window film. But we did have 144 LEDs left, so we quickly built a 12 by 12 LED matrix on the RIBBA’s back plate.

matrix_beforematrix_after

To be honest, a smart infinity mirror is not the smartest idea because text is hardly readable due to the many reflections.

 

 

Putting it together

With the LED matrix in the rear frame, we attached the two frames back to back with duct tape. To give it an antique look, we added a golden stucco frame to the front. The whole assembly sits on a third RIBBA frame, just because we had another one lying around.

assembled stucco_frame

 

Wiring it up

The wiring is pretty straight forward, but you have to take into account that the LEDs draw a lot of current. We used an ATX power supply that is able to provide 20A on the 5V rail.
We also added a joystick that can be used to control the tilt.

infinity_mirror_bb

 

Uno, Due, Mega…
You might be wondering why we used an Arduino Mega although we only needed 5 PWM outputs and 2 analog inputs. This is due to hardware restrictions of the ATmega328P/ATmega168 which are used in most Arduino boards, including Uno, Duemilanove, Diecimila, etc. Both the Adafruit_NeoPixel library and the Servo library require precise timing. To achieve this, the Adafruit_NeoPixel library disables all interrupts when sending data to the WS2812b LEDs. The Servo library on the other hand uses interrupts. This results in unpredictable shaking of the servos every time the NeoPixel library disables interrupts. There are different ways to work around this issue, but the easiest (and cheapest) is using the Adafruit_TiCoServo library, which has the same features as the original Servo library but doesn’t use interrupts for timing. However, due to how it works, only specific pins can be used for servos. On the Uno (and all other ATmega328P/ATmega168 boards) there are only 2 pins that can be used. Since we needed 3 servos, there were 2 alternatives: Mega or Micro. Although the Micro would have been a much better choice, we unfortunately didn’t have one, so we went with the Mega.

 

Code, calibration and final thoughts

So you have assembled your first (mind) bending smart infinity mirror.
Great!
Now disassemble it!

The servos are controlled by specifying an absolute angle, so the servo levers have to be mounted correctly. In our sample code, all servos are in the home position at 90°. The home position is when the rear mirror is in the frontmost position, i.e. touching the inner LED frame. Keep in mind that one servo rotates in the other direction, in our case SERVO_2, which is the bottom right servo looking at the back of the front frame.
Detach the servo levers, move all servos to 90° and attach the levers such that the rear mirror touches the inner frame.

Additionally, both the original and the Adafruit_TiCoServo library drive the servos to some angle when they are attached in code. You’ll have to modify the library to not do that, otherwise the servos might break the mirror. Simply go to your Arduino library folder and open the Adafruit_TiCoServo.cpp inside the Adafruit_TiCoServo folder. Comment out (add // at the beginning of the line) every line that ends with “= (minPulse + maxPulse) / 2;”.

You can download our sample code here.

Feel free to add your own effects, or maybe even code a game?


Result

Of course, the mirror is best viewed in darkness:

 

 

linked categories 2017b, Best Projects, Projects

|

Write a comment

Comment