24 bit ADC w/ GPS timing

Hello,
I am wanting to build a data logger with 24 bit ADC resolution with GPS timing. I am looking for thoughts/advice from people as to how to accomplish this.

More specifically, I would like to connect a geophone (Geophone - SM-24, with Insulating Disc - SEN-11744 - SparkFun Electronics) to the arduino, and sample it at about 2000 samples per second. I want to try and record small movements in the earth if possible...

In a perfect world, I would like to save this data to an SD card, or transmit it via serial to a Raspberry Pi for recording. Once recorded, I would like to have wifi access to the data for retrieval.

I have found many tutorials for connecting an external ADC, but I am wondering about the time. I am imagining that every 1/2000th of a second I will write the ADC value along with a time value to the serial port. My question is, how should I handle the time? I would like GPS precision, but most of these GPS chips only output at 10hz.

Any thoughts?

Why not skip the Arduino and just use the much faster and more capable RaspberryPi?

(deleted)

I am imagining that every 1/2000th of a second I will write the ADC value along with a time value to the serial port. My question is, how should I handle the time? I would like GPS precision, but most of these GPS chips only output at 10hz

Your device should have it's own clock, which could be synchronized at 10Hz intervals if that were necessary.

In reality, you shouldn't have to re-synchronize 10 times per second.

It can get a bit tricky if your local clock runs fast because if you take a reading and then set-back the clock, the 2nd reading can be reported as being read before the 1st (etc.). But at "only" 2000 samples per second, that shouldn't be a problem if you re-set the clock often enough.

You should pick an Arduino model that uses a quartz crystal for processor timing instead of a resonator. Then you can use the processor clock as a reference between pulses. Even over one second, you can see a difference with a resonator.

How much can the earth, big hunks of dirt & rock, move in 0.5ms?
If it was moving 60 miles/hr, or 88 feet per second, in 0.0005s it moves ... 0.044 ft. 0.528".
At 88 ft/second in 0.1sec I suppose 8.8 feet could be possible.
Uncorrected GPS has accuracy of 2-4m, 6.5 ft to 13 feet.
It seems to me that a smaller movement thus might not even be seen.

What kind of results are you expecting to see?

Thanks for all the feedback.

AWOL: I would prefer to use a Rpi and write the code in Python, but I assumed an Adruino would be better suited. Reading 2ksps on the Rpi, I was worried that there might be lag/delay. Thats why I choose the Arduino. Please correct me if I am thinking wrong....

aarg: I will take a look and see what Adruinos use a quartz crystal for timing, or look into an external clock.

