SDI-12 USB adapter
This SDI-12 USB adapter is a great way to add SDI-12 sensors to a PC running windows, Linux, Mac OSX, or raspberry pi. Similar products on the market sell for a lot more with less features. This adapter essentially allows you to send SDI-12 commands directly to your sensors and read back their responses. You may decide to run the free and open-source data logger code I provide and maintain, or develop your own code.
To integrate SDI-12 sensor on your Arduino instead of on PC or raspberry pi, check out my SDI-12 data logging shield and dongle:
SDI-12 sensors are widely used in environmental monitoring including soil, streams, plants etc. On the other hand, data loggers designed for SDI-12 sensors are usually expensive and proprietary, making it harder to monitor and study soils and streams on a budget. This SDI-12 USB adapter makes it possible to directly interface SDI-12 sensors with a PC running Windows, Mac, Linux, or a Raspberry Pi, on a budget. I have built numerous SDI-12 sensor data loggers. This is my latest design that is very easy to use. All you need is the adapter and a PC/Raspberry Pi. It also comes with free data logger program (Python script) for all the above operating systems. A section on SDI-12 sensors will guide you through it. FYI, a $150 windows 10 netbook running on Intel ATOM Z3000 series or faster is more than enough to log data. All of the examples in this manual came from one such netbook. A first-generation Raspberry Pi is more than enough for data logging.
SDI-12 sensors tested
So far, I have been able to get hold of the following sensors and tested them all with the adapter. Apogee’s sensors all require command re-send, which is implemented in the adapter. Decagon’s sensors all claim to have 4V digital logic but their engineers confirmed that they are 5V tolerant. In theory, all SDI-12 sensors should work with my adapter but in practice not all sensors were made equal. The following list will keep expand as I get more sensors to test.
- SI-411 (standard field of view infrared radiometer sensor)
- CKC 6 sensor probe
- CS650 30cm Soil Volumetric Water Content Probe (Thanks Stan!)
- CS655 12cm Soil Volumetric Water Content Probe (Thanks Nick!)
- DS-2 (Sonic Anemometer)
- VP-3 (temperature, barometer, humidity sensor)
- PRI (spectral reflectance sensor)
- NDVI (spectral reflectance sensor)
- GS3 (Ruggedized Soil Moisture, Temperature, and Electrical Conductivity Sensor)
- MPS-6 (Calibrated Water Potential Sensor)
- 5TM (Soil Moisture and Temperature Sensor)
- Digital turbidity sensor
- TriSCAN (12 moisture salinity temperature sensor probes)
Data Logging (Windows/Mac/Linux/Raspberry pi)
The adapter has been designed for long-term data logging, not just hours, days, or weeks, months at a time. The data logging software can also run without problems for months. You can sit back and watch the Python data collection script collect data automatically. My Python script is free and open source and has the following features.
- Automatically names files with start date such as 20160426.CSV
- Uploads data to a server so you can remotely access you data, or plot them with Google Charts (Python logger code)
- A free web page is provided so you can start making your own remote dashboard for your logger (Python logger code)
- Select sensor address
- Enter total data points
- Enter delay between data points
- Select GMT or Local time zone for time stamp stored in local log file
Data logger running on a Raspberry PI 2 B
Webpage dashboard for my sample data logger (use it for free)
Just run the python data logger script in Tera Term. Your data will be stored where this script is so if you store the script in a cloud drive, you will be able to view your data remotely. Otherwise, use the data server to store your data and retrieve them.
The following shows temperature of a 30-day run:
Local data log file Format
Your data will be stored in comma-separated-value (.CSV) format. The file name is the date and time when the script starts logging data. There are at least three columns. The first column is the date and time the data point is collected. Depending on your choice, it is either in GMT/UTC or local time. The next column is the sensor address. The third column is the first value returned by your sensor. If your sensor returns more than one value, additional columns will contain additional values.
This file format is ready to be read by any major data analysis tools such as Excel, Open Office Calc, or the more expensive Origin Pro. Here is a sample of data collected from a Decagon 5TM soil temperature and moisture sensor. The first data column is the relative dielectric constant (1 for air, yes, it’s NOT in soil). The second data column is temperature.
2015/10/31 18:30:59, 1, +1.04, +25.0
2015/10/31 18:31:27, 1, +1.04, +24.9
2015/10/31 18:31:56, 1, +1.04, +24.9
Where to buy:
This hardware is for sale in several online stores that ship internationally.
Buy directly on my blog:
Buy from inmojo.com online store:
Here is my store front at inmojo.com:
There are many options such as 10 adapter and USB cable pack for a discount. You can buy just the adapter. You will need a mini-USB cable to connect it to your computer or raspberry pi. Or you can get a kit with a Molex mini-USB cable from Digikey. If you are interested in logging data with a raspberry pi, I can load the necessary program to an 8GB microSD card as the third buying option. It’s plug and play. My blog only has one option, the adapter. My inmojo store has all the options mentioned above.
Data logger programs:
All my code are in Python. You can run them on Windows PC, Linux, Raspberry Pi, and Mac OSX:
This version adds support to reading 4 analog inputs on the SDI-12 + Analog USB adapter. There is an additional interactive question asking you whether to read analog inputs (Y/N). Select N if you have a regular SDI-12 USB adapter. If you stored answers to these interactive questions in a file to start the logger program without human interaction, you will need to add an additional answer Y or N to your answer file.
This version lists USB vendor ID (VID) of each serial port. The VID for my adapter is 0403. This helps you identify which serial port is the adapter.
This version also logs data to a phant server and to a local file. You need internet connection for telemetry.
This version logs data to a local file.
This script discovers the address of the sensor and gives you the option to change its address. It MUST run with a single sensor on the bus. Run this script with each new sensor to set their addresses to a unique value 0-9, A-Z, A-y (z is used by the adapter).
This script scans the bus and prints all discovered sensor addresses and information. It helps with system diagnostics. The sensors on the bus MUST have been configured with unique address, with sensor config script. Otherwise they may all be at address zero.
Need some help?
If you need more sophisticated data logging scripts such as logging multiple sensors or sensor with more than 6 output values or integrating SDI-12 sensors in projects using Arduino, I should be able to help. Contact me on inmojo.com or leave a message on my blog. I am a full-time physics professor so my time during semesters may be limited. I have more time during the summer though.