My own online store is open!

So after some research and putting in some work, I now have my own online store! It’s powered by Square and has a fairly simple interface: A few items that I sell and shipping costs depending on your shipping address. I currently have 3 regions with different shipping costs: within USA, Canada, and rest of world. I will add more regions, I believe up to 6, each with different shipping costs and try my best to get the costs to be more accurate according to the quantity ordered. Anyway, here it is! Please let me know if there’s something I can improve on. If this goes well, I can retire the dated inmojo.com marketplace and the Paypal purchase links.

https://liudr.square.site/

Reading SDI-12 sensors with your Android smartphones

So if you want to get started with your SDI-12 sensors quickly, you can use your Android smartphone as a display and install a serial port app. Then within a minute, you are reading your SDI-12 sensors already! Watch my short tutorial for Android phones. I’ll investigate how to do this on an iphone and ipad as well and post my findings.

Reading SDI-12 sensors with an Android Smartphone

By the way, those 6 customizable buttons are really useful. You can long press it to edit both its name and value to a command. Then you can just tap the buttons instead of typing. You can even type in both M command that starts the data acquisition and the D command that reads back the data. You will need some delays between the commands though. The following is how I configured my serial port app for a better experience with SDI-12 sensors:

Here is the serial terminal program:

Impact of global semiconductor shortage

As many already have noticed, there is a global semiconductor shortage. Many common integrated circuits such as the ATMEGA328P-AU processor featured on most of my SDI-12 USB adapters are simply out of stock for the foreseeable future or until later 2022.

As you can see, this is going to be a problem for many businesses big and small, including my line of SDI-12 USB adapters. Luckily I grabbed enough parts last year so I still have over 200 of them that will last for a short while before I run out.

Processors (200), USB chips (200), and 100 blank boards (boards can be reordered quickly) are photographed here. Hope this lasts for a while. If you are doing your own projects, unfortunately you won’t be able to purchase ATMEGA328P-AU or ATMEGA32U4-MU etc. until they are back in stock. Try the DIP version of 328P. They are still in stock.

As a response, I will temporarily focus on only producing the basic SDI-12 USB adapter and stop producing the SDI-12 USB + Analog adapter (red) that requires a processor. You CAN still get the hi-res analog features with a basic SDI-12 USB adapter and an analog input extension board. The combined cost is the same as the red adapter.

I can still produce the SDI-12 USB + GPS adapter although it is on low demand. If “worse comes to worse” and I run out before I can get restocked, I have over 100 ATMEGA1284P-AU processors that can be used to produce the SDI-12 USB + GPS adapter, just that I won’t attach any GPS and will sell those as basic SDI-12 adapters without extension ports. Or maybe I will redesign it to have an extension port.

SDI-12 USB+Analog adapter vs stacking basic adapter with Analog extension board

If you wonder the pros and cons of these two options, here is a video for you.

SDI-12 USB+Analog adapter:

Pro: small form factor that is easy to work with
Con: no digital inputs for digital pulse from rain gauge or flow meter, no extension

SDI-12 USB adapter stacked with Analog extension board:
Pro: extendable with up to 4 hi-res analog addons and other addons such as extra SDI-12 terminals, 4-20mA sensor addon (coming out soon), and possibly a future GPS addon via the 6-pin header.
Con: device gets taller with the extension boards

Starting a weather station at wunderground.com

So this summer I’m thinking about starting a weather station at wunderground.com, after someone contacted me about possibly doing theirs with a MEGER Group weather station. So in order to post your own weather data, you need to register and add a device. There is a relatively old (3yr) tutorial on raspberry pi. Much has changed but it may still be useful if you go through it just to see what will be involved:

https://projects.raspberrypi.org/en/projects/uploading-weather-data-to-weather-underground/

Anyway, here is a more updated but short version:

  1. Go to wunderground.com and register an account: wunderground.com
  2. Under “My Profile” you will find my devices:

3. Add a new weather station. Choose device as Raspberry pi and let the system choose default values for the rest. I gave a 5ft weather station height. Probably higher is better but again I don’t have a weather station yet.

Now under your devices you will se a device ID and a key. You will be able to use this information to post your data. Here is an example of the posting address that you can put in Python or just in your web browser:

https://rtupdate.wunderground.com/weatherstation/updateweatherstation.php?ID=XXXX&PASSWORD=YYYY&dateutc=now&humidity=40&action=updateraw
Just replace XXXX and YYYY with your own wunderground weather station information and say post your humidity data, place the whole line in your web browser and you should get a success if everything is correct. You could add more more data with the & symbol between them, such as humidity=40&tempf=70 to post both humidity and temperature (in Deg F)

Here is a recent post that has all the different weather information you could post:

https://dbxit.com/uploading-to-weatherunderground-using-http

So my next step is to get some outdoor temperature and moisture sensors whether they are compatible with my SDI-12 adapter or not. I can run a separate Python script to post to wunderground.com and to thingspeak.com for soil data. Stay tuned!

How do you analyze soil data?

That was actually a question from one of my customers. To be honest, I’m a physicist and engineer. I wish I knew more about soil science and agriculture but I’m open to anyone who is willing to share some knowledge. My basic understanding is if you can measure dielectric permittivity with the sensor. Then you can calculate volumetric water content with formulas the sensor manufacturers provide, for a few typical types of soil. Or you make your own calibration with your own soil, such as using a different method to measure VWC (baking the soil dry?) and correlate with dielectric permittivity so you develop your own formula. More specifically the question was about METER Group Teros 12 sensor. If you use this sensor or something similar, could you share a few lines of how you get VWC and/or other data from it? Any reference materials to point to? Thank you!

New videos posted

It’s been a while since my last video introductions so I took some time to record an overview of all the adapters and extension boards.

I also added detailed introduction to each one and their features. Here is the playlist containing all of my recent videos:

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 tindie.com 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:

FT231X USB IC

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.

%d bloggers like this: