Smart Mirror

A smart mirror that displays an LED monitor powered by Raspberry Pi that contains various modules custom to the users’ desire with integrated Alexa voice, PIR motion sensor, and controllable LED.

Engineer

Aakash K

Area of Interest

Chemical Engineering

School

Cupertino High School

Grade

Incoming Senior

Demo Night Presentation

Demo Presentation

BUILD PLAN

Build Plan

Build plan

Link to build plan:

aakash-ks-build-plan

BILL OF MATERIALS

Bill of Materials

Bill of Materials

Link to Bill of materials:

aakash-ks-bill-of-materials-sheet1-1

Final Schematic

Smart Mirror Schematic

Final Milestone

Final Milestone

LEDs

LED Placement

LED Remote Access

The final milestone of this project is the installation of LED strips along both the interior and exterior of the frame that is controllable from my smartphone and Alexa.

Materials Used

  • RGB LED strip (with adhesive backing)
  • LED wifi adapter
  • 12V power supply
  • 2.4 ghz wifi router
  • Scissors

Setup

Wrap LEDs along the exterior of the frame.

Wire the LEDs through the wifi adapter and provide power to the setup from the outlets.

Modifications

LED strips have been added to provide a stylistic flare to my mirror.

To further this modification is an incorporated wifi adapter for remote access from any smartphone to control the LEDs.

