Raspi-powered seismometer/seismograph

57 posts   Page 2 of 3   1, 2, 3
by pdenton » Mon Jul 09, 2012 12:25 pm
The python based scripts (called miniseis)were written by Jon Gilbert last year as part of his coursework at Edinburgh University. They take data from an SEP digitiser (which just produces a stream of 16 bit numbers 20 times per second onto a serial port). The code was originally written to work with the SHEEVA plug computer (an embedded linux system). The serial data comes into the SHEEVA through a USB-serial convertor. I see no reason why this should not port easily to the RasPi ( do not know whether we would need to use a USB-serial convertor or if the RAspi could read serial data directly on GPIO pins.)

The raw data is stored locally in both raw binary format (as read by Amaseis software) and also as a compressed format called miniseed (as used by seismologists all over the world). The code also broadcasts data live over a TCP connection using the same server-client protocols that AMaseis uses. It can also send data in packets to a remote web server using HTTP push. The software makes use of the Obspy python package for writing miniseed and some other functions


also see http://alomax.free.fr/seisgram/SeisGram2K.html for platform independant (java) seismic analysis code which reads seismic data in miniseed format

All code is open source

please feel free to email me directly if you have any queries or just to let me know how you are getting on (pdenton@bgs.ac.uk)

you might also be interested in Graeme Keon's work on using soundcards to record seismic signals
http://motivationtolearn.org/wordpress/ ... #more-1100. He uses a uses a 555 chip to modulate an audio frequency carrier with low frequency seismic signals and then record them on a cheap soundcard.
Posts: 3
Joined: Thu Jul 05, 2012 12:52 pm
by dgoadby » Tue Jul 10, 2012 6:29 pm
All good and gratefully received.

I already have the RPi serial port sorted out but I really want to use the I2C interface for capture if possible to simplify the process as much as possible. One option is to use the RPi with I2C to capture, filter and store the data and then the serial interface to emulate the SEP digitiser and feed it to an Amaseis. I will also be able to create data in miniseed format for compatibility with other systems when I reach the sharing stage.

Some of the code looks like it could be real time-saver. All of my code will also be available as open source and I will submit any changes/derivatives to the source groups as well.

The seismometer hardware is now done and I am just sorting out the low volume airtight lid before starting sensor tests. The electronics will be ready soon afterwards and then the RPi fun starts ;-)

I will contact you directly about items not relevant to this list.
Posts: 10
Joined: Sat Mar 03, 2012 2:49 pm
by allenfr » Sun Dec 16, 2012 1:10 am
Progress on this topic at all ?
Posts: 2
Joined: Sun Dec 16, 2012 12:47 am
by dgoadby » Sun Dec 16, 2012 12:34 pm
Oh yes; I'm still tweaking the mechanics and the electronics to try and get a stable platform. I think I'm about there so the RPi interface is now on the bench.

I have a Wifi AP in range of where the seismometer will be permanently sited and a large solar cell designed for charging car batteries which should keep the whole thing running 365/24/7.

I will post an update once I have the RPi side up and running.
Posts: 10
Joined: Sat Mar 03, 2012 2:49 pm
by allenfr » Sun Dec 16, 2012 2:10 pm
Good to know. I would be interested in your mechanical side.
Posts: 2
Joined: Sun Dec 16, 2012 12:47 am
by dgoadby » Mon Dec 17, 2012 1:43 am
It's a version of a fairly standard design called a Shackleford-Gundersen Seismometer. This is a 1975 design but I have updated the electronics and done all of the later improvements. A lot of folks build what is called a "swinging gate" design attributed to Lehman and it works well too but the SG unit has a smaller footprint and I just like the design better.
Once things are starting to "join up" convincingly I will post more along with some photos and, of course, the source code.

Posts: 10
Joined: Sat Mar 03, 2012 2:49 pm
by ChucktheTinkerer » Thu May 02, 2013 11:44 pm
Hi Folks:
I hope you have a good experience putting together an earthquake seismometer.
This link,
http://www.jsasoc.com/diamagnetic_suspe ... smomet.htm
describes a VERY SIMPLE novel seismometer, using a pure graphite rod suspended
in a strong magnetic field. It responds to displacement, not velocity.
There are several design issues that need to be solved to make this work properly.
I tinkered with this but lost interest. I hope someone else takes up the project.

