March 21, 2018
The Infiltec QM-4.5V-20Hz is a seismometer that can be connected to a computer via serial port. It outputs readings in ASCII format at a rate of 20 Hz, and the C# software presented here is designed to record, analyze, and plot data from this seismometer. The software is presented here as a general example and a means to copy existing code segments - the components can be easily applied to other sensors and scenarios.
The MainWindow file initializes and prepares the serial port and the other classes which process the data. These include:
- OscilloscopeControl is a bare-bones plotting code that draws sequential datapoints as pixels on a WriteableBitmap that is shown in an Image object
- HttpOutput uses an HttpListener to allow another computer to connect to the one running the software, and request data rapidly through TcpListener using the WebSocket protocol
- AudioOutput uses the BufferedWaveProvider class from the NAudio package to convert the seismometer data into 16 kHz sample rate sound in real time, listening to which can help identify sources of vibrations
- SerialReader gets data from the SerialPort object and parses it
The code files, which are combined in a C# Visual Studio Express 2010 project, can be downloaded here.