CrossRoads - The sample rate was chosen based on a professionally designed seismic recording unit (http://www.geospace.com/wp-content/uploads/2015/03/592-02770-01-GSX-Rev-C.pdf) This unit supports .25ms -> 4ms (4000hz -> 250hz). So to get the bandwidth that I am interested in, 2000hz would be sufficient.

Any thoughts/comments on pushing the sampled time synchronized data from the ardunio over to a Rpi via serial? Reason for this is that once the data is on the Rpi, it would be relatively easy for me to to deal with the data and analyze it.

Another example that I found was this device: http://www.mindsetsonline.co.uk/Downloads/SEP_064.pdf

There is no point in sampling the Sparkfun geophone as rapidly as 2000 Hz, as 500 Hz (2 ms sampling rate) covers the available bandwidth (240 Hz). See the SM-24 brochure.

The Arduino 10 bit ADC works just fine to measure vibrations due to distant earthquakes. You do need to oversample by taking around 512 measurements and averaging them, but high school and elementary school students are happily doing this as I write.

See the TC1 DIY Arduino seismometer, among others included on this project page.

I made a TC1 a while ago for about $20 and am quite impressed with how well it works. You can easily detect earthquakes of magnitude 6 or greater anywhere in the world, provided you have a quiet location for measurement.

Incidentally, the Sparkfun geophone is a bit too insensitive and has the wrong frequency response for general purpose long range earthquake detection (if that is what you want to do). It is sensitive to vibrations in the range of about 10-240 Hz, but you actually want to measure 0.001 - 1 Hz for S and P waves.

tremmert:
aarg: I will take a look and see what Adruinos use a quartz crystal for timing, or look into an external clock.

The DS3231 RTC has a 32khz output, and a built in binary divider so you can get submultiples of that.

On the Sparkfun web site page for this sensor, there is an URL to code examples. geophone.ino seems to be precisely what you are looking for ( see code part for Arduino DUE, and this uc gives you a 12-bit builtin ADC controller).

jremington - Exactly what I was looking for! I am not actually using that specific geophone due to its limitations, but using http://www.geospace.com/wp-content/uploads/2013/12/592-05070-01-OMNI-2400-Rev-A.pdf I just provided the Sparkfun link as an example that everyone would be familiar with...

I will go ahead and built out the TC1 board and give it a shot. I do however have a question for you. It says that this board is an amp and filter in one. Do you know which components act as the filter in this circuit?

Next, I am back on the issue of timing. The board that I am wanting to design will not only record a geophone, but also several voltage measurements, preferably at a rate of 2000Hz. I am needing to apply a timestamp to each sample, and am trying to figure out how to accomplish this.

I plan on having this system recording all the time, so I want to output individual files (one file per day or per hour...) This will be handled on the computer side. I plan on having a GPS connected to the arduino for timing. Do you have any thoughts as to how to handle the time stamp? (The GPS has an update frequency of 10hz). Should I sample the GPS once per second, take 2000 samples (with milliseconds as the timestamp at each sample), then repeat? Any other thoughts?

I assume you're connecting the PPS (Pulse-per-second) pin to one of the Input Capture pins. That would be the most accurate, by far, down to a handful of microseconds. Calculating milliseconds from the arrival of the GPS sentence could be off by a few milliseconds between each sentence. It is also delayed from the real GPS time by 80ms, depending on sentence lengths.

NeoGPS allows you to set the current UTC microsecond from the PPS pin. There are several ways to use the PPS to set it. Once that is connected, you can call [

gps.UTCus()

](NeoGPS/NMEAGPS.h at master · SlashDevin/NeoGPS · GitHub) at any time to get the microsecond offset from the current GPS fix time.

The GPS sentence starts arriving after the PPS with some variability, around 100us. There is a NeoGPS option to use that instead of the PPS pin.

Adjusting the Arduino micros() values is another question. You could use a running average over a window. You'll have to choose a window size: 128? 256? 1024? That calculated Arduino-us-per-GPS-us could be used to adjust the return value from gps.UTCus() or micros().

There are other reasons to use NeoGPS:

  • It's smaller, faster, more accurate and more reliable than all other libraries.

  • It can be configured to parse only the fields and sentences that you really use in your sketch (e.g., just date & time). Everything else is quickly skipped, saving even more program space, RAM and execution time.

  • It can be hooked up to the RX character interrupt. This totally avoids the typical buffering overhead, and it makes GPS parsing immune to other tasks.

  • There is an example for adjusting the UTC time to the local time, if you need that.

Cheers,
/dev

Do you really NEED such precision? Maybe only recording the readings and recording when 10Hz pulses from GPS comes is enough? This way you will know you get i.e. 205 readings in 100 ms. Is it so bad to assume they were equally distributed over the 100 ms? I think it will be difficult to get better precision with precise (?) reference but not so precise crystal as time base for Arduino triggering ADC.

It says that this board is an amp and filter in one. Do you know which components act as the filter in this circuit?

The TC1 amplifier is also a low pass filter, but the cutoff frequency is too high for the TC1 detector.

You can increase the capacitance in the feedback path (C5) from 330 pF to 0.1 uF (100 nF) to set the cutoff lower. Can also increase the gain a bit by using 1 Meg instead of 866K for R3. See http://cgiss.boisestate.edu/building-a-tc1-system/nerdaq/

If you record the data with the JamaSeis software on a laptop connected to the internet, it automatically keeps the laptop clock quite accurately synchronized to UTC.

I just provided the Sparkfun link as an example that everyone would be familiar with.

Why on earth would you assume that "everyone" is familiar with the Sparkfun geophone?
If you want relevant technical advice, give accurate background information.

jremington,
Do you know where to find the Arduino code for the TC1? I have looked over their website, but cant seem to find it. You mentioned that you had built one in the past, so I figured you would be the person to ask...

I just finished building one, and look forward to testing it!