Go Down

Topic: SDI-12 HELP (Read 1 time) previous topic - next topic

ernany

I have some sensors that only have SDI-12 output. Is there an easy way to interface them with an Arduino?

robtillaart

Do you have more information about the SDI-12 protocol?
or a datasheet of the sensors maybe?

Most sensors can be connected to Arduinbo although some of them are not so easy
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart


Found this one myself - http://en.wikipedia.org/wiki/SDI-12 -

"all SDI-12 communications are transmitted in ASCII at 1200 baud with 7 data bits and an even parity bit."


if you use Serial.begin(1200) you should be able to get data in, you need to strip off the parity bit and then you can strat interpret the bytes...

not tested but this could be the starter
Code: [Select]

NewSoftSerial nss(3,4);  // use software serial so hardware serial is free for PC

void Setup()
{
  Serial.begin(9600);
  nss.begin(1200);
}

void loop()
{
  if (nss.available() > 0)
  {
    int val = nss.read();
    val = val & 0x7F; // strip of one byte
    Serial.print(val, DEC);
  }
}


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

vogel1230

from another post I made earlier.

Quote
I've just received one of these devices. I've yet to hook it up and try it yet, but I thought I would provide the link. I work for the National Weather Service and we use quite a bit of SDI-12. I wanted to see if I could interface with our SDI-12 sensors effectively.

http://www.vegetronix.com/Products/SDI-12.phtml

I have just created an SDI-12 Serial library for Arduino

I would love feedback

https://github.com/joranbeasley/SDISerial

Go Up