We recently attended The Big Bang UK Young Scientists and Engineers Fair at the Science, Technology, Engineering and Maths (STEM) festival offering students the chance to experiment with robots and recyclable drones.
We were kindly invited by 'The Big Bang' team to a fantastic event yesterday Hosted by Royal Hospital School (RHS), the Science, Technology, Engineering and Maths (STEM) festival offered students the chance to experience robots and recyclable drones, providing a day outside of the classroom that will be ‘more Star Wars than school lessons’.
Collaborating with the Royal Academy of Engineering, which has funded the event, RHS opened its doors to any school which would like to attend the careers element of the day.
The interactive careers event featured a host of STEM-focused organisations as well as teams from the NHS, the Police, The Armed Forces and of course Coderus, who all demonstrated how STEM subjects work hand in hand to develop the skills required in their sphere of work.
We wanted to take this opportunity to inspire the next generation by displaying something fun to demo in a way that the children would be able to better understand how they too could create a simple smart home prototype through coding and hardware development, with a basic understanding. We decided a really fun thing to build with ease and time restrictions, was a smart mirror concept.
This device was a pleasure to create and struck many conversations within the team as to what functionalities we could add to it. This included Google assistant integrations, traffic updates, weather updates, a daily schedule reminder and even a prompt to tell you how good you look in the morning! The event allowed around 1000 pupils from several local schools to come and explore, we engaged with lots of pupils who were all really intrigued by our mirror and came up with some superb ideas as to how we could improve the concept so we thought we'd create a mini build manual for you.
Go forth, build and code!
Instructions & Build Process:
This project is pretty simple and produces an impressive result. Besides the basic raspberry pi peripherals you’ll need:
- Hot glue gun
- Two way mirrored glass A3
- Photo frame A3
- Raspberry pi 2/3
- Computer monitor screen 19 inch widescreen 16:9
Step 1 - Flash Pi with Raspbian
To begin you will need to flash your pi with the latest version of Raspbian if you already have a pi setup skip straight to the next stage. For the noobs, the first step is to format your SD card (this will erase all the content on the card). Go to https://www.sdcard.org/downloads/formatter/ to download the tool and format the contents of the SD card. Next, go to the Raspbian website https://www.raspberrypi.org/downloads/noobs/ where you can find and download the latest version of the operating system. Extract the zip folder to the root directory of the formatted SD card. Plug the peripherals into the pi and boot up, click Raspbian and install and the OS will automatically install.
For more information on this step go to https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up.
Step 2 - Update the Pi & Install Dependencies
Before you get to the fun bit there are a couple of dependencies you need to install. To begin, run sudo apt-get & sudo apt-get install, this will make sure your pi’s package index is up to date and upgrade all packages. Magic Mirror is written in node IS so you need to install this too. Run sudo apt install -y nodejs and wait for it to download and install. With the setup now complete you can move onto installing Magic Mirror!
Step 3 - Install Magic Mirror
Installing Magic Mirror is easy! Make sure you are in the root directory by running cd ~ and clone the repository created by MichMich git clone https://github.com/MichMich/MagicMirror.git cd into the directory using cd MagicMirror. Now you have all the installation files, start the installation process by running npm install && npm start allow for 10 mins to complete and voila! You now have a basic smart mirror installed so let's skip to customising it.
Step 4 - Install third party plugins
Now to customise! Magic Mirror has a large array of external modules for you to completely customise the look and feel of the mirror. Everything from time to work using the Google API to quote of the day there is probably a module available to suit your needs. Each module has its own installation instructions but mostly the steps are the same, cd into Modules, clone the repo and add to the config files. If you are feeling adventurous there is lots of documentation on how to create your own modules using html/node.
Step 5 - Assemble the mirror
Finally let's piece everything together. Take the photo frame disassemble it and replace the glass with the two way mirror and hot glue in place. Disassemble the monitor and place inside the frame (you may have to cut down to size) and secure in place with hot glue. You might be able to see the monitor inside the frame so if needed electrical tape the besels. Use a cloth or tape to hide the light from behind the screen but careful not to cover the ventilation holes.
Q&A / Common problems
- My Pi does not boot up and shows a blank screen or no signal? - This could be a number of issues but at boot the pi checks there is a HDMI monitor connected to enable the graphics output. The monitor must be loaded and waiting for a signal to pass when the pi boots. Unfortunately, you can’t plug a monitor in after the pi has booted up without editing the /boot/config.txt file. For more information read… https://www.raspberrypi.org/documentation/configuration/config-txt/.
- How do I rotate my screen 90 degrees? - This can be done easily by adding display_rotate="1" to the /boot/config.txt file. Edit the file using sudo nano /boot/config.txt. For more information read… https://www.raspberrypi.org/documentation/configuration/config-txt/.
- How do I exit out of smart mirror?- Using a keyboard press the key combination CTRL + Q to take you out of the smart mirror application.
- Npm does not run over ssh - You can run DISPLAY=":0" nohup npm start && over ssh and it will start the magic mirror on the local display.
- I get an error when trying to clone the repository - git requires a connection to the internet to download the repo so make sure you have ethernet or wifi connected
- I only have a vga monitor can i still make a smart mirror? - Yes, there is hdmi to vga adapters available or you can try to make your own using https://uk.pi-supply.com/products/gert-vga-666-hardware-vga-raspberry-pi.