Now that my seismometer is essentially finished and working flawlessly in a corner of the garage, I have begun another seismometer project with a friend who has been working on a Lehman seismometer since the early 1980’s. It’s still not quite working yet, so I’ve been pushing him to finish it. Initially he was going to just print the output of his 1980 electronics (which has not proceeded past the paper design point) to a drum plot (a real one that uses paper…OMG!) but I believe that he is now tending toward a more software driven approach to recording the data. Computers are not his thang.
It was ChucktheTinkerer’s post about the HX711 that got me started thinking about a very cheap 24-bit ADC interface for an amateur seismometer with velocity sensor. The HX711 has all of the necessary components to process the output of a velocity sensor: 24-bit resolution with sample rates of either 80Hz or 10Hz, a programmable gain pre-amplifier with gain values of 32, 64 and 128, and a fully differential bridge-type interface. I ordered a pre-built module from eBay for about $1. After a few hours of “tinkering” with it I realized it’s potential as a seismometer interface, but I had to toss out the eBay module to unleash it.
The HX711 datasheet shows an application using its internal/external regulator to provide a quiet analog supply for the ADC. They also say that if the on-chip regulator option is not used, the two supply pins can be connected to a separate regulated supply. This is a better option for use with the Pi because the Pi GPIO interfaces operate at 3.3V and the HX711 supply range is specified over 2.6V - 5.5V.
I also found that the HX711 internal clock generator was more than 20% low on the eBay board. This may be why it only costs a buck. This is not really acceptable for a seismometer — the seedlink server software is a bit sensitive to variable sampling rates. But the HX711 provides for a crystal controlled clock (not an option on the eBay board, which is hard-wired at the slow sample rate.)
The HX711 ADC requires its inputs to both be within a certain common mode range but the eBay board did not provide any circuitry to accomplish that.
Lastly, the HX711 has a weird serial communication protocol that requires a bit-bang on two GPIO pins. The HX711 is designed to go into a low-power sleep mode if the PD_SCK input goes high for more than 50us. This is a difficult requirement for the Raspberry Pi because of the Linux housekeeping. There is a HX711 interface using PIGPIO, which supposedly fixes this issue but I did not have much luck with that (more later). Since a seismometer requires 24/7 operation the sleep function is not required or desired. I just implemented a 1us one-shot to control the PD_SCK input which prevents the HX711 from sleeping and solved a lot of the interface issues. Sometimes software can’t fix everything…
So here’s the final schematic for a seismometer velocity sensor:
I trolled eBay for bare HX711 parts and found them (5pcs for $3.50) here: http://www.ebay.com/itm/141975978434?_t ... EBIDX%3AIT
The HX711 is a pretty light load to a regulator so I used a XC6206 3.3V LDO in a SOT23 package that cost $0.06 each: http://www.ebay.com/itm/252006358372?_t ... EBIDX%3AIT
The one-shot is the most expensive component. I used the very cute LTC6993-1, which only needs a single resistor to program a 1us pulse. Its outrageously priced at $3.35 at Digikey, but LTC sent 2 samples to me gratis. (I guess it pays to be an alumni — full disclosure.)
The PCB is custom from OSH Park — $5.50 for three prototypes. Total BOM/board comes to about $7 after sprinkling a nine 0603 resistors and ten 0805 capacitors, $0.50 for a 26-pin female header, and $0.10 for a crystal from Tayda Electronics. Everything is surface mounted except the header and the crystal.
Here’s what the board looks like mounted to a RPi2:
The the RPi can set the sample rate to Fcrystal/138240 or Fcrystal/1105920, which yields 80Hz or 10Hz when using a 11.0592MHz crystal. I found the 80Hz rate a bit too fast for a seismometer application: it generates a large amount of data storage per day and the RPi has problems keeping up. So I am using a 4MHz crystal to get a sample rate of about 29Hz with the RATE pin set high. I tried to get Joan’s PIGPIO HX711 interface code to work using her python module, but it kept quitting after a few seconds or minutes of operation. I suspect that eventually the kernel would clobber the code and it stops for some reason. Since the one-shot frees the code from having to keep the PD_SCK high time less than 50us I can limp along with the generic GPIO interface. Every once in a while the data is clobbered by the kernel, but I have a pulse swallower that detects this condition and just sticks the previous “good” data into the current sample and proceeds merrily along. I can get away with this because the system is oversampled by 10x.
The seedlink server is setup the same way as described in a previous post in this thread, and Obspy is used for waveform processing. Here’s what the raw data looks like for a 30 minute segment with the gain set to 128 (I hit the limit on uploads so the filtered data can't be attached
The applied signal above is a 4uV p-p square wave with a 10 minute period with a 10k resistor across the ADC inputs. The software can easily measure mean and standard deviation, so I estimate that the input referred noise is about 500nV p-p. That is on par with other amateur ADC systems designed for velocity sensors.
So thanks ChucktheTinkerer…your suggestion to use the HX711 was a good one. Now I just have to overcome 40 years of slow progress on my friend’s Lehman seismometer to get in all installed and working. I’ll let you know if/when that happens.