Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here
Showcase

SDI-12 sensor display

Whenever we install a sensor in the field, it’s always helpful to make sure it is reading properly before connecting it to the datalogger.  Having a display to show the live data from a sensor is also helpful when doing calibration and testing of the sensor in the lab.  We use a variety of sensors from Decagon Devices.  Their high-quality, research grade sensors output the data in two formats – serial TTL and SDI-12.  It is very simple to read the serial TTL data using an Arduino board.  If you want to connect multiple sensors to the same pins, then you’ll want to switch to the SDI-12 format, because it allows you to assign a unique address to each sensor so you can have multiple sensors connected to the same pins.  (see the SDI-12 library post – link).

Utilizing the SDI-12 library in the Arduino code, I built a handy sensor display box using an LCD display and a Sparkfun ArduinoPro board.  The board captures the SDI-12 string from the sensor, recognizes the type of sensor (each type Decagon sensor sends a unique model number on SDI-12 initialization) and displays the data on the LCD.  The data is updated whenever the user presses the button on the end of the enclosure.

0 0 votes
Article Rating
Subscribe
Notify of
14 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
soildoc
9 years ago

This is brilliant. Is there a “how to build this” for dummies you might link to?

SGFulton
9 years ago

Any idea when your Github site will be up and running?

Steve Roberts
9 years ago

+1 from me for a “how to build for dummies”, would be really appreciated

Mark
7 years ago

Do you have some sketches or schematics available of the hardware? I wonder how you wired SDI to the Arduino.

SGFulton
Reply to  Shannon Hicks
7 years ago

Shannon, I would love a copy of your example code for both SDI12 and serial for the Decagon sensors. I’ve got several CTD-10’s that I”m including in a wireless sensor network and would like to use them with an Arduino Mega, but we haven’t worked with SDI12 yet. Thus the code would be greatly appreciated.

Thanks,
Stephanie

conrad
7 years ago

Dear Shannon,
is there a small tutorial (with parts, wiring and code) for this nice project? It would save me lots of efforts if I could just jump into this without going through all the initial research and trials. So far, I could not find it here and neither on GitHub.
Thank you so much.
Cheers. Conrad

SGFulton
7 years ago

Shannon, I am currently testing the SDI-12 code to connect a Decagon CTD-10 to an Mbili board. According to their specs, they use the same processor (ATmega1284p) and clock speed (8 MHz) as the Mayfly. Using only a “carriage return”, when I hit “send” I get the following back in the serial monitor:

0M!
00013
0D0!
00+192+23.5+136

However, when I hit “send” a second time, I get the following:

0M!
00+192+23.5+13600013
0D0!
00+209+23.4+135

As you know, the “00013” at the end of the second line should be return on a line of its own, without all the data (i.e., 00+192+23.5+136) in front of it. Note that the returned data is the same as the previous measurement (00+192+23.5+136). I’ve tried all the different configurations of “new line, carriage return”, “new line”, “carriage return” with the serial monitor, and both “carriage return” AND “new line” returns the data listed above on the second time I hit send and any subsequent sends. Only the first send returns the correct data. It’s like the serial buffer isn’t flushing from the last 0DO! (“request data from address 0”) sent.

Looking at the code, it does appear that the mySDI12.flush is included after both the “take measurement” request (0MO!) and 0DO! (data request) so I’m not sure what is going on. As I mentioned, the clock speed and microprocessors are the same between the Mayfly and Mbili. I did manage to get the code to work correctly on an Arduino Uno.

Do I need to increase the “delay” time or something? Can you please advise?

Thanks!
Stephanie

Usofia
6 years ago

Dear Shannon,
I am going to build this using Raspberry Pi, MPS-2 (SDI12 sensor) but without using any SDI12 adapter. I could not find any code for programming and how to establish the connection anywhere. Will you please help me to do this?
Thank you so much.

14
0
Click to jump to comments section.x