Hydrological Sciences

Do-It-Yourself (DIY) in Geoscience Miniseries – Part 2: Sensors & Electronics

Do-It-Yourself (DIY) in Geoscience Miniseries – Part 2: Sensors & Electronics

As a child, I was a huge fan of LEGO. I would spend hours building and creating structures, vehicles and landscapes. For every birthday & Christmas, I wished for the newest sets of these colorful plastic bricks. While building the sets manually was fun, creating something new from my own fantasy was even better. It seemed like once I had a substantial amount of different bricks, combination possibilities were sheer limitless.

Maybe that’s why I enjoy tinkering with microelectronics so much these days. In this post, I want to introduce you to my new “bricks”: microelectronic components. Like LEGO, they can also be combined in many ways, allowing you to create devices just how you want them. Since the list of available parts and modules is nearly infinite, I will focus on components which I regularly use in my geoscience projects:

  • Distance sensors: These sensors can be used to measure distances based on ultrasonic pulses or infrared light. You can also use 2 of those to build a light barrier to count movements.

  • Stepper Motors: Stepper Motors are motors where the exact interval (“steps”) by which the motor should turn can be specified. They are a great component for turning stuff where you need to exactly know where something is and how often it has turned. They also exist in a linear variant with which you can move things up and down or left and right. (Example parts which I use: NEMA17 motor with TMC2208 driver or 28BYJ-48 motor with ULN2003 transistor array driver).


  • Servo Motors: Servos are great with angles. These motors can be programmed to steer directly to predefined positions. They are really useful when you don’t need a full rotation but rather a constant actuation like pressing a button or turning a valve. They are available in different strengths and materials depending on your needs. I am a huge fan of the 20kg version. They are easily steerable but have lots of power to lift and/or turn things. (Example parts which I use: SG90 9G micro servo or DS3218 metal gear 20kg servo).

  • Real time clocks: RTC modules are little clocks that keep the time even when the power to the device is out. This is achieved with its own power-source (often a small battery). That way, especially when logging data, you can be sure that the time of measurement is always correct. (Example parts which I use: DS1307).

  • SD-Card Modules: When you need to store data, SD and microSD card modules are the easiest and most accessible option. Most microcontrollers do have a small internal storage capacity; however, it is often hard to access in the field. The benefit of SD cards is that you can quickly exchange them in the field and then read out the data in your cosy office (which is especially beneficial in winter & rain).

  • Relays: Relays are magnetic switches. Within the relay, the power of your microcontroller activates a magnet, which then opens or closes another circuit. This lets you steer way higher loads than those which your controller could handle. For example, when you want to steer a 12 Volt circuit with your 5 Volt Microcontroller, the power would instantly smoke it. But with a relay, the switching is possible.

  • Stepdown converters: When powering your devices, you often need different kinds of power. Your battery might output 24 V, but your MCU runs on 5 V and the Stepper Motor on 12 V. Here, a stepdown converter comes in handy. Unlike other voltage converters, the excess power is not transferred to heat (which is really wasteful) but converted with up to 95% efficiency. This becomes extremely important when the battery life determines your measurement duration: lower system power usage = longer measurement times possible.

How easy is it?

Linking these components to your microcontroller might not be as straightforward as assembling LEGO bricks, as each one needs a slightly different connection. However, some companies strive to simplify the process by using standard ecosystems such as I2C as a general interface. Examples include the SparkFun Qwiic and SEEED Grove systems, which help beginners create functional prototypes.

Learn more

As already said, nearly endless types of sensors exist. If you want to learn about measuring temperature, solar radiation or air pressure, you can find great tutorials at these links. Just like in the last post on microcontrollers in this miniseries, my final suggestion is to order or borrow some parts and bodge together your first sensor. If you want some inspiration on what to build, visit a Mac Gyver Session at EGU or AGU or have a look at the open-source projects from the open sensing lab at Oregon State University. Have fun and experiment!

Post edited by B. Schaefli, with input from R. Hut.

Jonas Pyschik is a PhD student at the University of Freiburg, Chair of Hydrology. In his work, he tries to derive subsurface flow-paths and catchment scale dynamics of subsurface-stormflow using stable water isotopes

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>