Temperature&Humidity sensor - Datasheet?

Hi,
Is there a datasheet for the “Electronic Bricks - Temperature&Humidity sensor” - model ELB146D2P?

We are so sorry that the datasheet is updated now. It will be uploaded to the website soon.

Thanks.

Hi,

Is it possible to get an example code for Arduino?

Thank you.

Hi,

Here is the example code of the sensor.

#define DHT11_PIN 0 // ADC0

void setup()
{
DDRC |= _BV(DHT11_PIN);
PORTC |= _BV(DHT11_PIN);
Serial.begin(9600);
Serial.println(“Ready”);
}

void loop()
{
DHT11();
}
byte read_dht11_dat()
{
byte i = 0;
byte result=0;
for(i=0; i< 8; i++){
while(!(PINC & _BV(DHT11_PIN))); // wait for 50us
delayMicroseconds(30);
if(PINC & _BV(DHT11_PIN))
result |=(1<<(7-i));
while((PINC & _BV(DHT11_PIN))); // wait ‘1’ finish

}
return result;

}

void DHT11()
{

byte dht11_dat[5];
byte dht11_in;
byte i;
// start condition
// 1. pull-down i/o pin from 18ms
PORTC &= ~_BV(DHT11_PIN);
delay(18);
PORTC |= _BV(DHT11_PIN);
delayMicroseconds(40);

DDRC &= ~_BV(DHT11_PIN);
delayMicroseconds(40);

dht11_in = PINC & _BV(DHT11_PIN);

if(dht11_in){
	Serial.println("dht11 start condition 1 not met");
	return;
}
delayMicroseconds(80);

dht11_in = PINC & _BV(DHT11_PIN);

if(!dht11_in){
	Serial.println("dht11 start condition 2 not met");
	return;
}
delayMicroseconds(80);
// now ready for data reception
for (i=0; i<5; i++)
	dht11_dat[i] = read_dht11_dat();
	
DDRC |= _BV(DHT11_PIN);
PORTC |= _BV(DHT11_PIN);

    byte dht11_check_sum = dht11_dat[0]+dht11_dat[1]+dht11_dat[2]+dht11_dat[3];
// check check_sum
if(dht11_dat[4]!= dht11_check_sum)
{
	Serial.println("DHT11 checksum error");
}

Serial.print("Current humdity = ");
Serial.print(dht11_dat[0], DEC);
Serial.print(".");
Serial.print(dht11_dat[1], DEC);
Serial.print("%  ");
Serial.print("temperature = ");
Serial.print(dht11_dat[2], DEC);
Serial.print(".");
Serial.print(dht11_dat[3], DEC);
Serial.println("C  ");

delay(200);

}

Thanks,
-SQX

Thank You. Much appreciated

hi,
the datasheet on the product page, says the measurements are 16 bit.
however, the sensor only writes the 1st byte, and the 2nd is always zero.

also, the example code, does not use the measurements as the datasheet suggests.

anyway, is there some thing i am missing?

can i get decimal values for the temperature? for example 25.7 C ?

Hi,

  1. It just is a demo code. Somewhere doesn’t according to the datasheet. Welcome to improve it.
  2. Sorry to tell you that there isn’t decimal part. The precision isn’t so high.

Thanks

I came across a page, below, which has ported the sample code to a more Arduino-friendly format. I’ve tried the code from this page with the Seeed brick, and it works fine: it gives the same results as Seeed’s sample code.

The page also confirms what others have found: temperature and humidity returned by this brick are always rounded to an integer (e.g. 29.0%, 22.0C), since the underlying DHT11 chip is low resolution. The example in Seeed’s datasheet may be taken from the higher resolution DHT22 chip.

sheepdogguides.com/arduino/ar3ne1humDHT11.htm

Dan.