Magic mir­ror

Yes, your mir­ror can talk back to you — we show you how

The Shed - - Contents - By En­rico Miglino Pho­to­graphs: En­rico Miglino

Through the cen­turies, mir­rors have fas­ci­nated hu­mans, play­ing an im­por­tant role in many an­cient myths. From Nar­cis­sus to Snow White, mir­rors in the his­tory of hu­man­ity have fre­quently had a pri­mary role. In this is­sue, we will see how to create a per­son­al­ized ‘magic mir­ror’, with the help of the 21st-cen­tury tech­nol­ogy.

How magic mir­rors work

A ‘one-way mir­ror’, also called a ‘twoway mir­ror’ (or ‘two-way glass’, ‘half­sil­vered mir­ror’, or ‘semi-trans­par­ent mir­ror’) is a re­cip­ro­cal mir­ror that is par­tially re­flec­tive and par­tially trans­par­ent. The per­cep­tion of oneway trans­mis­sion is achieved when one side of the mir­ror is brightly lit and the other side is dark. This al­lows

view­ing from the dark­ened side, but not vice versa (­ror).

Magic mir­rors use semi-trans­par­ent mir­ror plates that make it pos­si­ble to see some­thing ly­ing on the back of the re­flect­ing side, to­gether with the re­flec­tion of the front scene. The ‘magic’ ef­fect is achieved by show­ing text, graph­ics, light ef­fects on a screen, videos, etc. The best ef­fect is achieved when the en­tire back side and screen are black, thus avoid­ing vi­su­al­iza­tion of the bor­ders.

The idea is to put a screen on the back side of the one-way mir­ror show­ing a black back­ground. A mi­cro­con­troller, em­bed­ded com­puter, desk­top, or lap­top con­nected to the screen can show any kind of in­for­ma­tion, in­clud­ing in­ter­ac­tive fea­tures with the user through ges­tures or sen­sors.

A magic mir­ror based on a sim­ple mi­cro­con­troller like Ar­duino pro­vides fewer fea­tures than a com­puter-based one, but the light-only ef­fects are very sug­ges­tive.

Ma­te­ri­als and hard­ware

The frame: To make the pro­to­type shown in this ar­ti­cle, I built a wooden cus­tom frame. You can make your own frame, or use an old mir­ror or paint­ing frame, tak­ing into ac­count some nec­es­sary re­quire­ments of the con­struc­tion.

The back side of the mir­ror will host a screen and some elec­tron­ics, so it is prefer­able to use a box frame to in­clude all the com­po­nents in the back­side, then close the back with a cover to keep ev­ery­thing neat, tidy, and hid­den away.

The ‘magic’ ef­fect is achieved by show­ing text, graph­ics, light ef­fects on a screen, videos, etc.

Two-way mir­ror: The size of the mir­ror de­pends on your screen size (I used an old 15-inch HDMI) and the size of the mir­ror plate. Due to the grow­ing in­ter­est in build­ing magic mir­rors, these prod­ucts are very easy to buy on­line.

