Real-time seismic data from libmseed using a Raspberry Pi with 512MB of RAM and an ARM single-processor

 

The optimization of simple systems allows hardware like a basic Raspberry Pi with 512MB of RAM and an ARM single-processor to be used for multiple large and important tasks.

 

Real-time seismic data from libmseed using a Raspberry Pi with 512MB of RAM and an ARM single-processor

Real-time seismic data from libmseed using a Raspberry Pi with 512MB of RAM and an ARM single-processor
Reading time: 3 minutes

In the example screenshot, this Raspberry Pi executes multiple processes to capture seismic data:

It reads raw data from the three axes (X, Y, Z) in real time at 1000 Hz from an ADXL355 accelerometer sensor.

It applies a downsample at 100 Hz.

It applies a notch filter at 50 Hz to remove unnecessary data from the signal.

It applies gravity correction to the Z-axis.

It saves the resulting raw data in memory.

It generates .mseed files with the final raw data stored in memory. It applies periodic calibration to compensate for the deviation of each individual axis and keep the data centered on the 0 axis.
It applies 26 different IIR filters to each axis to obtain the split signal and detect different types of events, such as nearby earthquakes, shocks, distant earthquakes, etc.
It applies an STA/LTA filter to each axis, allowing it to identify the event within a specific Hz and axis range.
It detects the RMS energy of all three axes.
It detects the arrival time of the event using the Kurtosis method.
It detects the arrival of the seismic wave using a secondary AIC algorithm.
It triggers alerts using individual time windows for each filter if the Trigger Threshold, adapted to each Hz and axis range, is exceeded. It has an nginx web server to display the control panel.
It sends raw data from all of the above to the control panel via WebSockets.
It generates raw mseed files for all three axes on an SD every minute to keep the generated data safe on the memory card.
It applies an FIR filter to each of the Hz ranges to generate a more visually appealing helicorder graph.
It generates helicorders for five different ranges, allowing you to visualize any events and see how they have affected different ranges.
It sends the previous helicorders to the main server for external viewing on the internet.
It has a libseed server to connect directly and collect data with other software, such as Swarm.
This same server sends the libseed data to a central server, where it will be redistributed publicly and in real time. The dashboard incorporates a system that connects to various official agencies every 30 seconds to receive the latest events. If available, it includes a wave arrival system to visualize the timing and how each type of wave affects the signal at the precise moment, calculating the origin and arrival at the station using the AK135 method based on geodetic coordinates.

The control panel allows connection to mseed servers to compare the station's waveform with those of other professional stations.
It also includes the generation of a spectrogram to visualize the signal strength and its distribution over a time window. This allows for real-time viewing of the strength of an event distributed across the entire signal width.

One might think that such a limited Raspberry Pi couldn't generate so much data, in so many ways, and in such a short time, considering the limited available memory and the fact that we only have a single processor. Therefore, socket connections, data and file generation, the web server, etc., all occur on the same CPU without the possibility of separate multithreading. However, far from crashing, the system handles it perfectly. There are no data outages. The only outages have been due to intentional service restarts, source code recompilation, and/or changes and updates. The system is stable.

Since the data is now available externally, I've implemented another service on the main server that collects the libseed data in real time and redistributes it, allowing it to be decrypted and displayed in real time using JavaScript.

This is precisely what I've set up. A real-time system allows simultaneous monitoring of all three seismic stations, each equipped with different types of sensors. This is precisely what will help us interpret how the signal behaves and appears at each sensor (accelerometers and geophones).

This video demonstrates the perfect synchronization of the system's date and time with the graph data, which are only a few milliseconds behind, confirming what was previously mentioned.

This is a spectacular achievement with very limited and outdated hardware. The challenge is making it work with the bare minimum. Knowing that it works, making it work on current, fast hardware will be no problem.

Video:






Other related blog posts: