Smart Mirror0


How I build a Smart Mirror and why this result could be better.
Honeyport | 2016 Smart Mirror

One of the most popular it-projects in the last two years was mainly the Smart Mirror: A mirror that can show the weather next to the time. But since you can’t buy such a thing nowhere, you have to build it yourself, if you want such a promising device to call your own. The supposedly first Smart Mirror was from Michael Teeuw. His “Magic Mirror” (available at GitHub) formed the basis of pretty much all other mirror projects that can be found on the Internet. The original idea was brilliant, but the execution quite expensive, complex and clunky.

First Max Braun, an engineer at Google, shows some new ways to achieve a cooler result. Unlike Teeuw, Braun backed only a small part of his Smart Mirror with a display. In this way, Braun scored a larger mirror for less money, which was also cleaner and more beautiful. If you accept a smaller display content and use the appropriate hardware, you can get a much sleeker Smart Mirror than the version of Teeuw.

Smart Mirror Full Front

Therefore, I have taken the innovations of Braun and conjured with a few components and without much manual work a respectable result. I’m not using the code of Teeuw, because I wanted to realize my own ideas.

My mirror shows the following information:

  • time and date
  • current weather, weather forecast and rain probability
  • temperature of indoor and outdoor
  • calendar and birthdays
  • the next matches of my soccer club in the Bundesliga
  • delay of the next train in minutes
  • daily number of posts in a blog that I follow

The principle is for all Smart Mirrors the same: a screen is placed behind a two-way mirror. This kind of mirror is partially reflective and partially transparent. If the screen shows white text on a black ground, everything you can see from behind the mirror is the white font. Usually, a browser (in kiosk mode) hosted on a microcomputer shows a web page with the wanted information.

Smart Mirror Front closer

Raspberry Pi Zero and hardware from China

Like Braun, I also used the LCD Controller board from China for the technical realization. On this board, you can connect a LCD panel via a LVDS port and receives various video outputs. Brauns mirror construction was so thin that it could fit in the door of a bathroom cabinet. This worked, because he simply moved the rest of the hardware to the interior of the cabinet. Because the technique in my Smart Mirror should be fully integrated into the mirror itself, the necessary depth of the frame is determined by the highest part (the LCD controller board) plus the thickness of the two way mirror. In my case, it all fits in a frame from Ikea.

Finding a two-way mirror on the internet was the most difficult task. The results were very expensive. However, I found myself a two-way mirror in at a local glazier for only €42.50.

Smart Mirror Calendar with weather forecast

In my case, the browser and the website are hosted on a Raspberry Pi Zero. The smaller version of the Raspberry Pi, which is currently difficult to obtain, appears like made for this task because the Pi is extremely compact and lightweight but still possesses all the necessary connections. Who currently receives no PI Zero can also use the conventional Raspberry Pi. The mini computer can be powered via the USB port of the LCD controller board. This makes a second cable for the power supply unnecessary. The Pi is connected to the network via a wifi dongle.

For the display panel, I looked for a possible bright and large notebook screen with a 40 pin LVDS port in FULL HD resolution. On Ebay, I was able to purchase the model N173HGE-L21 (17.2 inch, 300 cd / m², 1920 (RGB) × 1080, FHD) for little money (~ €15). In order that the mirror can show the room temperature, I have also connected a temperature sensor to the Pi Zero. At this point, a little soldering was necessary. At last, everything just needed to wired and supplied on die picture frame.

Here is the list of materials I used:

  • IKEA RIBBA Frame black (50x70cm)
  • two way mirror
  • LCD controller board
  • LCD Panel N173HGE-L21
  • Raspberry PI Zero
  • Temperature sensor DS18B20 and resistance (4.7 ohms)
  • Wifi stick
  • MiniHDMI-to-HDMI cable
  • Micro USB to USB cable (for power supply)
  • Micro USB to USB adapter
  • PSU

Turn on the Smart Mirror with an infrared remote control

The controller board comes with a service bar with various buttons. This should also implement in the mirror to be able to turn the screen on and off. In addition, the board can also be controlled by a supplied remote control. Because infrared rays can pass through the two-way mirror without any problems, you can hide the infrared sensor perfectly behind the mirror glass. With these components, I have been able to realize my Smart Mirror for about €140.

Smart Mirror back

React.js and various APIs

The individual information that are displayed on the mirror come from a variety of sources. Date, time and room temperature provides the Pi itself. Since I have no weather station in the yard, I fetch the information from a weather station in the near. The corresponding API provides wunderground.com. The football information were submitted by openligadb.de. All other interfaces had to be implemented by myself.
Surprisingly, the German railway company Deutsche Bahn doesn’t provide any APIs. Fortunately, the URL for a simple (but not for a complex) search for driving times looking identical, so I only needed to update the time information in the URL and parse the returned HTML for the information of departure time and delay. For my calendar server I have also created an API that outputs the relevant content in JSON. I also wrote a script that fetches the latest posts from an RSS feed and returned the data as JSON.

In order to retrieve the individual content on a Web page and keep everything up to date, I used Facebooks React. Each feature of the mirror is a React component that is usually updated in a specific time interval.

no power saving mode, miserable readability

What I’ve read from even no builder of a smart mirror so far is the fact, that the writing on the mirror is only readable in a low light condition. My panel exceeds even the brightness of the panel used by Brown (250 cd / m²) and Teeuw (250 cd / m²), but I would rate the readability of my mirror as miserable. But this could relate to the fact, that my mirror filters the light maybe more than the two way-mirror used by others. Nevertheless, I would rather tap that these devices are better placed in dark hallways or bathrooms than in a room with many windows.

However, what annoys me even more is the fact that the China controller board does not have a power saving mode. Turns the PI in such a mode, the display panel becomes black, but the back light keeps shining on. Because of that, there is no power saving effect. The only possibility would be to make use of the time switch of the board and automatically turn off the screen after a certain time. However, this is not an option regarding the boot time of about three minutes. Therefore, I could forget my idea of integrating a motion sensor and turn on the display until someone actually stands in front of it.

Conclusion

Until now the mirror was more turned off than turned on due to the energy-saving problem and has not yet found a proper place in the apartment. Nevertheless, I think the idea of a Smart Mirror is a good invention in the field of IOT, which will become a standard inventory of each bathroom in many years. There I see the main field of application: checking the news, the humidity and the weather in the bathroom mirror while brushing your teeth and waiting for that magical three minutes to elapse, that every dentist recommend. But to start such a timer, it would require at least one possibility to interact with the mirror. But a toothbrush tumbler with a RFID chip and a RFID reader at the sink edge would be my first approach to solve this problem.


Leave a Reply

Your email address will not be published. Required fields are marked *

*

*