Transform Your Bathroom into a Smart Bathroom with a DIY Smart Mirror

Having a smart home is becoming more and more popular these days. People love the convenience of controlling things like lights, temperature, and appliances from their smartphones or voice assistants. But did you know you can also build your smart mirror to turn your ordinary bathroom into an impressive smart bathroom?

In our introductory article "Smart Bathroom Mirror Hacks You Need to Try in 2023", we explored the possibilities of smart mirrors. Now it's time to get hands-on! Follow this step-by-step guide to make your smart bathroom mirror using a Raspberry Pi.

With a Raspberry Pi mini-computer, the MagicMirror² software platform, and a display monitor, you can create a customized smart mirror to mount in your bathroom. This smart mirror can show you useful information like the weather forecast, daily agenda, news headlines, and more.

In this post, I'll walk you through the entire process of building your smart mirror for a smart bathroom using a Raspberry Pi.

Follow along to learn:

  • How to set up a Raspberry Pi with the operating system and software
  • Installing and configuring the MagicMirror² platform
  • Adding cool modules like calendars, weather, news feeds, and clocks
  • Customizing the interface with your styles and layout
  • Building a frame to mount the mirror
  • Finishing touches like setting automatic on/off times

Let's start transforming your ordinary bathroom into an awesome high-tech smart bathroom!

Overview of Building a Smart Mirror for a Smart Bathroom

Here's a quick rundown of the major steps we'll cover:

  • Choose your Raspberry Pi board - The Pi 3 or 4 Model B works great.
  • Install the Raspberry Pi OS on a MicroSD card.
  • Set up your Raspberry Pi by enabling SSH access and WiFi.
  • Install the MagicMirror² software to create your smart mirror interface.
  • Add modules like calendars, weather, news feeds, and clocks.
  • Customize the look and feel with CSS styles and layouts.
  • Construct a frame to mount your mirror and hardware.
  • Add final touches like setting automatic on/off times.

Hardware and Tools You’ll Need

In order to build your smart mirror, you'll need the following hardware components:

  • Raspberry Pi - This Mini PC acts as the brains. The Pi 3 or Pi 4 Model B work best.
  • MicroSD Card - At least 16GB Class 10 card to store the OS and software.
  • Display - An LCD monitor or salvaged laptop screen for the mirror.
  • Display Controller - To connect the LCD screen to the Pi's HDMI port.
  • Two-Way Mirror - Special glass that's reflective on one side only.
  • Frame - Wood or other material to build an enclosure.
  • Mounts & Brackets - For attaching the mirror and hardware to the frame.
  • Cables - HDMI, power cables, and jumper wires to connect the components.

You'll also need tools like a soldering iron, wood glue, paint/finish, and basic hand tools for construction.

smart mirror smart bathroom
Raspberry Pi

Step 1 - Set up Your Raspberry Pi

The first step in the process is to get your Raspberry Pi up and running.

Install the Raspberry Pi OS

You'll need to install the Raspberry Pi OS on a MicroSD card:

  • Download the Raspberry Pi Imager tool for your computer OS. (from this link)
  • Insert your SD card into your computer's card reader.
  • In the Imager, select "Raspberry Pi OS (32-bit)".
  • Select your SD card as the destination drive.
  • Click "Write" to install the OS image.

Enable SSH Access

We'll need SSH access to remotely connect to the Pi:

  • In the Pi Imager, click the gear icon and enable the "SSH" option.
  • This will allow us to SSH into the Pi later.

Configure Your WiFi

Set up your WiFi credentials so the Pi can get online:

  • In the Imager, add your SSID and wireless password under "Network Settings".
  • This will have the Pi auto-join your WiFi on boot.

Set a Static IP Address

It's best to set a static IP address:

  • Edit the dhcpcd.conf file:
sudo nano /etc/dhcpcd.conf
  • Add the following with your desired IP address:
interface eth0
static ip_address=
static routers=
static domain_name_servers= 

Your SD card is now ready to boot up your Pi!

First Boot and SSH Access

  • Insert the prepared SD card into your Raspberry Pi.
  • Connect the ethernet and power to turn it on.
  • On your computer, SSH into your Pi using the set IP address.

You now have command line access to install any software needed!

Step 2 - Install MagicMirror²

Now we can install MagicMirror² to create the smart mirror interface: (MagicMirror² Documentation)

