Cheap seismometer using sound card and Amaseis – now running under Windows

After about a year and a half of messing around, I finally got this very cheap seismometer system working and displaying real-time data under both Windows and Linux (More on how to set up Linux later.) Educationally, it has great potential.

It consists of the sensor and an interface box. This interface is radically different from traditional digitizing methods. The earthquake signal, after being amplified, then modulates a fixed 5 KHz audio tone. That plugs into the microphone socket of a computer running three pieces of software under Windows (XP in the one shown here). They are, 1) the one I put together – “seismochop”, which retrieves the earthquake signal from the audio tone and converts it to serial data, 2) a virtual serial port package called com0com which acts as a relay, and 3) Amaseis – software that records and displays earthquake data. These three can be downloaded free.

This very cheap and rather unusual way to digitize an earthquake signal was inspired by my experience in ham radio, when AM transmitters were common. When I found the same principle (amplitude modulation of a carrier wave, or more correctly here, pulse amplitude modulation) used in “cheapchop“, even including the basic software, I was able to get it working.

Here is a screen shot of a local quake I recorded today. There’s a DOS window I brought to the foreground for the screen shot. That’s seismochop showing the data samples at about 11 samples per second.

The sensor used in the one shown here is a simple pendulum (more on its construction at the end of this post), which is great for local quakes, while the Lehman style shown in this post  is better for distant ones. The one pictured has a neodymium magnet suspended over a roll of 44 swg wire I got at a local electronics shop. It has a resistance of 4,000 ohms and probably has several thousand turns.  Actually it turned out to be an overkill. The signal from it was so large I had to reduce the gain of the amplifier (with the addition of a 330 ohm resistor between pins 1 & 8 of the LM386 – see circuit diagram below).

(Update Dec 2012 – I have since discovered that the pendulum style works quite well even with direct, unchopped audio on some sound cards. See the post: Simplest Seismometer – Experiments with direct recording through PC sound card)

The sensor plugs into the interface box which can be built for a couple of dollars. That has two cables to the computer, one to the mic plug and a second for 5v USB power. Ideally though it’s better to use a separate power source as the USB 5v can have a lot of glitches and ups and downs. This is its circuit diagram:

And here it is in a plastic box:

My software  is set up for a pair of ports at COM7 and COM8. It sends data to port 8 while Amaseis is set up to receive data from port 7.

Installing software and setting up

The sequence is:

1) Download com0com here: http://sourceforge.net/projects/com0com/files/com0com/2.2.2.0/ and set up a virtual serial port pair. Name them “COM7” and “COM8”.

2) I just realized at this point I’d better make a DISCLAIMER: This next software, “seismochop,” comes with no guarantees that it will work or that it won’t cause any damage to your computer. I am not a professional programmer and the software may contain blunders that could have unpredictable consequences. Download and use it at your own risk. Now that you’re sufficiently alarmed, I will add that I’ve used it on several computers running XP, two running Vista and a couple running Windows 7. No problems, but this is not very extensive testing. If you have vital data on your computer you may wish to make backups or use some old unimportant computer for your own peace of mind. When you’re ready, click here to download seismochop then unzip it and put the executable (seismochop1-com.exe) and two .dll files in the folder you wish to run it from. I put mine in Amaseis’s working directory. The source code is included in the zip file in case you want to modify it.

3) Download and install AmaSeisSetup.exe  and under “Device” in the settings menu, choose “AS1”.  Set it up for COM7. Seismochop will send the data out to COM8 and the virtual serial port pair are there to link them together.

If the COM port setup was successful, you can execute “seismochop1-com.exe” (this version is set up for one channel – the one which is on the center tip of the mic plug in my computer). It will open in a DOS window and then wait for Amaseis to take data from COM7, so the next thing to do is to start Amaseis. You should see seismochop displaying data values when Amaseis is running. With no interface box, the data values should be around -16000 and the drift compensation figure (“temp drift”) that I put in the software will start dropping as it attempts to pull the reading closer to zero – center scale. If the interface box is plugged in and working, set its output level control or adjust the mic input level on the PC to obtain a reading as close to zero as possible. Check that shaking the sensor produces a change in the data values. Amaseis should be displaying a trace at this point. Experiment with gain settings in Amaseis for a clear display.

(Note 3 Jan 2013) Some people have been confused about what is happening with the 5KHz carrier signal and how to set up the audio input. The problem begins with the fact that Amaseis expects +/- values, but the sound card is only giving us positive numbers, up to around 32,000. The solution used then is to subtract, by software, 16,000 from the measured amplitude (loudness) of the 5 KHz signal, giving us a range of -16,000 to +16000.

In other words, with no seismic signal present, the 5 KHz signal is adjusted to drive the input to about half volume, as below:

5khz-carrier-wave

We know when it’s correct because seismochop will give us an output of “zero” after having subtracted 16,000. Seismic signals will then cause the 5 KHz carrier wave to increase and decrease according to the wave shape, as below:

chopped-seismic-wave

And seismochop then sends that measured data in the range +/- 16,000 onto the virtual serial port for Amaseis.

Some History

I have been recording earthquakes continuously for about a year and a half using Ubuntu Linux. The main shortcoming my system has had is that one could not view the seismometer trace in real time. Using my original software which was basically “cheapchop” re-written to save data in Amaseis format, one had to wait until a full hour’s trace was saved, then it could be copied into Amaseis’s data files and viewed. I did manage to get it partially running under Windows but still could not get my software to send data to Amaseis directly. Handicapped by a lack of programming skill, I fumbled around and gave up several times before finally working it out a couple of weeks ago.

Feel free to contact me via the “Contact” page if you need any help.

UPDATE 29 June 2012 Seismometer construction

