Creating an earthquake warning system with littleBits and PubNub


Maker replicates California’s earthquake warning and monitoring system using littleBits, Ruby and PubNub.


In the wake of the tragic 2011 Tōhoku earthquake and tsunami, Anmol Agrawal decided to create a mini earthquake warning and monitoring system using littleBits, Ruby and PubNub.

Photo-Feb-21--6-01-56-PM

As the the Maker notes, this DIY solution — which also happens to be among the latest entries in this year’s Hackaday Prize — could be be employed to detect both earthquakes and tsunami in prone areas.

“My initial approach was to get some data through online resource like meteorological survey websites, as they are the ones with access to all the sensors, devices, machines, seismographs etc. to keep track of earthquake activities. I planned on getting that data continously and running the logic continously like if earthquake is more than 5.3 richter scale, send the warning,” Agrawal writes.

He decided to take this one step further by creating a system specifically for India. This was accomplished by acquiring the data of seismic activity for the country, which was completed by crawling the India Meteorological Department’s earthquake report every 10-20 seconds.

The Maker adds, “Although that is a very inefficient method but I still wrote the script. I got it working but then I thought, is the data updated on the page in real-time or after couple of hours? If the earthquake comes somewhere at 6pm and it’s getting updated on the site at 8pm, then that data is of no use.” large_filled_eewbasics

After some research, Agrawal came across the earthquake early warning system currently in use in California, and decided to replicate it with an Arduino littleBits module (ATmega32U4), Ruby and PubNub. He employed a littleBits pressure sensor to create the earthquake effect based on the strength of his finger’s touch and a bright LED to serve as the warning signal. The data is continuously measured, streamed and sent to PubNub using a dashboard created with Freeboard.io.

“To give an idea of how fast this system is, in recent the Nepal Earthquake, it would have given a three-five minute early warning to Kathmandu and surrounding cities as epicenter was only 70-140km away from them,” he concludes.

Interested? You can read up on the Maker’s entire build here.

1 thought on “Creating an earthquake warning system with littleBits and PubNub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s