Smart Mirror Using Broken Android Tablet

by audrius-a in Circuits > Reuse

52201 Views, 391 Favorites, 0 Comments

Smart Mirror Using Broken Android Tablet

20171212_185928.jpg
Tablet.jpg

A while ago I accidentally dropped my Android tablet on its face. The glass broke, but the rest was still working fine. At the risk of being called a hoarder by my partner once again, I put it in a draw, hoping I'll find a use for it some day. That day came when I got a "staff's picks" email from Instructables with a link to this cool Smart Mirror project https://www.instructables.com/id/Android-Motion-Se...

There are many similar projects posted, and mine is not the most impressive one. Quite the opposite in fact, I just wanted to stick a tablet behind a mirror, download an app and be done with it. But nothing is simple, isn't it? Turns out my tablet was sitting in a draw for far too long and there are no apps that would work on Android v2.3 (Gingerbread) any more. So I had to write it all by myself. It was my first Android (and Java) project so please don't judge.

The physical assembly was fairly simple to implement. I stripped the tablet even before I ordered the parts to make sure I can mount it easily without the glass. Turns out that the glass is separate from the LCD screen and comes off quite easily. At the same time, all the components like PCB, battery and the screen itself were nicely packed together so no extra mounting was necessary. I've found that the touch sensor however, is glued to the glass. But as I didn't intend to have interactive mirror that was OK.

Shopping List

As I mentioned I already had a tablet - Scroll Excel 7-inch, but any tablet would work equally well or even better. In addition to that I had to buy:

  1. A3 size photo frame from IKEA
  2. Two way acrylic mirror sheet A3 from ebay
  3. Black fab foam sheet A3 from HobbyCraft

I also used:

  1. Stanley knife
  2. Super glue
  3. Sandpaper
  4. Drill with small drill bits
  5. Dremel and a mini hacksaw

To avoid any complications I bought the picture frame first. I suspected that dimensions in the description might not be accurate and I was right about that - the dimensions were given of the inside of the frame, not the size of the glass or the backboard.

I chose to buy acrylic sheet with semi-transparent film already deposited as I read some stories of people struggling to get good quality out of glue-on film. Have you tried to put a screen protector on your phone? I think its impossible to get clean results without actual clean room.

Preparation

20171011_174905.jpg
20171011_171103.jpg
20171011_171829.jpg
20171127_204322 (1).jpg

So the first thing was to disassemble the frame itself. I was surprised how easy that was with little clips all around the sides. I think this worked out in my favour as some frames have backboard that slides in and out, which could potentially scratch the fragile mirror coating.

Then I measured the acrylic mirror sheet and cut to size. The sheet has protective film from both sides so cutting was fairly easy (though, you still have to be careful not to make any deep scratches). I used Stanley knife to score the sheet and then snapped against the edge of a wooden piece. It wasn't a clean cut and produced some sharp edges, so I carefully smothened them out using some sandpaper. Be careful here as acrylic has tendency to crack and shatter more than you would expect from plastic.

I only had to cut the mirror sheet length wise as the width was almost perfect for the frame and it only had a couple of millimetres of play. To make sure it doesn't slide around I used some insulated wire bits on both sides.

To protect the mirror sheet from scratches I've added a sheet of black fab foam with a cut-out a couple of millimetres smaller than the LCD screen to avoid any edges being visible. Initially I tried to reuse a white inner board that came with the frame, but white colour could be easily seen against the black LCD screen, especially in daylight.

You might notice in some of my photos I had a cushion under the frame. I realised a bit too late that the acrylic sheet is very flexible and while the frame kept it above the desk top, sometimes the sheet would touch the surface and get scratched up. The scratches are barely visible at the moment but it nags me every time I clean it. You have been warned.

Oh, and don't forget to take the protective film off when assembling. I read a few reviews that complains about the mirror not being reflective or clear at all. That made me chuckle a little :)

Mounting the Tablet

20171011_173140 (1).jpg
20171011_173321 (1).jpg
20171011_174905.jpg
20171011_175137.jpg
20171212_234639.jpg

I've mounted the tablet directly into the backboard. Its a 3mm hardboard so it has enough strength to support the weight of the tablet. Cutting the board was easy with a hacksaw and a Dremel tool, though I had to be careful not to make hole too big.

Even though I'm not planning to use the camera, I chiselled out a small hole for it just in case. Then I glued some bits of leftover hardboard with super glue where I was planning to mount the cover. You might notice couple of plastic mounts there as well. Due to electronic components around the mounting holes, I could use only a small amount of material and I didn't think the hardboard would hold. So I found some old plastic box and cut pieces out of that.

Finally I screwed the original back cover of the tablet. It doesn't seal it perfectly, but it provides good support and protection for all the components while still giving me the access to connectors and the power button.

Software

Considering that most applications out there are for Android v4 or higher, I had very little chance to find a Smart Mirror application that would work on my tablet. Upgrading the tablet was not possible either, so I decided to download Android Studio and develop application myself. Disclaimer - I am full time .NET developer, so even though mobile and Java development is new to me, the learning curve was not as steep as it would be learning programming from scratch.

Describing the whole source code would be a topic on its own. Let me know in the comments if you are interested and perhaps I'll make another post. But for now, I will only explain my requirements and basic functionality. By the way, the source code is available on GitHub (https://github.com/audrius-a/smart-mirror.git). It is published under MIT license so please feel free to fork it and use for your projects.

My requirements:

  • Must show date and time;
  • Must show day and night temperature forecast 5 days ahead;
  • Must show weather conditions 5 days ahead;
  • Must run continuously without user interaction even after reboot;

To achieve the above I signed up to Met Office DataPoint which provides free weather updates that are pretty reliable, even for the unpredictable UK weather. Signing up is very easy and they provide you with an API key right away allowing to query data almost immediately. Check out app/src/main/java/com/development/audrius/smartmirror/MetService.java file for the exact query I used.

To display weather conditions I used free icons from http://www.alessioatzeni.com/meteocons/ shared by Alessio Atzeni. Thanks Alessio, for publishing these icons, they are great.

I thought the biggest struggle will be with the last requirement of keeping the application always on top. Turns out, it is very easy with a couple of permissions in the AndroidManifest.xml file and a StartupHandler class. Even if the tablet dies for any reason or simply needs a reboot, the application comes back on just a few seconds after the startup and stays on forever.

The only outstanding issue I have so far is the WiFi signal disappearing after a day or two. I believe that was the case in the past and perhaps my only option would be to reboot the tablet after a few failures to connect to the internet. I'll update the post once I get it resolved.

Summary

I hope you've enjoyed reading this instructable and perhaps even learned something or got inspired. Please feel free to leave your feedback or any questions in the comment area.