Sensing tipping spoon rain gauge

If you have a tipping spoon rain gauge to sense besides other SDI-12 sensors, you can use a basic SDI-12 USB adapter equipped with an analog/digital input terminal block to sense it. You can sense up to 4 pulse sensors such as a tipping spoon rain gauge, a flow meter etc.

In the following picture you can see the 12-terminal long green terminal block between my thumb and index finger with markings “3 + – 2 + -” etc. You can either purchase this option on when you place your order or purchase a 0.1 inch (2.54mm) pitch 12-pole terminal block and solder to the basic adapter yourself but you need to check the connectivity between the processor and the terminal block yourself because I only check that if you order this option. Connect 0,1,2,3 to + and perform analog read, you should always get near 4.995V and connect 0,1,2,3, to – you should always get 0.

With this terminal block, you get up to 4 digital counters although you will unlikely deploy 4 rain gauges within close proximity unless I imagine you want to see how an agriculture pivot irrigation system distributes water in your field. It’s still nice to have if you need one rain gauge.

Here is an adapter with the terminal block unpopulated, with the space between my index finger and ring finger. You can see more clearly the markings.

Each group of 3 pins on the terminal block is one counter so there is a total of 4 counters. There are many pulse sensors such as tipping spoon rain gauges and flow meters. In theory each tip of the spoon creates a pulse of voltage from low to high then back to low. Rotation of a flow meter creates these pulses continuously. The following shows some low-to-high and high-to-low level transitions that form pulses:

But this is only the the theory. The actual situation of mechanical contacts bouncing off and on until they settle looks like this:

So there are multiple bouncing from the time marking 1 when the signal has been low but just start to become high until time marking 2 when the signal finally settles at high. The duration of the multiple bouncing between high and low is about half a millisecond. If you feed this signal directly to the counter, the counter will register all of these pulses instead of just one.

To count a rain gauge, you usually need to condition the input because it tends to be noisy. The cause of the noise is the electrical contact bouncing of the reed switch inside the gauge. When the spoon tips, it waves a magnet across a reed switch, which short circuits the two connections on the wire. This reed switch mechanically bounces back and forth before making the contact when the magnet is near and then breaking the contact when the magnet moves far enough. The bouncing causes the two wires to make repeated connections and disconnections so each tipping of the spoon causes multiple (inconsistent) number of contact making and breaking. To condition the input, you can use a resistor and capacitor. This causes the electrical signal from multiple contact making and breaking to smooth out into a single pulse.

The rain gauge you have most likely has two contacts in the cable. Either contact can act as the signal wire and the other as the ground. The diagram below assumes there is a power wire but if you don’t have one you can ignore it. You can start with a 10k ohm resistor and 1uF capacitor and follow this diagram to solder the resistor inline with the signal wire (usually either wire), and place the capacitor between the signal and ground (the other wire). The following diagram assumes you are connecting to input 0.

Now you are almost home free. There is one more detail. The counter registers both high-to-low and low-to-high transitions instead of just counting pulses because some sensors use both transitions and others like the rain gauge only use one to indicate a pulse. If you count tipping spoon rain gauges for instance, your tip count is exactly half of the reported transition count because each tipping corresponds to a pulse that has both H-to-L and L-to-H transitions that both get counted.

Here is a photo of a setup provided by one of the users. You can see a pair of twisted green/white wires coming off one side of the 12-pole terminal block. The wires are connected to the 2 by 3 clear plastic wire terminal blocks on the top and center of the right side terminals. This type of terminal blocks connect the left side to the corresponding right side to save you from having to solder wire ends together. So the green/white wire pair connect to the pair of orange/white wire that are connected to a 1uF capacitor seen on the second photo wrapped in translucent protective tubing. Then the rain gauge with thick black wire on the right side of the 2 by 3 is connected to the white wire going to the counter terminal. The red one on the other hand connects to a short red heat-shrink tube in the shape of a side-way U with a resistor of 10k ohm inside connected to the left side of the 2 by 3. This makes the resistor inline between the red wire and the green wire. I think I might want to design a small breakout board to make this connection easier.

This shows how the resistor is inline connected.
This shows the capacitor in translucent protective tubing that is connected to the pair of orange and white wires.

SDI-12 USB adapter mechanical drawings

I’ve added the mechanical drawings to the adapter’s home page. You can print out a copy and use it as a guide to drill mounting holes and plan wiring of your data loggers. Make sure you print with “actual size” and download the file corresponding to your paper size, Letter or A4.

Mechanical dimension in mm units of the latest SDI-12 USB adapter (Letter)

Mechanical dimension in mm units of the latest SDI-12 USB adapter (A4)

Update to SDI-12 USB adapter adds more protection

It’s been a while since my last post. So here is an update. Based on inputs of a number of users, I have made some updates to the basic SDI-12 USB adapter. Here are the new features:

Zener diode between SDI-12 bus line and ground.

This protects the microcontroller from voltage spikes due to power spikes or other interference, as well as accidentally short circuiting power with SDI-12 bus. Some SDI-12 sensors come with stereo plugs, they are notorious for short circuiting all three contacts when plugging in. This causes shocks to the SDI-12 bus if you are using external 12V power, which eventually causes it to die or at least its pin to degrade.

Inline 510 ohm resistor

This also helps with transient protection. I’ve made a few prototypes and plan to test them. Here is a photo:

This update shouldn’t affect the logging script or your existing loggers. I’ll consider adding these components to the SDI-12 USB + Analog and GPS adapters later after I identify space for them since there’s not a lot of space on those variants. I recommend the 1N4737 Zerner diode if you wish to add some transient protection yourself. Just make sure to place it correctly, with the black stripe side connected to the SDI-12 and the other side to ground, on a spare SDI-12 terminal or solder between the S and – pins on the middle 8-pin add-on header:


This IC replaces the FT232RL that is a bit outdated. The new IC will not affect any existing logging scripts, which only identifies the adapter by its vendor ID of 0x0403. If you have modified my scripts to identify the adapter by its USB vendor ID:device ID, the old device ID for FT232RL is 0x6001 while the new device ID for FT231X is 0x6015.