Home

Awesome

Raspberry Pi Appliance Monitor

Get Tweets, Slack messages, Pushover or PushBullet or MQTT notifications, IFTTT triggers or Telegram messages when "dumb" appliances begin or end their cycles

Raspberry Pi Appliance Monitor just sticks onto an appliance, so no damage is done, no warranties are voided. (That makes it Landlord Safe!)

Raspberry Pi Appliance Monitor makes use of the nicely sensitive 801s vibration sensor. It will detect faint shaking and if the shaking lasts a specified amount of time, it will assume that the appliance is running.

On Phone

This works on clothes washers and dryers, dishwashers, garage door openers, fans, furnaces, and other machines that vibrate.

Needed parts:

Parts

Step 1: Create the OS

Note: We can skip plugging the Pi into a TV and keyboard by configuring the SD card directly from your computer. If you'd rather do this directly from the booted Pi, that works too!

  1. Download Raspberry Pi OS Lite and image it onto an SD card

  2. Mount the SD card on your computer. There should be two partitions, a FAT32 boot partition, and an EXT3 OS partition. On Mac or Windows, you may need to find a driver to see EXT3 partitions (see links).

  3. Add an empty file named ssh to the boot partition. This enables the ssh daemon when it boots.

  4. Edit these files on the OS partition:

country=us
update_config=1
ctrl_interface=/var/run/wpa_supplicant

network={
 scan_ssid=1
 ssid="your WiFi name (SSID)"
 psk="your WiFi password"
}

Your OS should now be ready to boot and automatically jump on your home network!

Step 2: Create the hardware

  1. Insert the microSD card into the Raspberry Pi.

  2. If your Raspberry Pi does not have onboard WiFi, add the WiFi dongle to Raspberry Pi USB port. A Raspberry Pi Zero will need a microUSB adaptor.

  3. Add the 801s Vibration Sensor to Raspberry Pi GPIO pins. The pins of my sensor line up perfectly with 5V, GND, and GP14. I'll be ignoring the analog pin that found its way into GP15. You can rest the pins in place initially. When everything is working, solder or tape them into place.

Multiple sensor expert mode: Connect additional vibration modules to the same (or any) 5V and GND pins, but a different sensor GPIO pin. You'll want to use a very flexible or long cable, so one vibrating sensor doesn't shake everything.

  1. Plug in a power source, and you’re good to go. Within a few seconds, you should be able to connect to the Pi with:

    ssh pi@{unique host name}

(password: raspberry)

Sensor inserted

Step 3: Create the software

After you ssh to the pi, create the requirements file /home/pi/requirements.txt.

Continue to install a few essential libraries:

$ sudo apt-get install python-pip
$ sudo pip install -r requirements.txt

Set the timezone to make sure timestamps are correct

$ sudo raspi-config
[Internationalisation Options]
[Change Timezone]

Create the program file /home/pi/vibration.py (Click to view)

Create the settings file /home/pi/vibration_settings.ini. This file specifies what sensor pin to monitor, what messages you want, and what services to send the message to.

Multiple sensor expert mode: Create additional settings files with their own timings, messages, and unique sensor pins. One for each sensor.

Simple Install

Edit /etc/rc.local to make the program run when the device boots up.

Add before the exit line:

python /home/pi/vibration.py /home/pi/vibration_settings.ini &

Advanced Install

If you want to manage multiple sensors, or track the script as a systemd service, a service file has been provided.

sudo cp /home/pi/rpi-appliance-monitor@.service /etc/systemd/system
sudo systemctl enable --now rpi-appliance-monitor@vibration_settings

Multiple sensor expert mode: Add and additional line for each additional sensor. One for each of the settings files you created.

You’re done! Reboot and test it out.

Some mounting tape or Sugru will let you stick the device somewhere discrete on your appliance.

If you’ve soldered the sensor pins, you can bend the sensor to be flush with the Pi.

Completed device

Optional tuning that you can probably skip over

If your monitor is too sensitive and triggers when someone is just walking around the house:

Look for a potentiometer that looks like a screw head on your 801s sensor. Give it a little twist (probably in the "unscrew" direction) to make it less touchy. If that doesn't help, read on...

If your monitor triggers multiple events during one appliance usage:

Your appliance may have a rest cycle. Modify your settings file to change seconds_to_end to a larger number. It should be longer than the rest cycle.