Here are some shots of the final setup after a few modifications – the interface has been built into the base and the whole thing was stained and lacquered:

Pendulum seismometer and notebook computer

Underside view of seismometer showing audio interface

The following shot shows how I mounted the audio interface. Note that I used a different circuit here based on a 555 timer I.C.. There was no apparent difference in performance. (update: Nov 24, 2014: I have since observed that it’s slightly noisier than the original HC4066 circuit.) Here is the circuit diagram:

And here is a picture showing how it was assembled (click for larger view):

Update 26 July 2012

A 6.5 quake in the Solomon Islands appeared on the pendulum seismometer trace tonight. After observing several distant and local quakes, I’ve noticed that this one is particularly good for local quakes since it doesn’t respond much to the lower frequency background noise that I pick up on the Lehman in this location. That being the case though, naturally it doesn’t see much of the S waves from distant quakes. I did record 12 second period S waves from a huge quake in Indonesia earlier this year but they were tiny. The Lehman, on the other hand, recorded them so well they swamped the display. The trace below shows P waves only from the Solomon Islands, still, I was happy to see them as I didn’t expect anything at all from a 6.5 at that distance.

P waves from 6.5 earthquake in the Solomon Islands recorded on short pendulum seismometer using sound card input.

The USGS report of the quake is in the link below.

http://earthquake.usgs.gov/earthquakes/recenteqsww/Quakes/usb000bfq0.php

Update 17 Sept. 2012

This is the first earthquake recorded by Richard, one of my students who recently made the pendulum seismometer during the summer vacation classes. It was sitting on a bookshelf, I believe, plugged into his father’s notebook running Windows 7. Nice work Richard!

 

Update October 3 2012

I don’t need to bother keeping any records for “the most distant quake” recorded on this device now, after the recent 7.3 quake in Columbia (Sept. 30, 16:31). One can’t get much further away from Taipei. The S waves were not detected, as I expected for a sensor with a one-second period, but the P waves were very plain, much the same as small local quakes appear on the trace. Here is a screen shot:

 

This entry was posted in Electronics, Seismology and tagged , , . Bookmark the permalink.

12 Responses to Cheap seismometer using sound card and Amaseis – now running under Windows

  1. Pingback: Cheap seismometer using sound card and Amaseis – now running under Windows | Graeme & Shirley's Workshop

  2. simon says:

    Wow! This is great. What a breakthrough! That is fantastic that we can see things in real time now. I like the new seismometer too!

    • graeme says:

      Yeah, finally!!
      Hope you get an opportunity to make one when you come back. The interface box you made for the magnetometer just needs an amplifier added for the seismometer, plus of course the new software. Hopefully by then I’ll have the bugs ironed out of the dual channel version.

  3. Pingback: Student Seismology Research Station – Seismometer and Magnetometer Recording Via Computer Sound Card | Kids' Resource Center

  4. Pingback: Recording Earthquakes for Beginners – The Background Story | Kids' Resource Center

  5. Daniel says:

    Dear Graeme,

    Congratulations, you have done a really good job with this sismo and sound card !

    Please, dou you have the schema (and eventually typon) for the electronic card with 555 timer IC (your update 29 june) ?

    I really want to try your system !

    Many thanks,

    Daniel (ON5DA)

    • graeme says:

      Hi Daniel,
      Thanks for the feedback!
      I’ve just added the circuit diagram in that same update section. Let me know how you get on, and if you have any trouble getting it working.

  6. Simone says:

    Hi Graeme, Good Job!

    but i have some question for you:

    i don’t understand the 555 stage, could you explain me what the 555 stage does?

    And, using the sound card what program i can use to measure in richter a seismic event?

    If you need some help in programming i will help you on compiling and programming the windows interface in c# or Vb.net…But i need to know how to measure the richter scale using the signal acquired by Audio interface.

    I’m waiting your answer.

    Thank you.
    Simone.

    • graeme says:

      Hi Simone,
      The 555 is there to create a 5 kHz signal. It’s wired so that the seismic signal coming out of the LM386 is shorted to ground every time the 555 goes low, (It does nothing when high, because of the diode in the circuit.) The result is a 5 kHz square wave which is amplitude modulated by the seismic signal. This was necessary because sound cards won’t respond to the low frequencies of seismic waves. The software then does the rest.

      I don’t know of any easy way to measure the magnitude of the waves in any meaningful way. In practice, after seeing many of them I can make a fairly good guess, but that’s all.

      That would be great if you could help with the programming. It’s not as user-friendly as it could be. Have you downloaded it? The source code is in the zip file.

      Graeme

  7. Daniel says:

    Hello Graeme,

    Still a little question about the electronic diagram of the sismometer with LM386 and NE555.

    In datasheet’s applications of the LM 386, we can see that with no connection between pin 1 and 8 of the chip, the gain of the chip is 20.

    To change it, it must be a resistor + capacity (serial) between 1 and 8
    ex. with R (1K2) and C (10uF), the gain is set to 50
    and with no resistor R (0), just a capa (10u) between 1 and 8 : gain 200.

    But in your shot, there is no capacity 10u between pins 1 and 8, just a resistor 330 ohms).

    Is that correct ?

    Many thanks for the answer,

    best regards,

    Daniel (ON5DA)

    • graeme says:

      Hi Daniel,
      Yes, that’s correct. For our purposes you can ignore the capacitor. You might see in the data sheet that you can simply short pins 1 & 8 and also get a gain of 200. The 10 uF capacitor reduces the response to very low frequencies, which might be desirable for normal audio use, but not for us because we’re most interested in that low part of the spectrum.

  8. Pingback: Summer 2012 | Kids' Resource Center