Octopus Temperature And Humidity Sensor

From ElecFreaks
Jump to: navigation, search

Introduction

Octopus Electronic Bricks, you can use them build electronics projects just as easy as piling bricks. By using Octopus electronic bricks, you may connect Arduino/Freaduino compatible boards easily with various digital, analog and I2C/Uart interfaces. These the breadboard-less firm connection are prepared to extensive modules like poteniometers, sensors, relays, servos…even buttons, just plug and play.

Temperature and humidity sensor is a module based on DHT11 digital temperature and humidity sensing element. Simple design,and sensitive to the ambient temperature and humidity changes, it can be used for temperature alarm, humidity testing and other works. 3P Octopus Bricks Interface,input 5V - GND, S for signal output.


OCTOPUS Temperature And Humidity Sensor A.JPG Temperature And Humidity Sensor B.jpg

Model: EF04019

Parameter

  • Power supply needs: 5V
  • Interface type: Digital
  • Pin Definition: 1-Signal 2-VCC 3-GND
  • Fast response and High sensitivity
  • Simple drive circuit
  • Stable and long life

Schematic

Temperature And Humidity Sensor D.JPG

Specification

Pin definition and Rating

GND VCC Signal
GND VCC Signal

Usage

  • 3P buckled wires connector

Soil-OB-07.jpg


Hardware Installation

Temperature And Humidity Sensor.jpg

Programming

Includes important code snippet. Demo code like :

#define DHT11_PIN 2 // ADC0 接到模拟口2   

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 setup()
{
 DDRC |= _BV(DHT11_PIN);
 PORTC |= _BV(DHT11_PIN);
 Serial.begin(19200);
 Serial.println("Ready");
}
void loop()
{
 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(2000);
}

Example

The projects and application examples.

Temperature And Humidity Sensor C.JPG


OB.jpg

Soil-OB-06.jpg



SHD IOE01 6.jpg


PushButtonS-07.jpg

Version Tracker

Revision Descriptions Release
v0.9b Initial public release date

Bug Tracker

Bug Tracker is the place you can publish any bugs you think you might have found during use. Please write down what you have to say, your answers will help us improve our products.

Resources

How to buy

Click here to buy:http://www.elecfreaks.com/estore/octopus-temperature-and-humidity-sensor.html

See Also

Other related products and resources.

Licensing

This documentation is licensed under the Creative Commons Attribution-ShareAlike License 3.0 Source code and libraries are

licensed under GPL/LGPL, see source code files for details.

External Links

Links to external webpages which provide more application ideas, documents/datasheet or software libraries