Wednesday, April 20, 2016

Earthquake Data Logger

You are not destined for greatness in every project. Or success. Or even building. Sometimes you lovingly crafted project will meet again warned never to fly. Sometimes your project a "success" may be an underwhelming result. This is the story of such a project.



Christchurch, New Zealand - where I live - the beginning of September this year, there was a 7.1-magnitude earthquake. (And, no, no earthquake caused my project.) Some significant property damage in the earthquake were imposed, even though no loss of life. After an earthquake of this magnitude, smaller - but still noticeable - After Shock or weeks or months may continue. As of mid-November 3000, or after the shock has passed.
Earthquake Data Logger
Earthquake Data Logger
Following the earthquake and aftershocks, GeoNet know the magnitude of the event and to see images generated from a seismograph drums became a popular destination. The magnitude 4.7 and 4.9 earthquakes in this post I will describe later time images generated from data recorded on a seismograph drum is used:
Earthquake Data Logger
Earthquake Data Logger
Whether it's something I thought one day after a shock or an accelerometer to detect when they happened to be able to use. I Quake-Catcher Network project, which is connected to the USB accelerometers to detect and study the distribution had read about. But, hey, we are here to make ourselves the things we want, is not it?

Unfortunately, when the idea first occurred to me that I did not have any accelerometers, and by the time I organized the distribution of after-shocks or three thousand, and most of it was gone. The first signs of this project probably would not have had a huge impact in the world of scientific discovery.

