Simply, think of a Geophone as a super-low frequency microphone for the ground. Used globally as acoustic Earthquake detectors, they react to any ground vibrations. These vibrations can come from seismic waves, passing footsteps or even a dropped pen. This will demonstrate exactly how to use one with a Raspberry Pi Single Board Computer.


Hey gang, Tim here at Core Electronics .

This is a geophone, an ultra sensitive microphone for the ground capable of picking up light footsteps from many meters away. They are utilized around the world mainly for studying earthquakes, mapping subsurface geology, and in early warning safety devices.

Today, we set one up with a Raspberry Pi Single-Board Computer and we're going to need an analog to digital converter to do it.

If you were to pull apart this SM-24 geophone, you are going to see a spring-mounted coiled-up wire mass that is free to move up and down within the field of a case mounted permanent magnet. The active element of this device is that hanging wire coil mass. When the ground shakes, let's say due to an earthquake, the spring-mounted mass has an inertia and wants to remain still. So, as the earth moves up and down, the magnet displaces freely around the spring-mounted wire mass. This displacement creates a changing magnetic field which in turn produces measurable electrical voltages in the coiled wire.

As the voltages are the result of natural phenomenon, it is a truly pure analog signal, so we will need an analog to digital converter like this Adafruit 16-bit ADS-1115. This is going to be the translator between these two systems, reading the data from the geophone and converting it into a format that the Raspberry Pi can then understand. These chips operate at 3.3 volts and the sampling rate can be set anywhere to 8 to 860 samples per second.

To learn a whole bunch about analog and digital signals in the ecosystem of electronics, hit up our guide of the same name down in the description. On the table before me is everything you need to set up your Raspberry Pi to read data from an analog signal produced by a geophone SM24. Naturally, you're going to need a geophone SM24 and... with power from the Raspberry Pi

We are using a Raspberry Pi 4 Model B 2 Gigabyte. The Adafruit ADS1115 ADC board is also going to be needed and you're going to need to solder a line of headers onto it as well. You're also going to need some odds and ends like these three one kilo ohm resistors. You're going to want some extra Dupont jumper cables and a breadboard. You will also need everything to run the Raspberry Pi as a desktop computer. That means you're going to need a microSD card flashed with the latest Raspberry Pi OS and a micro HDMI to HDMI cord to connect the system to a monitor. You're also going to want a Raspberry Pi power supply, mouse, and keyboard.

We will now build up the hardware. Start by plugging in all the connections to your Raspberry Pi 4 Model B as you would a desktop computer. Check the description for a guide if you need a hand doing this. Don't plug in the power through USBC just yet. Now you're going to need to solder headers onto the ADS1115 board and solder on some wire connections to the top of that geophone SM24 if you haven't done so already. This geophone comes with a little PCB board on top which makes soldering to the top of it significantly easier.

Now let's take a look at the schematic. This is exactly what we're going to replicate here. As you can see, the Raspberry Pi is connected to the ADS1105 board through the GPIO pins. There are four connections which I will plug in now. The first is the red one to deliver 3.3 volts VDD that's voltage drain drain to the ADC. The black wire is to provide ground connection between both boards. The last two are required for I2C connection. They are the serial clock named SCL and the serial data named SDA. The orange wire is going to be the SCL and connects like so. The purple wire is the SDA and connects this way. The ADC can be supplied with power from the Raspberry Pi.

Voltage from the Raspberry Pi itself must be the 3.3 volt connection. If you connect it up to the 5 volts from the Raspberry Pi, it's going to brick the Adafruit ADC board.

Turning attention to the geophone side, we will connect up its two outputs to a breadboard. Near the geophone SM24, I'll explain their purposes. The one kilowatt resistor in the middle between here and here is a calibration resistor used in accordance with the data sheet. These two other one kiloohm resistors leading towards the ADC board are for current limiting. In a situation where the output voltage from the geophone is significantly greater than the maximum input voltage of the ADC, these resistors are going to protect our system.

Knowing this, we'll now connect up the two resistor ends of the AO and A1 of the ADC board with some jumper cables. When everything has been connected up and your setup looks a lot like this, you can then put power into your system. With power to the system and the new first boot up wizard complete, you're going to be welcomed by the Raspberry Pi desktop.

Now, this Adafruit ADC requires I2C communication to work. By default on Raspberry Pi OS, this communication method is turned off, so the first step is to turn it on. To do this, we're going to open up the Raspberry Pi configuration menu found using the top left menu and scrolling over preferences, and then we're going to enable the I2C connections found under the interfaces tab. After enabling, reset the Raspberry Pi to lock in the changes.

Now, with your system rebooted and connected to the internet, open up a new terminal window by pressing the black button on the top left of the screen. Utilizing this terminal window... we set up earlier

