-
Notifications
You must be signed in to change notification settings - Fork 63
Home
Get Tweets, Slack messages, PushBullet notifications, or IFTTT triggers when appliances begin or end their cycles
These instructions are for a simple Raspberry Pi project that can make any old appliance smart, without having to operate on the appliance. Just stick this tiny monitor onto it!
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.
This works on clothes washers and dryers, dishwashers, garage door openers, fans, furnaces, and other machines that vibrate.
- A Raspberry Pi Zero. Or any Raspberry Pi. (In the U.S., see if there's a Micro Center nearby. They'll sell you a single Zero at cost.)
- Any old MicroSD card. 2GB is plenty.
- WiFi! A Raspberry Pi A/B/2 will need a USB WiFi dongle. My classic Pi Zero needs a dongle and a MicroUSB adapter. If you have a Raspberry Pi 3 or Raspberry Pi Zero W, you already have WiFi.
- An 801s vibration sensor module You'll want one with a voltage (+V), ground (-V), and digital signal pin. Mine has an extra analog sensor pin that I'm effectively ignoring.
- Any 1 amp microUSB power source (What most phones and tablets from the last 10 years use)
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!
-
Download Raspbian Jessie Lite and image it onto an SD card
-
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).
-
Add an empty file named
ssh
to the boot partition. This enables the ssh daemon. -
Edit these files on the OS partition:
- Edit
/etc/hostname
and/etc/hosts
to change “raspberrypi” to a unique host name - Edit
/etc/wpa_supplicant/wpa_supplicant.conf
to add your WiFi authentication:
network={
ssid="your WiFi name (SSID)"
psk="your WiFi password"
}
Your OS should now be ready to boot and automatically jump on your home network!
-
Insert the microSD card into the Raspberry Pi.
-
Add the WiFi dongle to Raspberry Pi USB port. A Raspberry Pi Zero will need a microUSB adaptor.
-
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 vibrate everything.
- 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
)
After you ssh to the pi, install a few essential libraries:
$ sudo apt-get install python-pip
$ sudo pip install requests tweepy slackclient
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.
- If you want PushBullet notifications, create a PushBullet Access Token key here
- If you want Twitter notifications, create Twitter API keys here (Steps 1-4):
- If you want Slack notifications, create a bot user or create a Slack webhook
- If you want an IFTTT trigger, create a new trigger with the Maker channel and note the channel and key.
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 &
Multiple sensor expert mode: Add and additional line for each additional sensor. One for each settings file.
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.