Send live earthquake data to hardware over serial
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Earthquake Converter

Pulls live earthquake data from the US Geological Survey site and sends information about each event to connected serial devices.


Installation on Raspberry Pi B+

With ResinOS:

ResinOS offers a stripped down operating system which starts up quickly, restarts the app when it fails, and is more robust to filesystem corruption.

  1. Download ResinOS for Raspberry Pi 1
  2. Extract and install ResinOS image on micro SD card. Etcher is a really good tool for this.
  3. Connect Raspberry Pi to network and power
  4. Install the resin device toolbox (npm install -g resin-device-toolbox)
  5. Run rdt push in the root of this repo and select your Raspberry Pi when prompted

On Top of Raspbian:


  • Node.js (v5 or greater)

    • On Raspberry Pi B+ running Raspbian you can install with curl | tar --strip-components 1 -xvz -C /usr/local --exclude='' --exclude='LICENSE' --exclude=''
    • On Raspberry Pi 3 running Raspbian you can install with curl | tar --strip-components 1 -xvz -C /usr/local --exclude='' --exclude='LICENSE' --exclude=''
  1. Clone the repo (git clone
  2. cd earthquake-converter
  3. npm install
  4. node src

Serial Protocol

When earthquakes occur the time, magnitude, latitude, and longitude will be written to the first serial port found, in that order. The values will be floats separated by a single space and terminated with a newline. Time is given as seconds since 00:00:00 UTC (Unix Time). Magnitude is measured on the Richter scale.

There is a newline sent at the start of the program to make it easier to reset state in the hardware.

For an example of parsing this data with an Arduino take a look at the earthquake-light firmware in the examples directory.

Using With Raspberry Pi Hardware Serial

First make sure that the serial port is not configured to be connected to the kernel message buffer. To accomplish that you can run sudo raspi-config and then select "Advanced Options" -> "Serial Enable/Disable shell...". After a reboot the hardware serial port should be free to use. Find the path to the port and then run the earthquake converter with node src --port /dev/your-port.