Two-way mir­rors can be found in New Zealand from Sign Sup­plies (sign­sup­, (nz.­ror-win­dow­film-new-zealand.html), and Elite Win­dow Films (elite­ Types/Pri­vacy.html); in Aus­tralia from GlassKote (; and from the US, ship­ping world­wide, from Two Way Mir­rors (twowaymir­, where I bought the one shown in this ar­ti­cle pro­to­type.

Magic mir­rors are acrylic plates 1–2mm thick, with a spe­cial re­flect­ing sur­face treat­ment that is not dif­fi­cult to cut to the de­sired size.

Hard­ware: The core of the magic mir­ror is a Rasp­berry PI 3B+, the

most re­cent model, dis­trib­uted world­wide by Far­nell/Ne­wark (ex­port. far­­berry-pi?rd= rasp­berry+PI+3B%2B&krypto=gWYQ 3r8nopVXPcEVr3nL/T9lBNXarh Lxv5ZdlPsKXDpJrHFT/9LVIL4ZAqzOv 0/viusOND­ta15cpqOw5cTX1xd­jRcpr Qcyvob7QVqUXd5tA=). Less re­cent mod­els of Rasp­berry PI can be used as well, but the B+ of­fers bet­ter per­for­mance and fea­tures, in­clud­ing on­board WiFi, an Eth­er­net con­nec­tion, and Blue­tooth 4.2.

Ex­tra hard­ware ac­ces­sories: To build my pro­to­type, I also in­cluded a pas­sive in­frared sen­sor (PIR) mo­tion sen­sor, a cou­ple of au­dio speak­ers with a USB-pow­ered au­dio am­pli­fier, and a PL cam­era.

The PIR sen­sor is used to ac­ti­vate the magic mir­ror ef­fects when a mov­ing sub­ject is near the de­vice.

To build small-sized magic mir­rors, the Rasp­berry Pl seven-inch touch­screen can fit per­fectly; for larger mir­rors, an HDMI screen can be con­nected to the Rasp­berry PI HDMI out­put. When us­ing an ex­ter­nal HDMI screen, a sec­ond power sup­ply should be pro­vided for the screen, to­gether with the PI power sup­ply. If you use an ex­ter­nal screen, it of­fers the ad­van­tage that the size of the magic mir­ror is in­de­pen­dent from the small form fac­tor of the con­trol unit.

Build­ing the magic mir­ror

To ob­tain the best re­flec­tion ef­fect from the semi-trans­par­ent mir­ror plate, its back should be black. The only vis­i­ble el­e­ments from the back side should be the graphic el­e­ments shown on the screen.

Around the HDMI dis­play, I cre­ated a mask to cover the en­tire sur­face

The core of the magic mir­ror is a Rasp­berry PI 3B+

of the mir­ror us­ing a sheet of light, black card­board (250g/mq). A sec­ond card­board layer (3mm thick) keeps the HDMI screen cen­tred on the back of the mir­ror frame.

I used an old HDMI 15-inch screen. Keep­ing the screen cen­tred, I left space on the top side to in­stall the Rasp­berry PI and the two power sup­plies on the bot­tom. The mask and the mir­ror plate have been pressed against the bor­der of the frame with four 3D-printed L-shaped sup­ports, and four sup­ports at ev­ery cor­ner. The back of the as­sem­bled mir­ror has been cov­ered with a 3mm thick ply­wood sheet.

When hang­ing the boxed mir­ror, you should al­low at least a 1cm gap from the wall to avoid ex­ces­sive heat­ing.

Sys­tem set-up

My re­search on the in­ter­net re­vealed plenty of magic-mir­ror projects us­ing dif­fer­ent plat­forms, as well as sev­eral soft­ware so­lu­tions. Thanks to its wide range of hard­ware con­fig­u­ra­tions and pe­riph­er­als, to­gether with the soft­ware pos­si­bil­i­ties, I be­lieve that Rasp­berry

The back side of the mir­ror will host a screen and some elec­tron­ics

PI is one of the bet­ter so­lu­tions for build­ing this kind of de­vice.

In­stalling the Linux oper­at­ing sys­tem

First of all, in­stall the oper­at­ing sys­tem on the Rasp­berry PI. Cur­rently the lat­est up­dated ver­sion is Rasp­bian Stretch. Down­load and set-up in­struc­tions can be found on the of­fi­cial rasp­ber­ site (rasp­ber­­loads/ rasp­bian/). Be sure to down­load the desk­top im­age of the oper­at­ing sys­tem. I strongly rec­om­mend in­stalling the oper­at­ing sys­tem im­age on a mi­croSD card of at least 8GB, or ide­ally 16GB.

Pre­par­ing the sys­tem

Two op­tions are avail­able to eas­ily in­stall and con­fig­ure the Rasp­berry Pl. The first one is con­nect­ing a mouse, key­board, and HDMI mon­i­tor to the Pl. The sec­ond one is ac­cess­ing the Rasp­berry PI re­motely from a PC us­ing Vir­tual Net­work Com­put­ing (VNC). More de­tails on VNC can be found on the of­fi­cial VNC site (re­

The Rasp­berry PI Stretch oper­at­ing sys­tem in­cludes a VNC server that

can be ac­ti­vated, while a VNC client is avail­able for any plat­form (Win­dows, Mac, Linux, Rasp­berry PI) free to down­load. The set-up and configuration process re­quires the Rasp­berry PI to be con­nected to the in­ter­net.

The com­mand ‘raspi-con­fig’ en­ables the pe­riph­er­als (e.g., the PL cam­era). More de­tails on the Rasp­berry PI configuration and set-up can be found on the of­fi­cial rasp­ber­ site.

Mag­icMir­ror soft­ware

Thanks to the ef­forts of MichMich (michael­, the Mag­icMir­ror soft­ware frame­work is avail­able as open source (MIT Li­cense) for the Rasp­berry PI. The Mag­icMir­ror plat­form (­icMir­ror) is the base of a mod­u­lar sys­tem en­cour­ag­ing third-party con­tri­bu­tions. The ac­tual ver­sion Mag­icMir­ror2 is very well doc­u­mented, stable, and easy to in­stall. It has be­come very pop­u­lar over the past cou­ple of years, at­tract­ing many open-source de­vel­op­ers who have cre­ated a large num­ber of cus­tom mod­ules, which are easy to in­stall on the stan­dard plat­form.

The up­dated full list of Mag­icMir­ror mod­ules is avail­able on the main Mag­icMir­ror repos­i­tory on GitHub, in­clud­ing a tem­plate to create new mod­ules.

The Mag­icMir­ror plat­form is an ecosys­tem with hun­dreds of op­tions. Be­fore in­stalling the plat­form, you will need to up­date — or in­stall if not al­ready present — Python and the npm repos­i­tory man­ager.

Thanks to the ef­forts of MichMich (michael­, the Mag­icMir­ror soft­ware frame­work is avail­able as open source (MIT Li­cense) for the Rasp­berry PI

The rear of the magic mir­ror wooden box frame. The first layer is the oneway mir­ror ready for assem­bly

The Rasp­berry PI and the 3D-printed fix­ing com­po­nents

The HDMI dis­play be­fore at­tach­ment to the magic mir­ror. The case of the dis­play has been com­pletely re­moved and the con­trol board has been fixed on the back of the screen

The Rasp­berry PI is fixed to the back of the magic mir­ror frame (top) us­ing a 3D-printed VESA sup­port, usu­ally used to fix the PI to the back of a mon­i­tor

Rasp­berry PI 3B+ Be­low: The black frame and the card­board sup­port frames. The two frames will be used to keep the mir­ror back­ground to­tally black and the screen in po­si­tion

Be­low: The screen fixed in the sup­port mask. In this pro­to­type, I de­cided to fix the screen in the mid­dle of the mir­ror

Be­low: The black frame mask­ing the back of the mir­ror

The back of the mir­ror with the screen in place ready to be po­si­tioned

Be­low: De­tail of the 3D-printed L-shaped sup­ports to keep the mir­ror back­ground — masks and screen — pressed firmly to the back of the two-way mir­ror

Above: The VESA mount and the Rasp­berry PI in place

Left: The back view of the magic mir­ror as­sem­bled. All the com­po­nents are fixed in­side the wooden box frame

Be­low: The com­pleted magic mir­ror re­flect­ing the hand­some writer shoot­ing

Left: De­tail of the back cover of the magic mir­ror with the holes for aer­a­tion of the Rasp­berry PI

Be­low: The screen con­trols — bright­ness and con­trast — fixed out­side the back cover of the magic mir­ror

Some screen­shots of the Rasp­berry PI run­ning the Mag­icMir­ror ap­pli­ca­tion with dif­fer­ent con­fig­u­ra­tions. The enor­mous va­ri­ety of avail­able op­tions makes the Mag­icMir­ror mod­ule an ad­vanced plat­form able to sup­port a lot of cus­tom con­fig­u­ra­tions. In ad­di­tion, a de­vel­oper tem­plate is also avail­able from the Mag­icMir­ror GitHub repos­i­tory (github. com/MichMich/Mag­icMir­ror). Us­ing the base tem­plate (in­clud­ing a run­ning ex­am­ple) it is pos­si­ble to de­velop any kind of cus­tom Mag­icMir­ror mod­ules

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.