Install Node.js

MagicMirror² requires the Node.js runtime environment. Install it with:

curl -sL | sudo -E bash -
sudo apt install -y nodejs

Download and Install MagicMirror²

  • Clone the MagicMirror² repository:
cd ~
git clone
  • Install its dependencies:
cd MagicMirror
npm install
  • Start the MagicMirror² application:
npm start

You should now see the default MagicMirror² interface boot up on your display or connected monitor!

Step 3 - Customize Your Smart Bathroom Mirror

Next, we'll customize the interface by adding modules and styling:

Add Useful Modules

Browse module repositories to find the ones you want. Here are some great options:

  • Calendar - Show your Google or iCloud calendar
  • Weather - Current conditions and forecasts
  • News Feeds - Headlines and summaries
  • Commute Time - Traffic maps and transit times
  • Clock - Digital or analog clock designs

Here are some more detailed steps for adding modules in MagicMirror²:

  1. Install the module code

Browse GitHub to find MagicMirror modules you want to add. For example, to add a calendar module:

cd ~/MagicMirror/modules
git clone

This will download the module code into the ~ /MagicMirror/modules directory.

  1. Get any needed API keys or configs

Some modules require API keys or other configurations. Check the module's README file for details.

For the calendar module, you may need to get API keys for Google Calendar or iCloud Calendar and configure them in the module's config.js file.

  1. Add the module name to config.js

Open your MagicMirror config.js file:

nano ~/MagicMirror/config/config.js

Add the module name to the modules array, like:

modules: [
    module: 'calendar',
    position: 'top_left',    
  1. Restart MagicMirror

For the module to appear, restart your MagicMirror:

pm2 restart mm

The new module should now be visible on your mirror display!

Repeat these steps for any other modules you want to add. With tons of great modules available, you can customize your smart mirror however you like!

Style and Customize the Interface

To make your smart mirror look amazing:

  • Edit the custom.css file to add any CSS styling rules you want.
  • Set position and width/height for module placement.
  • Add custom fonts, colors, and backgrounds.
  • Use ModuleScheduler to set when modules display.

Experiment with different looks until you have an awesome smart bathroom mirror!

Step 4 - Construct the Physical Frame

To mount the hardware, we'll need to build a physical frame:

Prepare the Display

  • Disassemble an old monitor or laptop screen to extract the LCD panel.
  • Carefully detach any plastic casing without damaging the panel.
  • Connect a display controller board to power on the backlights.

Build the Mirror Frame

  • Cut a piece of plywood, MDF, or other material to size for mounting.
  • Paint or finish the wood frame and edges nicely. This will be visible.
  • Drill holes to mount the LCD panel, Pi, and any boards to the back.

Attach the Two-Way Mirror Film

  • Acquire a two-way mirror film sheet or glass.
  • Carefully apply the film over the display, ensuring no bubbles or creases.
  • Consider using a thin bead of silicone around the edges to hold the film.

Final Mounting of the Frame

  • Attach French cleat hangers or mounting brackets onto the back.
  • Securely affix the frame to the wall or medicine cabinet.
  • Ensure all hardware and cables are firmly attached.

Step 5 - Finishing Touches

To complete your smart bathroom mirror:

Add Automatic Power On/Off

Use crontab to schedule power on and off:

# Edit crontab
crontab -e

# Add lines:
0 7 * * * /usr/bin/DISPLAY=:0 /usr/bin/node ~/MagicMirror/  
0 22 * * * /usr/bin/DISPLAY=:0 /usr/bin/node ~/MagicMirror/

This will turn on at 7 am and off at 10 pm daily.

Autostart on Reboot

Install pm2 to launch MagicMirror² when the Pi boots:

sudo npm install -g pm2
pm2 startup
pm2 start ~/MagicMirror/

Clean Up Wires

  • Neatly route and hide any loose cables behind the frame.
  • Use cable management clips or staples to keep wires together.


If you follow this guide, you should now have an awesome smart mirror in your bathroom for easy access to date, time, weather, news, and more!

Building your own smart mirror is a fun electronics project that adds high-tech convenience to your morning routine. And using the MagicMirror² platform allows for tons of customization and expansion possibilities.

So try out some different modules and make your smart bathroom truly unique. The options are limitless!

Spread the Word: Share this Post!

Leave a Reply

Your email address will not be published. Required fields are marked *