Raspberry PI Smart Mirror (ft. MagicMirror 2)
by luxymay_ in Circuits > Raspberry Pi
111 Views, 2 Favorites, 0 Comments
Raspberry PI Smart Mirror (ft. MagicMirror 2)
Our smart mirror displays useful information like the time, weather, and news updates on its reflective surface. The Magic Mirror software allows full customization (open source) and plenty of APIS made by the community.
Our Purpose
The purpose of this build was to create a functional and visually appealing smart mirror that combines technology with everyday convenience. It was a fun and rewarding experience to program the features, such as displaying the time, weather, and even integrating Spotify for music control. The project allowed for creativity and problem-solving while working with hardware like a Raspberry Pi and software like MagicMirror. Not only was it an enjoyable learning experience, but the finished product is also a sleek and stylish addition to any room, offering both practicality and an impressive aesthetic.
Our Pitch Video
https://www.youtube.com/watch?v=5rERKMuSJwA&t=12s
Supplies
- Raspberry PI 4
- Micro-HDMI to HDMI
- Monitor
- Reflective Mirror Film
- Keyboard
- Mouse
- Micro SD Card
- USB-C cable and a Charger
Set Up the Raspberry Pi
Set Up the Raspberry Pi
Download the Raspberry PI OS from the official website onto the micro-SD
https://www.raspberrypi.com/software/operating-systems/
Put the SD card into the Raspberry PI.
Connect your Raspberry Pi to a monitor, keyboard, and mouse.
- After connecting it to a power source. Allow the Raspberry PI to set itself up.
Set Up the Correct Time Zone
Open the Terminal
Launch the terminal on your Raspberry Pi.
Access the Raspberry Pi Configuration Tool
Type the following command and press Enter:
Navigate to Localization Options
- In the configuration menu, use the arrow keys to navigate to "Localization Options" and press Enter.
- Select "Change Time Zone" and press Enter.
Select Your Time Zone
- First, choose your geographic region (e.g., "US").
- Then, select your specific time zone (e.g., "Eastern," "Central," "Pacific," etc.).
Exit the Configuration Tool
- After setting the time zone, press "Finish" to exit the configuration tool.
Reboot the Raspberry Pi (Optional)
If the time zone change does not immediately take effect, reboot your Raspberry Pi by typing:
Download GitHub and Magic Mirror
Install Node.js
- Download and install the required version of Node.js. Refer to the official documentation for your operating system (Linux or others).
Check for Git
- Confirm that Git is installed by running git in the terminal. If it’s not installed, you’ll need to install it first.
Clone the MagicMirror Repository
- Use the following command to copy the MagicMirror files to your Raspberry Pi:
Navigate to the MagicMirror Folder
- Enter the directory where the MagicMirror files are stored:
Install the Application
- Run the installation process with this command:
Set Up the Configuration File
- Copy the sample configuration file to create your own config file:
Start MagicMirror
- Launch the MagicMirror application with:
- For server-only mode, use:
Install Pm2
Install PM2
- Install PM2 globally using npm:
Navigate to Your Project Directory
- Use the cd command to navigate to the folder containing your Node.js project:
Start Your Application with PM2
- Start your application using PM2:
- If your project uses a different script, replace npm -- start with the appropriate command, such as node app.js.
Save the PM2 Process List
- Save the current PM2 process list so it can be restored after a reboot:
Enable PM2 Startup on Boot
- Run the following command to set up PM2 to start automatically on boot:
- This will output a command specific to your system. Copy and paste that command into the terminal and execute it. For example, it might look like this:
Verify Auto Boot
- Reboot your Raspberry Pi to test that the application starts automatically:
- Once the Raspberry Pi restarts, check if PM2 has restored your process by running:
Stopping and Managing PM2 Processes
- To stop a process:
- To delete a process from PM2:
This will allow you to keep MagicMirror running all the time.
Adding Modules
For our project, we added MMM-Spotify.
https://github.com/skuethe/MMM-Spotify
Install MMM-Spotify
Setup Spotify
Be a premium member of Spotify
- Go to https://developer.spotify.com
- Navigate to DASHBOARD > Create an app (fill information as your thought)
- Setup the app created, (EDIT SETTINGS)
- Redirect URIs. : http://localhost:8888/callback
- That's all you need. Just save it.
- Now copy your Client ID and Client Secret to any memo
3. Setup your module
Edit the spotify.config.json with the editor of your choice. Modify the entries as hinted below, then save it.
Add it to the Config.Js file for MagicMirror
Install Reflective Film on Your Monitor
Installing Reflective Film on a Monitor
Prepare Your Workspace
- Clean a dust-free, flat surface to work on.
- Make sure the monitor screen is clean and free of dust or fingerprints.
Measure and Cut the Reflective Film
- Measure the dimensions of your monitor’s screen using a ruler or measuring tape.
- Cut the reflective film to match the screen size, leaving a small margin (about 1–2 mm) for easier application.
Clean the Monitor Screen
- Use a lint-free cloth and a screen-safe cleaner to remove dust and debris from the monitor.
- Allow the screen to dry completely.
Apply the Reflective Film
- Peel off a small section of the film's backing from one corner.
- Align the exposed edge with the top edge of the monitor.
- Gradually peel the backing while smoothing the film onto the screen using a credit card or a squeegee to remove air bubbles.
- Work slowly to ensure the film adheres evenly across the screen.
Smooth Out Air Bubbles
- If air bubbles remain, gently lift the film and reapply, using the squeegee to press out bubbles as you go.
- Trim any excess film with a craft knife or sharp scissors if needed.
Final Check
- Inspect the monitor under different lighting conditions to ensure the film is applied smoothly and evenly.
Using a Two-Way Acrylic Mirror Instead of Reflective Film (Optional)
If you prefer a sturdier and more professional look, use a two-way acrylic mirror:
Measure your monitor and purchase 2 way acrylic mirror to its dimensions
Attach the Acrylic Mirror to the Monitor
- Use double-sided adhesive tape or mounting strips around the edges of the monitor bezel.
- Carefully align the acrylic mirror with the monitor and press it firmly into place.
Ensure Proper Viewing
- Test the monitor display to ensure the acrylic mirror does not obstruct the visibility of the screen.
- Adjust the brightness and contrast settings on your monitor, as the mirror may slightly dim the display.
Secure the Edges (Optional)
- For additional stability, you can use a thin frame or clips to hold the acrylic mirror in place.
Connect Your Raspberry Pi to the Setup and Enjoy!
Customize and Test
- Adjust module settings to fit your preferences and test your smart mirror.
- Ensure all features, including Spotify, are functioning correctly.
Improvements After Completing the Project
This Magic Mirror was designed and put together by our Introduction to Engineering Group. Due to our limited time outside of class (we all work full/part time jobs), we weren't able to integrate many features we wanted to add. For example, we can add a PIR sensor in the future for a sleep-mode to save power. The PIR sensor could also be used to program an LED strip that wraps around the mirror for automated lighting. We also want to measure and add a frame to make it more visually appealing. Also, the film we chose wasn't as reflective as we expected and has some visual warping so be mindful when shopping for a reflective surface.
Thank you to the Circuit Critters team for their resilience this semester! We made it. :3