ni.com checkout is currently experiencing issues.

Support teams are actively working on the resolution.

LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with humedity/temperature sensor. Arduino+labview.

Im making a proyect with arduino+labview. The proyect consist in control a greenhouse with a few sensors and relay.

My main problem is to obtain the data from Grove- Temp&Hume sensor. Signal Data is 40 bit, comprised of 16 bit humidity data, 16 bit temperature data and 8 bit checksum.The data format is: 8bits integer part of humidity+8bits decimal part of humidity +8bits integer part of temperature+8bits decimal part of temperature +8bits checksum.

With the LIFA toolkit if i use an analog read pin, i obtain the output voltage of this analog pin, and i dont know how to change this voltage into the 40bit signal.

Any help will be wellcome.

Thanks

0 Kudos
Message 1 of 7
(7,052 Views)

I don't know a whole lot about one wire communication but because timing is critical, you would need to implement communication with this device on the arduino itself.  So, basically, you would need to add a function to the LIFA code that communicates and interprets the data from the sensor.

This thread talks about one wire communication with a temperature sensor.  I'm not entirey sure that the sensor you have is using a standardized protocol but it's worth a shot.

0 Kudos
Message 2 of 7
(4,328 Views)

I'm also trying to connect temp/hum sensor and have problems.

I use SHT15 and the library for it - http://www.practicalarduino.com/news/id/211

I created case:

case 0x37:   // Read values from the sensor

       setval1=0;

       setval1=1;

temp_c = sht1x.readTemperatureC();

humidity = sht1x.readHumidity();

Serial.write( temp_c);

Serial.write(humidity );

break;

when the case triggered the read of the sensor is good (I can see on LCD) but I get 5003 err.

I will be very happy if someone can help

Thanks

hraanan

0 Kudos
Message 3 of 7
(4,328 Views)

Thanks for the response.

I will try to explain a bit more my proyect to see if this help. I'm making a control for a greenhouse using 3 sensor, one for light, one moisture sensor, and the humedity and temperature sensor. And controling with 3 relay one solenoid, one lamp and two ventilator.

My idea is this. With one switch, change from arduino self-working to labview control.

For the arduino self-working i dont have problems, my problem is when i try to see on labview the data from temp&hum sensor. Im trying to use case like you are telling me, but i dont know how to do it.

I will show you my code:

     case 0x1E:  // Read sensor

      Sensor_Read();

      break;

byte read_dht11_dat()

{

  byte i = 0;

  byte result=0;

  for(i=0; i< 8; i++){

    while(!(PINC & _BV(styhPin)));  // wait for 50us

    delayMicroseconds(30);

    if(PINC & _BV(styhPin))

      result |=(1<<(7-i));

    while((PINC & _BV(styhPin)));  // wait '1' finish

  }

  return result;

}

void Sensor_Read()

{

  PORTC &= ~_BV(styhPin);

  delay(18);

  PORTC |= _BV(styhPin);

  delayMicroseconds(40);

  DDRC &= ~_BV(styhPin);

  delayMicroseconds(120);

  // now ready for data reception

  for (i=0; i<5; i++)

    dht11_dat = read_dht11_dat();

  temp=dht11_dat[2];

  hum=dht11_dat[0];

  DDRC |= _BV(styhPin);

  PORTC |= _BV(styhPin);

  Serial.write(temp);

  Serial.write(hum);


}

Now my main problem is how to read this on labview. Im using this block diagram:

proyect.jpg

The read for pin 0 and 2 work right, but the problem is read pin 1. Is the hum%temp sensor and this is what i dont know how to do. I want to read:

Serial.write(temp);

  Serial.write(hum);

If any one can help, with the vi that i have to use to read this 2 values and print it, i will be so gratefull.

Thanks and sorry for my english.

0 Kudos
Message 4 of 7
(4,328 Views)

I think there must be ADC that will convert your analog output to digital bits. We can convert it to digital bits by knowing proper resolution of ADC.

So I suggest upload more inforamtion (or datasheet) on sensors you are using.

Uplaod vi also you made till now.

0 Kudos
Message 5 of 7
(4,328 Views)

Here you have the most similar to a datasheet i find. http://seeedstudio.com/wiki/Grove-_Temperature_and_Humidity_Sensor

I ad the vi on the last message.

If you can help me i will be really gratefull.

0 Kudos
Message 6 of 7
(4,328 Views)

you fix your problem? i have try use sht15 too but i don't understand how read the sensor, i have some problema with the pwm port....

0 Kudos
Message 7 of 7
(4,328 Views)