We can enable us to download from the internet the exact Python packages that we require. To get all the packages that you'll need, type and enter the following lines into the terminal. You can also copy and paste them from the full written up article linked down in the description, like I'm doing right here. If ever prompted, type and enter 'y' to continue installations. With that last line complete, we have fully set up our Raspberry Pi Single-Board Computer to work with the geophone SM 24 and the ADS1115 board. I have created some example codes that you can find and download at the bottom of the full written up article (link to it in the description). These files will be in a zip folder; just extract the contents of it to wherever you would like (the desktop is a perfectly good place to do so). Right click and open any of these files with Thonny IDE to see how I wrote them. Thonny IDE is just a Python interpreter software and you can use whichever software you would prefer.

Let's start by opening up the differential graph with it open. Let's press the green button. As soon as you press it, it's going to show the live output of the geophone plotted to a constantly updating graph. When I lightly tap the corners of the table, the geophone will register it and the graph will respond in turn. Very sweet! This data is also recorded to the shell and it even picks up handwriting. The y-axis are the millivolts coming out of our geophone as determined by the ADC board. The readings constantly come in at around 20 each second.

Taking a quick dive into the script, the first two lines are the libraries needed to plot data. After that, it's time and the package needed to run the ADC. We then create an ADC instance right here; this points the system to the I2C address that we set up earlier.

We have our ADC attached to our system and we then choose a gain to utilize to gain a 16. This is the max that this ADC board can do. This way, you can really see how sensitive the geophone is. Just as an example, if you were to have this in the boot of your car picking up the vibrations as you drive along, you may not need such an extreme sensitivity and a lower gain value would be better.

We will also use the voltage range that each gain level targets to adjust our graph scaling later in the script. Everything below this really has to do with creating the constantly updating graph, except for this section down here. This line here pulls data from the ADC each loop. The next lines convert this value to a millivolts value, then we print them to the shell and the next line plots them on the graph.

The next script worth looking at is differential data collect gain dot py. When you run this script, the ADC very quickly will sample the geophone a hundred times. The Raspberry Pi will then capture those pieces of information and save them in a CSV file named geophone underscore data dot csv. If this file is not already created, it's going to create it. As you can see, each new data point has been separated by a new line. Be aware that each time you run this script, it's going to rewrite that CSV file. It will also tell you exactly how long it took to complete and print that time in seconds to the shell.

If you run it as is, you're going to receive those 100 samples within around a second. Allow me to demonstrate and it only took 0.96 of a second to do so. That is a lot of data points really quick. Since we're already in the script, let's take a dive into it further. Initialization and data retrieval is the same as before. Here is the sample number variable which we will use in conjunction with the loop so we can get our 100.

Data points are gathered and the next line lets the script create and write the csv file. We also have some extra variables just so we can keep track of how long it took to receive those 100 points of data. Then, we jump into the for loop. This line right here captures that value coming out of the adc. Then, if we go down a little bit further, this line right here is the one that writes those millivolts into our csv file.

If you wanted to record seismic data over an entire 24 hour period, you can do so with this script. You just need to make the following adjustment: comment out this for loop here and then uncomment these and this. This line will take the time it is currently and then only once 24 hours have passed will the script stop looping.

When you have sufficient data or you have something that you really want to graphically observe, we can quickly take that csv file and plot it in excel. Finally, I wanted to control a camera based on the vibrations around me. The idea is that when I walk by the raspberry pi, the geophone will pick it up and trigger a photo to be taken of me. To do this, I'm going to need to attach this camera to the csi port on the raspberry pi. Check the description for a guide all about setting up cameras if you need.

Let's take a look at the script called footsteps camera geophone dot py. It's going to look very similar to the previous ones except we're also importing the OS functionality. When you scroll down, you can see that the while loop is going to continue forever. Then, we gather the data in the same way as before. Inside this loop, there is also an if statement. Inside this loop, this is the threshold. If the geophone picks up a millivolt data point larger or smaller than these two values here, then the camera is going to be activated by this line.

This OS dot system sudo lib camera dash still dash dash date time is just a way of taking a photograph. This is the reason why we needed to import OS at the beginning. The camera is going to auto adjust and take a photograph of whatever happens to be in front of it. Then the system will revert back to vibration listening. If this threshold is too sensitive for your application, simply adjust these values here. Keep in mind that I'm making it hard for the geophone as it's on a hard wooden table and I'm walking around on carpet. Normally geophones are installed directly against hard ground. So let's run and test it now.

We'll stop the script running and let's go take a look at that photo that it got at me. You're going to find the photos in the same place as the scripts and the photos are going to be named with the current date and time, so there's no concern of overwriting them. I'm pretty sure this is the one that got me. Nice!

This opens up an interesting world of control where intelligent devices can be set up behind walls completely out of the line of sight. Say you are walking through your house at night, your system could know exactly where you are and turn on your lights automatically illuminating the path as you go. Or you could utilize it as a secret method of tracking how many people are walking past a certain location.

Hopefully this toolkit of knowledge on both ADCs and geophones will serve you well. If you have any questions, write me a message down below. We are full-time makers and we're here to help. So with my geophone bouncing along just how it should, until next time, stay coz.



Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.