BTW I don't think you need lots of dynamic range in your ADC. Just look at (analog) earthquake records from years ago. They managed just fine with line widths of about 1 mm and chart widths of
about 300 mm, which is equivalent to about 8 bit resolution.
In modern times there are lots of interesting cheap ways to do the ADC.

Posts: 6
Joined: Thu May 02, 2013 11:28 pm
by meltwater » Thu Feb 27, 2014 12:06 pm
The schools seismograph project at http://www.bgs.ac.uk/ssp looks really promising.

I'm interested to see what electronics could be produced in order to support it and produce a low cost circuit to provide input into the Raspberry Pi (I imagine such a circuit could have multiple uses - ECGs etc). Imagine what could be done with the data using the new wolfram mathematica support.

@pdenton - ( do not know whether we would need to use a USB-serial convertor or if the RAspi could read serial data directly on GPIO pins.)
Yes - You can read serial data directly on the GPIO pins (P1 TX Pin8 and RX Pin10 are serial pins), you just need to disable the serial console first.

Interested to know what solutions would work well with this, would a multi-channel lower resolution ADC work, where each channel is set to sample specific ranges. Also what circuits are suitable for amplifying the original seismograph signal.
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 1013
Joined: Tue Oct 18, 2011 11:38 am
by pdenton » Thu Mar 06, 2014 2:10 pm
we are getting there slowly with the raspberry pi seismograph. At the moment we have datalogging/viewing and analysis code running on the Raspi taking data from a USB ADC system produced by http://www.mindsetsonline.co.uk product SEP064 £59.95 The input into this ADC can be a simple homemade seismometer (at the moment I am using a simple mas on a spring design using a 0.5m perspex tube, a mini-slinky with a magnet/weight on the end and a simple coil as the sensor) The system works well as a 1hz seismometer and detects UK earthquakes very well... it can aslo detect large (>M7) events on the other side of the world but only the P waves. Seismometers like this can easily be made at home or made for about £20. We would like to reduce the cost of the ADC system and are working with mindsets to try and halve the cost of their ADC (and make it fit to the GPIO rather than USB) The adafruit 16bit ADC is very nearly good enough but lacks sensitivity for the signals we are measuring.

We will be trialling this kit in some local schools over the next couple of months and hope to be able to promote widely later on this year.