One upping remote access is integrating Alexa voice (from milestone #2) to control the LEDs via voice command.

Process to Reach Milestone

LED setup:

  1. Wrap the strip along the exterior of the frame
  2. Cut LEDs at this length
  3. Connect wifi adapter to the LEDs
  4. Connect wifi adapter to power supply
  5. Plug in power supply to outlet

Remote access from Smartphone:

  1. Download Magic Home Pro
  2. Create Magic Home account
  3. Power on LED strips
  4. Create new device
  5. Connect to the wifi adapter from the phone
    1. Network should be called LEDnet-xxxxxx
      1. If the wifi network does not appear, factor reset the adapter by connecting and disconnecting the adapter from power 4 times
        1. This should cause a strobe effect in the LEDs
  6. Go back into Magic Home app and connect to desired internet provider
    1. Must be 2.4 ghz (will not work with 5 ghz)
  7. Name the device

Alexa Voice control:

  1. On amazon Alexa app, enable Magic Home under the skills/games tab
  2. Log into Magic Home account
  3. Add the device previously named in the Magic Home app

Third Milestone

Third Milestone

Final Put-Together

My third milestone includes the completion of the outside frame  that includes a stained finish of the frame and the final put together of the mirrors components including the frame, the mirror, and the LED display.

Materials Used

  • .75×1.5 wood (80 inches)
  • 1×2.5 wood (80 inches)
  • Saw
  • Drill
  • Screwdrivers
  • Wood Screws
  • Acrylic see-through mirror
  • Power bar
  • Electrical tape
  • Super glue
  • Wood glue
  • Masking tape
  • Wood finish
  • Stain Brush
  • Stirring stick
  • File/Sandpaper

Setup

Inside the frame sits an acrylic mirror that is secured against it by both super glue and the LED monitor pressed against the back of it. The LED monitor is secured in place with extra wood from the construction frame.

Behind the LED display, all components requiring power are plugged into a power strip (pi, speaker, LED monitor) which is then plugged into a wall outlet. Electrical tape is used to secure many of the components to the back of the monitor or around the frame.

On the bottom side of the monitor the PIR sensor, direct power to the monitor, and speaker are all secured with either electrical tape or super glue to provide easy access and limited interference.

On top of cardboard, place the mirror frame face up for staining the surface.

Modifications

The PIR sensor wires were extended in length with an additional 3 male to male and female to female wires.

The monitor was stripped of its plastic casing to allow it to fit in the frame with ease.

Specific features of the modules have been tweaked to my preference.

The frame of the wood has been stained with wood finish to give it a darker color and match the furniture in my home.

Process to Reach Milestone

Frame Construction (2 parts):

  1. Backside
    1. cut 2 pieces of the .75×1.5 inch wood at 15 inches each
    2. cut 2 pieces of the .75×1.5 inch wood at 23.75 inches each
    3. Glue together at 90 degrees to form a rectangle
      1. Glue so that depth is 1.5 inch depth is provided to the back side (see frame images)
  2. Front side
    1. cut 2 pieces of the 1×2.5 inch wood at 13 inches each
    2. cut 2 pieces of the 1×2.5 inch wood at 23 inches each
    3. Glue each piece individually to the frame already constructed
      1. Glue so there is slight overhand on the top and bottom of the mirror to conceal the frame (see frame images)
  3. Sand or file the edges to fit the corners together at the proper length

Smart Mirror put together:

  1. After the frame has been constructed, place the mirror into frame
    1. If mirror is too big, trim one edge of it using wire cutters
      1. The edge cut does not have to be perfectly linear as it will be concealed once placed in the frame
      2. Cover cut edge with masking tape to prevent dispersion of the cracks
    2. Secure the mirror in place with super glue and masking tape
  2. Strip the monitor of its plastic casing
    1. In most cases your hands can be used to do this
  3. Behind the mirror place the LED monitor in the center

Wood Finish:

  1. Outside, set up cardboard on the ground
  2. Stir the wood finish until it is relatively liquid
  3. Cover the interior of the mirror with plastic and secure with masking tape along the edges to prevent damage to the surface of the mirror
  4. Dip the stain brush into the finish and apply consistent layers of finish to the wood
    1. Strokes should be long and in the same direction

Second Milestone

Second Milestone

My second milestone for the Smart Mirror is the addition of personally selected modules, integration of Alexa voice control, and a fully functioning PIR sensor that turns the LED display on and off based on motion in the room.

Materials Used

  • Speaker with 3.5 mm jack
  • USB Microphone
  • HC-SR501 PIR Sensor
  • 3 female-female wires

Setup

Since the last milestone, various modifications have been made to the setup of the pi. A USB mic is now connected as well as 3.5mm jack for the speaker. In order to permit the usage of the PIR sensor, the GPIO pins have been utilized. A the ground, the power, and pin 7 have been selected accordingly for hardware aspect of the setup.

Modifications

Alexa Voice Control is now integrated within the raspberry pi separate from the the MagicMirror modules. Separate from its compatibility with google calendar (which was previously setup in my first milestone), Alexa serves as an additional feature that fits well with the general purposes of the mirror by providing convenience to the user.

Also incorporated is the PIR sensor that controls the HDMI power connection between the pi and the monitor. By adjusting the code accordingly, I can specifically select the time interval of the shutoff mechanism. Currently, the monitor is set to shut off after 10 seconds without motion; however I will most likely set this value to 600 seconds (10 mins) when mounted. This conserves power and only function when I am near or around the Mirror.

Process to Reach Milestone

Modules:

  1. After the basic construction of standard display for the Magic Mirror was research into specific modules I’d like to incorporate.
  2. Spotify Now Playing Module
    1. Installing file from GitHub
    2. Creation of a Spotify developer area to get client ID and client secret
    3. Installing modules onto config file of MagicMirror
    4. I have selected to show the cover art of the music playing. This can be controlled from the configuration file of the module itself
  3. My Commute Module
    1. Installing file from Github
    2. Creating a developer account to get google maps api key
    3. Entering starting point and destination
    4. Entering mode of transportation

LINK TO MODULES: https://github.com/MichMich/MagicMirror/wiki/3rd-party-modules

Alexa Voice:

  1. I selected Alexa Voice over Google Assistant because there was ultimately a more comprehensive guide to install Alexa. Upon review of the two choices, Alexa seemed to provide more accessibility and general compatibility as I can easily access the device from my smartphone.
  2. A developer account was necessary to access the open source Alexa software. When making a developer account, a project was created where I was given a specific client ID and client secret.
  3. Installing the Alexa Voice script through the terminal from github
  4. Entering client credentials to access project from pi
  5. Opening 3 terminal windows
    1. Bring up web service to authorize sample app
    2. Run sample app that communicates with Alexa voice
    3. Running sample app with wake word engine “Alexa”
  6. Once all three terminals are setup, Alexa voice service should fully function

FULL INSTALLATION GUIDE: https://github.com/alexa/alexa-avs-sample-app/wiki/Raspberry-Pi

 

PIR Sensor:

  1. After spending two days attempting to install the PIR sensor as a module into the Magic Mirror module folder itself, I discovered it might be easier to run python code separate from the Magic Mirror
  2. From GitHub, I installed python code that serves as an HDMI controller for the monitor, not specifically the mirror
  3. The actual connectivity between the pi and PIR sensor was relatively simple
    1. GND on the PIR goes to pin 6
    2. VCC on the PIR goes to pin 2
    3. OUT on the PIR goes to pin 7
      1. It doesn’t matter where the output goes on the pi as long as you accommodate for this in the code

LINK TO PYTHON CODE: https://github.com/deg0nz/MagicMirror-Display-Controller

Altering Display:

  1. From the config.js file of the Magic Mirror, the specific locations and display of the modules can be altered based on user preference

First Milestone

First Milestone

My first milestone for the Smart Mirror is finishing the complete setup of the standard display with the addition of my personal google calendar.

Materials Used

  • LED display
  • USB mouse and bluetooth keyboard
  • Raspberry Pi 3
  • HDMI cable
  • Micro SD card with Adapter

Setup

The raspberry pi is controlled via a USB mouse and a bluetooth keyboard. To display the pi itself, an HDMI cable connect the pi to the LED monitor. The pi is powered by a micro USB cable plugged into a wall outlet for continuous power. Similarly, the monitor is plugged into an external outlet for power.

The remote access to the pi is conducted through VNC viewer and displayed on my personal laptop. After the the VNC server was installed on the pi, display on my laptop is accessed through the IP address of the pi.

Modifications

After the core code was downloaded from a github open source file, I made minor altercations to the code to tailor the display to my preference.

The default setup of the display come with a generic display of US holidays. To personalize my project a little, I added the link of my google calendar into the configuration code for the display.

Process to Reach Milestone

Raspberry Pi Setup:

  1. Installation Raspbian onto micro SD
  2. Set-up of VNC viewer for remote access to pi from laptop (not necessary unless there is not access to monitor/mouse and keyboard)

How to setup VNC viewer: https://www.youtube.com/watch?v=JYKZjUgtOYw&t=239s

Mirror Setup:

  1. Install of MagicMirror software github
  2. Getting and installing custom API key for weather module
    1. Create free account with openweathermap
    2. Get API key and input into configuration code file
  3. Implementing personal calendar into display code

Magic Mirror Base Software: https://github.com/MichMich/MagicMirror

Weather API Key: https://openweathermap.org/

Starter Project

Starter Project Summary

TV-B-Gone in Action

Device

TV-B-Gone

For my starter project, I have constructed the TV-B-Gone. Powered by two AA batteries, current is sent to various components of the circuit board including a ceramic oscillator, a capacitor, an LED, 4 IR LEDs, a micro-controller, an PNP transistor, and 4 NPN transistors.

When activate the device emits IR LED patterns toward the TV, the TV interprets it as a “turn off” function similar to a TV remote. This is possible via the pre-programed micro-controller that contains the off code for most TV manufacturers.

Throughout the manufacturing process, I learned much about the purposes of the individual components of the circuit board. Additionally, I had the opportunity to practice with soldering.

How it Works

Current is supplied through two AA batteries to the device. When switched on, the micro-controller runs the pre-programmed code to find the “off” function for the desired TV. The IR LEDs are powered, and amplified through the transistors that act as current regulators by allowing a small current to control a larger current. Because of this, the LEDs are able to emit IR toward the TV at a specific frequency. To assist this process, the ceramic oscillator generates an oscillating signal of a specific frequency that converts direct current to alternating current. The electrolytic capacitor filters the undesired AC frequencies. The ceramic capacitor provides general stability and efficiency to the circuit.

Leave a Comment

Start typing and press Enter to search

Bluestamp Engineering