Lesson 29 IR Obstacle Avoidance Module

Share for us
Share on facebook
Share on twitter
Share on pinterest
Share on whatsapp

Introduction

The digital temperature and humidity sensor DHT11 is a composite sensor that contains a calibrated digital signal output of temperature and humidity. The technology of a dedicated digital modules collection and the temperature and humidity sensing technology are applied to ensure that the product has high reliability and excellent long-term stability.

Required Components

 1 * Raspberry Pi

– 1 * Breadboard

– 1 * Humiture module

– 1 * 3-Pin anti-reverse cable

Experimental Principle

Only three pins are available for use: VCC, GND, and DATA. The communication process begins with the DATA line sending start signal to DHT11, and DHT11 receives the signal and returns an answer signal, then the host receives the answer signal and begins to receive 40-bit humiture data (8-bit humidity integer + 8-bit humidity decimal + 8-bit temperature integer + 8-bit temperature decimal + 8-bit checksum). For more information, please refer to the datasheet of DHT11.

Experimental Procedures

Step 1: Build the circuit.

Raspberry PiGPIO Extension BoardHumiture Module
GPIO0GPIO17SIG
3.3V3V3VCC
GNDGNDGND

For C Users:

Step 2: Change directory. 

    cd /home/pi/SunFounder_SensorKit_for_RPi2/C/28_humiture/

Step 3: Compile.

    gcc humiture.c -lwiringPi

Step 4: Run.

    sudo ./a.out

For Python Users:

Step 2: Change directory. 

    cd /home/pi/SunFounder_SensorKit_for_RPi2/Python/

Step 3: Run.

    sudo python3 28_humiture.py

Now, you can see humidity and temperature value printed on the screen.