fbpx

DIY – Smart Mirror with Raspberry Pi

Wait! Before you decide to use a Raspberry Pi for your smart mirror. Check out our post on why using an Android tablet for your Smart Mirror is the future and check out this Alexa smart mirror DIY. The world is now App based and unless you want to spend time programming or coding, we recommend you use an Amazon Fire tablet or an Amazon Fire TV for your smart mirror.

Setup your Pi using these simple steps


Mango Display setup

Login. Select ‘Add New Display’ and choose ‘Mango Display on Web Browser’ option and finish your setup. You will be provided with a unique URL for that display, you can get it by clicking the ‘view display’ button after it has been setup. We will use this URL on our Raspberry Pi browser as our display.

Raspberry Pi setup

Ensure you are running the latest Raspbian Operating system for your Raspberry Pi. Then follow the steps below.

Browser setup, hide mouse & auto start
Hiding the mouse cursor

To hide away the mouse cursor while it’s not moving, we use “unclutter”. Install it by running

sudo apt-get -y install unclutter
Autostarting everything in sequence

There are three additions we need to make to the startup sequence: Disabling screen blanking, hiding the cursor and starting Chromium in fullscreen. All these additions happen in the desktop’s autostart file. Run

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

And add

@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0

to disable screen blanking,

@unclutter -idle 0

to hide the cursor and

chromium-browser -kiosk https://portal.mangodisplay.com/?major=X&minor=XXXXX&macaddress=XXXXXXXXXXX

to start Mango Mirror in fullscreen. *Change the Website URL to your specific Mango Mirror URL that you got via the setup of the device on your Mango Mirror App.

The final “autostart” file looks like this:

@lxpanel -profile LXDE-pi
@pcmanfm -desktop -profile LXDE-pi
@xscreensaver -no-splash
@xset s 0 0
@xset s noblank
@xset s noexpose
@xset dpms 0 0 0
@unclutter -idle 0
point-rpi
chromium-browser -kiosk https://portal.mangodisplay.com/?major=X&minor=XXXXX&macaddress=XXXXXXXXXXX

Once you’ve made your changes, exit out of the nano text editor by pressing “CTRL + X”, followed by pressing “y” and “return”.


Remote access

Usually you will have the Pi running without Keyboard or mouse once you have your display going. If you still need access to it, enable remote access via SSH (remote terminal) or VNC (remote desktop), open up a terminal on the Pi and run

sudo raspi-config

Then head into “5 Interfacing Options” and switch both “P2 SSH” and “P3 VNC” on. Exit out with “Finish” and you should be able to connect to “raspberrypi” with an SSH client like Putty or with the RealVNC viewer for remote desktop via VNC.


Screen rotation

If you need to rotate your screen orientation vist https://pimylifeup.com/raspberry-pi-rotate-screen/ for quick steps.


Motion sensor

Add a motion sensor to turn the display on only when there is person nearby.

Option 1: Simple. Buy a motion controlled power outlet and connect your display monitor to it. Like this one: https://www.amazon.com/Westek-MLC4BC-Motion-Activated-Control/dp/B009KSEE4G/

Option 2: Connect a PIR motion sensor to your Raspberry Pi and do a bit of coding to turn the display on and off based on motion detection. You can find PIR sensors on amazon and many coding tutorials available online, find the on that works for you.