If you know of anyone interested in testing or helping development of this system please put them in touch. (either via this forum or direct to schoolseismology(_at_)bgs.ac.uk
Posts: 3
Joined: Thu Jul 05, 2012 12:52 pm
by BryanKerr » Mon Mar 10, 2014 6:29 am
I'm in the States, but I'd be interested in helping out anyway I can. I've just requested that our school K-12 school purchase one of the TC-1 slinky seismometers. If I don't get it approved, I just might build it myself anyway. I'm just about to start to diving into the Raspi, but I've got an MS in geophysics, and worked on several passive and active imaging survey's when I was in school.
Posts: 1
Joined: Mon Mar 10, 2014 6:13 am
Location: California, USA
by jbeale » Tue Mar 11, 2014 12:31 am
pdenton wrote: The adafruit 16bit ADC is very nearly good enough but lacks sensitivity for the signals we are measuring.

Is it the minimum-signal sensitivity or the dynamic range that is limiting you? If the latter, you need more ADC bits but if the former, op-amps are pretty cheap and can bring up your signal level before the ADC, unless you are already near full-scale with the ambient background signal.
User avatar
Posts: 3249
Joined: Tue Nov 22, 2011 11:51 pm
by ChucktheTinkerer » Sun May 18, 2014 12:52 pm

I followed with great interest your account of developing an earthquake seisimograph.
I enjoy making geophysical equipment, especially with the new little computers.

This fellow is recording his seismic signals using an Arduino. The Arduino has the advantage
of 1. built in ADC, 2. Easy to operate without a terminal. He has a good explanation of his signal processing.
https://www.physics.auckland.ac.nz/rese ... 52_1-1.pdf

This fellow built a nice simple seismograph and records on a PC. But you have to deicate the PC to the task.
http://motivationtolearn.org/wordpress/ ... #more-1285
hardware details are at http://motivationtolearn.org/wordpress/?p=530

I think the Arduino is a better choice than the Raspberry Pi.

Chuck Young
Posts: 6
Joined: Thu May 02, 2013 11:28 pm
by meltwater » Sun May 18, 2014 2:37 pm
Possibly an Arduino in combination with a Raspberry Pi would be suitable, with the Raspberry Pi taking over the role of the PC in your example.
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 1013
Joined: Tue Oct 18, 2011 11:38 am
by ChucktheTinkerer » Sat Dec 13, 2014 3:22 pm

I don't know if you are still working on your earthquake seismometer, but here are a couple URLs I found that
look promising:

Lehman style seismometer and a clever way to do the analog to digital conversion using the sound input to the computer:

Seismometer sensor using a weight on a "slinky" spring:
http://scholarworks.boisestate.edu/cgi/ ... eo_facpubs

Posts: 6
Joined: Thu May 02, 2013 11:28 pm
by Elven Decker » Sun May 03, 2015 10:04 pm
I have created a small seismograph using a speaker coil and have been storing information on an RPi for a few months now.

Signal comes to the RPi through a BEHRINGER U-PHONO UFO202 USB interface set to receive phonograph data (the Behringer thinks it's processing phonograph data), and is parsed through a SOX command from the following script that runs once every 24 hours:

#get a file name
filename="raw_data/"`date --rfc-3339 date`".wav"
# script to record 24 hours minus a second from the usb sound input
arecord -D hw:1,0 -d 119054 -f S16_LE -t raw | sox -b 16 -e signed-integer -r 11025 -t raw - -r 20 $filename

You can read the .wav files directly in audacity or convert them to text files for analysis.

I haven't been using it for much once I realized that my house was vibrating constantly due to a nearby highway. :)

Hope this can help someone.
Posts: 2
Joined: Sun May 03, 2015 9:45 pm
by meltwater » Mon May 04, 2015 1:04 pm
Excellent projects, certainly would be great to give these a try. Please post more info if you write these projects up.
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 1013
Joined: Tue Oct 18, 2011 11:38 am
by tonystrange » Sun May 31, 2015 4:12 pm
I have been using using the off-the-self solution (mentioned earlier in these posts) of
the Mindset slinky seismometer
the Mindset USB ADC
and jAmaseis (http://www.iris.edu/hq/jamaseis/)

This worked fine with a PC. I wanted to replace the PC as a longer term solution, but I seemed to have difficulties with a Pi 1. However, after some help from BGS (http://www.bgs.ac.uk/schoolseismology) and Redfern electronics, I have managed to see it working apparently successfully on the Pi 2. (a much cheaper and lower powered solution). It was necessary to install jAmaseis
and also librxtx

sudo apt-get install librxtx-java

java -Djava.library.path=/usr/lib/jni -cp /usr/share/java/RXTXcomm.jar -jar -Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0 jAmaseis.jar
Posts: 3
Joined: Thu Jul 03, 2014 9:16 pm
Location: Suffolk
by BudBennett » Sun Jun 07, 2015 5:15 pm
I'm ready to begin a seismometer project. I'm trying to keep the cost as low as possible while still yielding a reasonable instrument. My expertise in in electronics but the mechanical stuff is more problematic. So far I have only roughed out a hardware approach -- I'm hoping to use some ready-made piece of code for display/analysis purposes. This is the only post in the forum for seismometers, so I don't think I need a new thread until I get more specific.

Here’s some thoughts on my seismometer project:


A short period seismometer would be easier to manage than a long period. I figure a 1 or 2 second period is acceptable. It might be possible with post-processing to extend the period, but I am not sure about that. I also have no immediate plans to make it into a broadband unit, which would require additional electronics and a motor to keep the mass stationary. The sensor interface that I am planning is generally incompatible with a force-balance approach anyway. I want to keep the cost and complexity of the mechanical system to a minimum -- just to prove the concept of the sensor and it's interface. Later, if things go well, I can splurge on a better mechanical system.


In keeping with the low cost easy-to-make philosophy, I think that this link (http://www.instructables.com/id/This-Seismometer-is-no-toy/?ALLSTEPS) is an appropriate fist effort. It is a Lacoste pendulum. The post and base are painted wood. the most expensive component is the 1/8” thick aluminum boom and magnets for the damping mechanism.
Seismometer plan
Lacoste2.jpg (53.18 KiB) Viewed 3214 times

But the sensor magnet would be replaced with the capacitance displacement sensor - probably hanging the middle plate inline with the boom axis (which might cause other problems…) and a lead mass. Dr. Peters patented this sensor in 1995, so it has most probably expired by now. The middle plate must be grounded - this can be accomplished by using the boom as a conductor and just grounding the plate where the hinge is attached. I figure a capacitive displacement sensor will have much better low frequency performance than a magnetic acceleration sensor.

This is Dr. Peters’ Volksmeter link(http://www.rllinstruments.com), where you can find a bit about the theory of his product, including the Synchronous Differential Capacitance sensor. I will be using the AD7745 Capacitance to Digital Converter -- it converts a +/- 4pF range into 24-bits of resolution (ENOB=21bits). It uses the I2C interface of the Pi. The conversion rate can be as high as 10ms, but 62ms is enough to yield a Nyquist rate of 8Hz.

Here's the sensor patent link(http://www.google.com/patents/US5461319). And a link to the AD7745 data sheet (http://www.analog.com/en/products/analog-to-digital-converters/ad-converters/ad7745.html).

I created an spreadsheet that calculates the size of the sensor vs. the required sensitivity. Most of the literature that I’ve read indicates that 1nm displacement resolution is an acceptable goal. I don’t think we can get there with a reasonable size sensor area. My initial calculations show that about 10-20nm displacement is a good first order target.
Capacitor design Spreadsheet
Spreadsheet.jpg (53.71 KiB) Viewed 3214 times

I can get 6”x6” single sided FR4/1oz copper boards for about $3 each from Tayda Electronics. The middle sensor requires double sided copper - about $4 for 6”x6” board. I plan to cut the outer plates with an exacto knife and route out the sections of the middle plate. No shielding is planned. If shielding is required a simple faraday cage can be mounted around the five open sides of the sensor unit. This ideal method to create the capacitance sensor is to fabricate them as PCBs, but at $5/sq. inch this becomes very expensive.


The capacitance to digital converter circuit is pretty simple.
Cap2Dig Schematic
schematic2.jpg (52.17 KiB) Viewed 3214 times

I will order 2-sided boards from OSH Park - a 0.93”x1.32” board is about $6.14 for 3 copies. Here’s the BOM breakout:

Board - $2
AD7745 - $11.28
LD2981 - $0.66
discretes - $free (I already have all of them in quantity)
2x13 header (stackable) - $0.75
Shipping - $1.18 ($3.54/3)

Total sensor interface cost - $15.87

I am a rank beginner at the seismometer game, so if you see any glaring errors please let me know.

Posts: 72
Joined: Fri May 17, 2013 2:45 pm
Location: Westcliffe, Colorado, USA
by danville » Sat Jun 13, 2015 8:46 am
I would also like a copy of any seismic datalogging code for Raspberry Pi. I have given Jamaseis a try on the the Pi 2. However, the lack of ARM support has hindered my progress.
Posts: 1
Joined: Sat Jun 13, 2015 8:41 am
by ChucktheTinkerer » Sat Aug 01, 2015 1:15 am
Progress report for Raspberry Pi seismograph fans:

I just got my ADS1115 ADC from AdaFruit up and running in
a Python program. My prototype program (which needs more work) is detecting
vibrations from a Spregnether 1 Hz geophone on my office floor.
The ADS1115 is available for about $7.59 free shipping from DX Deal Extreme (from China ... slow delivery!)

I recently found an ADC that might be even better and even cheaper.
It is a HX711 and was made to be a strain gauge amp and ADC for digital scales.
I figure you hook up the seismograph as one leg of a resistor bridge.
These have programmable gain of 32, 64 and 128,
sampling rate of 10 or 80 sps, and a 24 bit output. Thus it shouldn't need a preamp.
It looks like you communicate with it with a bash program and it sends the data to your computer as a serial stream.
There is interfacing info at http://hivetool.org/w/index.php?title=I ... X711_to_Pi
Deal Extreme has these for as little as $1.89 (free shipping)!
Mine haven't arrived yet.

BTW someone just sold a Dyneer Sprengnether Instruments Seismometer on EBay for
$75 plus $46 shipping.

Posts: 6
Joined: Thu May 02, 2013 11:28 pm
by BudBennett » Thu Sep 17, 2015 6:59 pm
I have finally gotten to the point where I can talk about my home-built seismometer. I figure it’s either put up or shut up, so I have some plots of real quakes in this post.

It is constructed pretty much as per my previous posting. I replaced the box cutter blade hinge with a hinge that would better constrain the side-to-side movement since my sensor requires pretty tight tolerances (~1mm between plates). Since it uses a displacement sensor instead of a velocity sensor it is relatively easy to determine the sensitivity, which is about 0.32 nm per count of the ADC. The ADC RMS noise is about 40 counts so the sensor can resolve about 10-15nm of movement of the mass. That’s pretty much what I was shooting for.

It took a long time to make the sensor plates. In the future I will be having OSH Park make the outer plates, but it will cost about $150 for a set of five sensor plates. It’s worth $30/sensor to get more precision and spend much less time in construction and alignment.

The electronics just plugs onto the GPIO header of the Pi. I located the electronics outside of the seismometer enclosure to avoid the heat that the Pi generate. It turns out that the seismometer is EXTREMELY sensitive to temperature variation (and just about everything else.) This is to be expected when trying to measure nano-meter displacements. The seismometer must be placed in an enclosure to isolate it from air currents and room temperature variation. I made a box with an outer layer of 1 inch thick polyisocyanurate foam, inside that a layer of 1/2 inch thick sheetrock (drywall), inside that another layer of foam and sheetrock. The thermal time constant is roughly 12 hours so the phase of the temperature variation is 180 degrees from the normal diurnal variation. Even so, the sensor output varies about 500,000 counts during the day.
C2D module mounted on a B+ Pi.
SeismoElectronics-s.jpg (48.48 KiB) Viewed 2491 times

The displacement signal is bandpass filtered with an 0.03Hz IIR High-pass filter (to remove the drift due to temperature), and a 0.5Hz Gaussian FIR Low-pass filter. The sensor is sampled at 16.2Hz for a Nyqvist rate of about 8Hz.

The hard part was figuring out how to get the data from the ADC into a standard format used by the major seismic software packages. I took the path of least resistance: there is a open source package called “ascii2mseed” that takes 512 data samples in a formatted text file as input and then outputs a mini-seed binary file. From there another program called “ringserver” monitors a directory where the mseed files are deposited and makes the data available over the network to whatever client can read it. Once the data is available this way then almost any software package can use it, for display or analysis.

I researched quite a few packages, but only played with Earthworm and ObsPy, which run on Linux and Mac. I rejected Siesgram2k for viewing because it did not seem to allow much in the way of parameterization. I’m using seedlink-plotter, a python program, to display strip plots and drum plots of waveforms on my iMac screen. Seedlink-Plotter uses ObsPy so I think going forward I will be using ObsPy for all my analysis and waveform “picking”.

Here is a strip plot and drum plot of yesterday’s magnitude 8.3 quake off the coast of Chile.
Magnitude 8.3 off the coast of Chile yesterday.
20150915-Chile8_3-s.jpg (31.23 KiB) Viewed 2491 times

Drum plot of Chile quake.
20150916-17-1-s.jpg (53.83 KiB) Viewed 2491 times

Note that most serious seismometers are placed a few hundred feet below ground level to take advantage of less temperature variation and avoid wind noise (yes wind through trees get very noticeable above wind speeds of 10MPH.) My seismometer is located in the corner of the garage. During the night the garage cement slab generates “spike” noise that is evident on the drum plot. There is really nothing that I can do about that - just live with it. I started out with it located in the laundry room in the house, but every time the dog walked past or the dryer would run it record noise with amplitudes of around 500+ counts.
Posts: 72
Joined: Fri May 17, 2013 2:45 pm
Location: Westcliffe, Colorado, USA
by jbeale » Thu Sep 17, 2015 10:49 pm
Really impressive project, and results! Is there a picture that shows the construction of the pendulum and sensor part? I'm not sure if that's what's at the left hand side of the photo of the Pi, or not?
User avatar
Posts: 3249
Joined: Tue Nov 22, 2011 11:51 pm
by BudBennett » Thu Sep 17, 2015 11:12 pm
Here are a few photos of the seismometer, hinge and sensor. I think you can tell how it is put together from these.
Working prototype
WorkingPrototype-s.jpg (33.92 KiB) Viewed 2431 times

Hinge-s.jpg (19.65 KiB) Viewed 2431 times

Sensor view
SideViewOfSensor-s.jpg (26.11 KiB) Viewed 2431 times

I built two hinge types: the hinge shown uses blister pack plastic as the flex material. I had tried strips of aluminum (aluminium?) from a soft drink can, but they deformed; I also tried .008 inch piano wire but it would not restrict movement laterally. The plastic is "springy" and should not add much friction. The other hinge uses two tips from ball point pens inserted into dimples in an aluminum plate: very low friction, but it is a bit skittish if the pen tips don't align perfectly with the dimples.

The sensor is three plates of single- and double-sided FR4 with the copper foil removed by hand to make the proper sensor geometry. The middle plate attached to the beam just slides between the two outer plates to vary the capacitance with the area of the plate overlap. If I had it to do over again (and I probably will) I would have the outer plates fabricated as printed circuit boards.

The mass is just a tomato paste can filled with lead fishing weights. The base and post are cherry plywood that I happened to have laying about. The beam is an aluminum edge channel for 3/4" plywood that you can purchase at Lowes for about $10.

The most expensive piece is the four magnets that form the eddy current damping mechanism - $30.
Posts: 72
Joined: Fri May 17, 2013 2:45 pm
Location: Westcliffe, Colorado, USA
by jbeale » Fri Sep 18, 2015 4:59 am
Great stuff! all seems very straightforward to construct. It is surprising that a plastic hinge works the best. It is amazing that you can get down into the nanometer region with these homebuilt sensors. The ballpoint-pen pivot is a great idea, maybe it just needs a larger V groove to sit in, to be more stable? If you want to try to reduce the cost, I made a pendulum damper with a magnet assembly from an old 5-1/4" hard drive, which worked OK; there's a photo of it here: http://dangerousprototypes.com/forum/vi ... =56&t=7380 This was from my junk box but you can sometimes find these old hard drives cheap/free.
User avatar
Posts: 3249
Joined: Tue Nov 22, 2011 11:51 pm
by BudBennett » Fri Sep 18, 2015 2:59 pm
I can't claim the ball point hinge as mine. Dr. Peters suggested it a while ago and I thought that I'd try it. Here's a detail of the hinge:
ballpoint hinge detail
ballpointHinge-s.jpg (52.47 KiB) Viewed 2307 times

I used two "free" pens from the local bank. Ripped the ink tubes of of the tips and epoxied them into a modified U-channel piece. The two hinges must be interchangeable since I only wanted to make one seismometer.

The problem with the pen tips resting in the two dimples is that a minuscule misalignment causes the hinge to jitter because one of the pen tips is not sitting at the bottom of the dimple. Perhaps a better alignment method would be to create a v-groove the length of the aluminum plate and center punch a spot where you want one side of the hinge to register. Then the registered ball point stays put while the unregistered ball point tip slides along the groove - keeping the hinge aligned.

I can probably do this with a table saw, but the thought of running a piece of aluminum across a carbide toothed saw blade is truly scary.
Posts: 72
Joined: Fri May 17, 2013 2:45 pm
Location: Westcliffe, Colorado, USA