Hardware Selection
When deciding on the use of accelerometer ADXL335 or ADXL345 is a choice I had to make. I have to begin with an analog device ADXL335, which means that it is easy to hook up and decided to start with.level do not need to convert. We think, given the quality of the interpreters need to take into account the lower maximum voltage. (You may feel better, I'm making this particular note, because until I started writing this post, I forgot to take this into account, but I can not possibly comment.)
Earthquake Data Logger
Earthquake Data Logger
I was like an Arduino microcontroller platform and digital (ADC) input, three-axis analog accelerometer is more than enough to handle. This is a 3.3V supply ADXL335 is required to supply a small amount of current.
It's always nice when someone figuring out the connection to a device, and in this case an Arduino board similar to a cable project is a page demonstrating how to connect the ADXL335 has been completed.

Writing The Software
Even better when you've got someone you both code and retrieve data from the device you are using to display the data in a useful manner has been written. In this case, accelerometer / gairoskopa data Arduino is a fantastic blog post, realtime graphic helpfully displayed on the graph in real-time readings, and accelerometers for processing codes are codes for reading.

I tried out the code, and when I placed it on a desk or accelerometer to move around and defeated the desktop got some nice graphs. Things were going well.

Although real-time graph showing the beautiful, you immediately detect the earthquake, I was missing something different to look at the data, you're missing. Most of the time data is uninteresting - all this suggests is "an earthquake is happening now." This means that in some way we have to go back and when an aftershock occurs, so we just can extract the data you want to save the interesting part.

WiFly shield my original plan to use some space "in the cloud" to send data from the accelerometer, because apparently that's where all the cool kids are sent to these days. (Although the cloud has its valued.) Pachube web site to one of the "Internet of Things" with data logging devices. While I was looking at possible options, I Nimbits data logger which apparently discovered their data logger application capable of running your own example.

It is at this point that I realized I could be a problem. The adoption rate of cloud-based data loggers supported none of the data - as far as I could tell - accelerometer readings per second, but the production is going to be ten. As far as I can tell - - I can neither support services batch upload readings Batching and upload them once every few minutes, but once again considered. And, even if they did, I'm still new to upload the data from the previous data logging out how to deal with the situation.

Reluctance, I decided to take a new approach, as I noted in my project log:
Given the low-ish likelihood of detecting an aftershock and the low likelihood of the building holding the Arduino falling to the ground, in the short term it probably makes sense to just record the data to SD card and retrieve it manually. This is less exciting but will result in something quicker. While there's a definite value in having direct to the web uploading the effort to create the infrastructure to support it is probably not really justifiable at the moment.
MicroSD as a shield for the project, I already wrote a great sdfatlib library simplified wrapper libraries provide an easy way to record information. This is a slightly modified version of the library wrapper library will be available early next Arduino SD release. It is now a few lines of code to make changes to the original microSD card, after writing accelerometer readings.

Data Collection
The power of a standard nine volt wall wart power supply, I decided to use. I looked at some form of backup battery power of an earthquake, I have to kiss under the rules, but that the rest of the time going out for another day, I was really worried.

The entire system is wired up to his fancy enclosure:
Earthquake Data Logger
Earthquake Data Logger
Basically, I was just sitting on the carpet under my desk, but there does not seem to be very useful results - I'm not entirely sure where the best place would be to detect the device. It ended up sitting on a window sill and I just hope it was not knocked around by other people in the office.

Since I am not WiFly module is used to log in to each data point, I did not have an easy way to get the current time. A lock for a time sufficient to get a GPS signal, but at first I could have been able to confirm how well the device will not work. I just kiss and took the option to reset the random number recorded in the past. (If I were more organized, I have noted over the beginning of time, so that I could not count the points, but apparently I did not.)

Once I was connected to everything to keep running until I decided to do the next step. At this stage one or two weeks from memory by the aftershocks were excluded from a lot.

Finally, there was a noticeable aftershocks and the next I was in the office when I took a look at the data. There was not really much to see. Even when there was an earthquake sensor values will be within a couple of swing and there was no significant outliers. This was a good alternative to the window sill when I decided to try out.

Almost 4.7 and 4.9 magnitude - nearly a week later, the first one after another after the Sunday morning there was an aftershock to the day. I happened to be sitting at the outside of an armchair and shock was noteworthy for a number of seconds. Near the beginning of the post (and, yes, I checked it was one rocking armchair.) GeoNet shows how images of their seismographs record the special vibration.

Data processing

It turns out a lot of information, but generates almost twenty samples per second recording. In fact, nearly five million rows of data in the log files for about a week's worth. Given that your average spreadsheet few tens of thousands of rows I need to find different ways of processing the data at the tops. I tried a few different software packages but did not have much success.

I Python command-line tools (cut, sort and uniq) using a combination of an initial summary of the last generation:
X-axis
ADC Value 323 324 325 326 327 328 329
Occurrences 1 1 4,024 3,065,147 1,958,420 20 4

Y-axis
ADC Value 333  334  335 336  337
Occurrences  1  74,472  4,582,727 370,414 3

Z-axis
ADC Value 389  401  402  403 404 405 406 407
Occurrences  1  1  314  257,404 4,073,165 696,663  67 2
Apart from a couple of outliers, my six standard data logger to a range of 401 ~ 407, a 4.9-magnitude earthquake was recorded for the z- axis. Underwhelming, to say the least. In both cases, something did not work or something was wrong in my understanding. Time to read some more.

After reading some more and some calculations of the value each time it is changed by less than one percent represents a fraction of the force of gravity turns out. Once I discovered that I then "peak acceleration" and some sites with more information about the relationship between MMI scales were found. 1-2% of the shaking is noteworthy that the acceleration of gravity point ( "strong motion") is apparently in. 3.9% Gravity - I see the value of 4.0-4.9, the intensity level was consistent with the third-fourth or 1.4.

We are successfully detecting earthquakes. It was not just a very impressive number.

Results are displayed

After massaging the data into a spreadsheet in my most intense activity (about 5 seconds) to graph the results for the period under all their awesome glory:

Plot of raw ADC value for each axis over ~5s time (yellow = z, red = y, blue = x)
Earthquake Data Logger
Earthquake Data Logger
Plot of relative ADC value for z axis over ~5s time
Earthquake Data Logger
Earthquake Data Logger
If there is a successful result is underwhelming!

I do differently next time?
I'm probably in a narrow range with a high-resolution range of an accelerometer, which means I want to try to be. Accelerometer and Gyro Buying Guide a number of options in the range of +/- 2g or +/- 1G, which is (hopefully!) Will not be more than enough for any aftershocks. This means that small movements could not be identified.

I improve the resolution to restrict the values from 0 to 3.3V Arduino Aref would like to take advantage of the best functionality of the existing range.

Another option is a high-resolution ADC will be considered one of the inbuilt, but to a point where (especially this is all on a breadboard) to increase the resolution will be obscured by the noise.

I have an accurate time stamp on each sample would have to find a way to work.

Your Turn!
What are you trying to record a natural phenomenon, like an earthquake?
You can create huge amounts of data in a project like this, how will the process?
I'm not a geologist or log in projects I have developed a lot of information, how to write up the project developed or have suggestions?
With less than spectacular results in a project to share your own story?
Tell us in the comments ...





No comments:

Post a Comment