Hi Guys:
I have several sesonsors SRS from Decagon Devices. This kind of sensors can comunicate using SDI-12 protocol. Ok. I download a library about SDI-12.
This is my code:

#include <SDISerial.h>
#define defino_pin_n2 2
#define INVERTED 1

SDISerial mi_sensor_n2(defino_pin_n2, INVERTED);

char* tomar_medida_n2(){
  char* id_sensor = mi_sensor_n2.sdi_query("?M!",1000);//El comando ?M!, genera la dirección o id del sensor
  char* mi_sensor_n2_leido = mi_sensor_n2.wait_for_response(1000);
  return mi_sensor_n2.sdi_query("?D0!",1000); //El comando ?D0!, toma la medida de los sensores
void setup(){
  Serial.begin(9600); // start our uart
  Serial.println("Progra inicializado"); 

void loop(){
  char* lectura_sensor = tomar_medida_n2();
 Serial.println(lectura_sensor); //just a debug print statement to the serial port

When I execute the code everything it’s ok. However, when program show data sometimes (watch image attached just read adress from sensor) showing a unique value. This is a proble because if I need a data every 20 seconds for example and the program just give me the adress I’m losting a value. Anybody can help me please?

Please use [code]  [/code] tags next time, thank you

@quiqueapolo, stop cross-posting. Threads merged.

I can't figure out how the behavior you're getting differs from the expected behavior. Can you like, post (as text, not an image. Never post pictures of text, post the text as text) what the output you get is, and what the output should be?

What is that first screen shot you're posting supposed to show? What program is that?