I decided to create a MagicMirror for personal use about 4 month ago when I saw this brilliant work from Michael Teeuw (http://michaelteeuw.nl/post/80391333672/magic-mirror-part-i-the-idea-the-mirror)
I was really excited of how well the result turned out, but for the last couple of weeks i felt that there has to be more about my mirror. So I came up with the idea that I need to display the contents of my favorite news, when the title tells me I need to read them. There was no way for me to create some buttons on the side of the mirror or what so ever, I personally dont like it and think they are ugly. Then I came up with the idea of speech recognition and decided to rewrite the whole UI for Windows IoT core. After 1 day of work I came up with this and it feels pretty neat.
Get it going!
What you need for the MagicMirror:
- 1x observation Mirror
- 1x Monitor of choice
- 1x RaspberryPI 2 or better running Windows IoT
- Enough wood (that depends on your observation mirror size)
- At least a little bit of wood working skills
The Monitor. I used a 24" IIyama Monitor, it is really important that the monitor got it's ports faceing downwards or to the sides not to the back (if sitting in front of it) this will keep the depth of the case to a minimum. Also the monitor should got good black level to get a nice mirror effect. You need to dissamble your monitor case to get the panel as near as possible to the mirror.
The Mirror. You need to get you a piece of observation mirror, in my case that seriously was the hardest part, you can't imagine what people asking you when you want to buy an observation mirror... After a bit of research I just ordered a piece of SGG MIRASTAR from my local glazier's workshop.
The wiring. My MagicMirror only got one power cord to supply both, monitor and pi, so all the wiring is stuffed in the back of the case. i just splitted the monitor power cord and attached a switching adapter to it.
Building the case, i will not go deep in detail of how to build the case because it really depends on what monitor you use and what size your observation mirror has, but i can give you some useful hints. If you would like to know more detail you could read the article from Michael Teeuw linked above.
You need to make sure that the depth of your case fit your monitor plus the mirror. Also give it some space on the sides like 2mm on each side. To keep monitor, mirror and pi in place i decided to install a toeboard border on top of my frame. It is installed with wood glue and small nails.
Images
I just create a SpeechRecognizer with a list constraint and start a continuous recognition session.
recognizer = new SpeechRecognizer();
recognizer.Constraints.Add(new SpeechRecognitionListConstraint(new string[]
{
"Show", "News", "Detail",
"Hide", "Close", "Weather", "Time", "Back", "Escape"
}));
recognizer.StateChanged += RecognizerStateChanged;
recognizer.ContinuousRecognitionSession.ResultGenerated += RecognizerResultGenerated;
// compile constraints
SpeechRecognitionCompilationResult compilationResult = await recognizer.CompileConstraintsAsync();
// start recogition session if successful
if (compilationResult.Status == SpeechRecognitionResultStatus.Success)
{
Log.i("SR Success");
await recognizer.ContinuousRecognitionSession.StartAsync();
}
else
{
Log.w("SR Failed {0}", compilationResult.Status);
}
When the result is generated, I check the recognized text and update my viewmodel to start the animation.
if (args.Result.Status == SpeechRecognitionResultStatus.Success)
{
string text = args.Result.Text;
if (!string.IsNullOrEmpty(text))
{
text = text.ToUpper();
if (text == "SHOW" || text == "NEWS" || text == "DETAIL")
{
await EnsureOnUI(() => this.News.ViewDetail());
}
else if (text == "HIDE" || text == "CLOSE" || text == "WEATHER" || text == "TIME" || text == "BACK" || text == "ESCAPE")
{
await EnsureOnUI(() => this.News.HideDetail());
}
}
}
Demovideo
Article in MagPI
https://www.raspberrypi.org/magpi-issues/MagPi48.pdf
It might be a bit late but here is a link to the official magazine of the raspberry organisation, were the magic mirror just found its place in its own little article. Sweet!
Comments