Smart Mirror Documentation
  • Introduction
  • Hardware
  • Installation
    • Install Raspberry PI OS
    • Install dependencies
  • Configuration
    • Configure the Pi
    • Configuring Sound
    • Cloud Speech Recognition
    • First Time Running Smart Mirror
    • Configure the smart-mirror
  • Running
    • Setting up Smart-Mirror to Run on Boot
    • Commands Used to Run Smart-Mirror
  • Troubleshooting & FAQs
    • Issues installing electron-prebuilt
    • Microphone and Speech Recognition issues
    • Issues with Remote and ConfigUI
  • Development and Contributing
  • Updating
  • Index
  • How Tos
    • How To Obtain Chromium Speech Keys
    • How To Install Raspberry Pi OS(full)
    • Enabling Motion Detection
Powered by GitBook
On this page

Was this helpful?

  1. How Tos

Enabling Motion Detection

PreviousHow To Install Raspberry Pi OS(full)

Last updated 3 years ago

Was this helpful?

#Enabling Motion Detection

WARNING: Only compatible with Raspberry Pi

#####Do not enable or attempt to install on any thing other than a Smart-Mirror compatible Raspberry Pi Device.

Installing Dependencies

Motion Detection requires Johnny-five.io as well as Raspi-io.

make sure you're within the smart-mirror folder.

cd ~/smart-mirror

from the smart-mirror folder run the following command.

npm install johnny-five && npm install raspi-io

Configuration

Use the Motion Settings of the ConfigUI to configure and enable the motion detection after installing dependencies.

Variable
Usage
Data Type
Default Value if not included in config.js

pin

Identify GPIO input Pin connected to output pin of the PIR device or other device used to detect motion

string

GPIO26

enabled

enable motion detection

boolean

false

Making it all work

Parts required

  • (optional!) LED (color of your choice)

  • (optional!) Resistor (based on draw of LED)

Wiring Diagram with LED

Wiring Diagram without LED

Basic Functionality

Motion detection works with AutoTimer Settings. Using Johnny-Five's motion API the PIR device is connected to a PIN on the Raspberry Pi. Suggested PIN is GPIO 26 as illustrated in figure 1 and figure 2 above. When the motionstart event is triggered the auto-sleep timer is stopped and will remain stopped until the motionend event is triggered. When the motionend event is triggered the auto-sleep timer is started and set to the config.autoTimer.autoSleep interval set in configUI.

Issues

[figure 1]

[figure 2]

A live chat to get help and discuss mirror related issues: . Usually there are a few folks hanging around in the lobby, but if there aren't you are probably better off . Please tag @justbill2020 on any motion detection issues.

PIR Device
discord chat
filing an issue
figure 2
figure 1