Russell Grokett
Published © GPL3+

Earthquake Pi - Shake And Rattle Your Desk!

Your own private Earthquake-in-a-Box. Using USGS data, it rattles its box, flashes LED to the magnitude, displays info on LCD & plays sound.

AdvancedFull instructions provided6 hours1,962
Earthquake Pi - Shake And Rattle Your Desk!

Things used in this project

Hardware components

Raspberry Pi Zero
Raspberry Pi Zero
Or other Raspi will work!
×1
Ethernet connector or WiFi dongle for Raspberry
×1
I2C LCD 20 char x 4 line display
×1
Breadboard (generic)
Breadboard (generic)
×1
Wooden Box such as from craft stores like Michaels
×1
5v 2amp power supply for Raspberry (2amp if using all options)
×1
Adafruit vibrating motor such as from an old battery toothbrush (see below) or
×1
Resistor 330 ohm
Resistor 330 ohm
×1
1n4001 or similar diode
×2
General Purpose Transistor NPN
General Purpose Transistor NPN
×1
Adafruit Neopixels LED stick 8x5050 RGB LED
×1
External Speaker and Amp for Raspi
(not for Raspi Zero!)
×1
Adafruit I2S 3W Class D Amplifier
For Raspi Zero only
×1
Speaker: 3W, 4 ohms
Speaker: 3W, 4 ohms
For Raspi Zero only
×1

Software apps and online services

Raspian Jessie OS
Python 2
EarthquakePi software from Github

Story

Read more

Schematics

GitHub for EarthquakePi

See EarthquakePi.pdf for full diagrams and details

Code

Code snippet #2

Plain text
$ cd /home/pi$ sudo apt-get update
$ sudo apt-get install build-essential git
$ sudo apt-get install python-dev python-smbus python-pip
$ sudo pip install RPi.GPIO
$ sudo apt-get install i2c-tools

Code snippet #9

Plain text
############ USER VARIABLESDEBUG = 1 # Debug 0 off, 1 on
LOG = 1 # Log Earthquake data for past 15 min
MINMAG = 1.0 # Minimum magnitude to alert on
AUDIO = 1 # Sound 0 off, 1 on
MOTOR = 1 # Vibrate Motor 0 off, 1 on
MOTORPIN = 16 # GPIO Pin for PWM motor control
NEOPIXEL = 1 # 1 use Neopixel, 0 don't use Neopixel
NEO_BRIGHTNESS = 64 # Set to 0 for darkest and 255 for brightest
## OTHER SETTINGS
PAUSE = 60 # Display each Earthquake for X seconds
WAV = "/home/pi/earthquakepi/earthquake.wav" # Path to Sound file
DISPLAY = 0 # 0 Turn off LCD at exit, 1 Leave LCD on after exit
########### END OF USER VARIABLES

GitHub for EarthquakePi

Github

https://github.com/rgrokett/earthquakepi

Credits

Russell Grokett

Russell Grokett

10 projects • 12 followers
Interests: Astronomy, Scuba, Caving, Electronics, Web, Coding, Ham Radio, Sci Fi, IoT

Comments