This article describes temperature and humidity measurement with DHT11 sensor connected to TR module. Circuit diagram is very simple. You need only power supply for sensor and one wire for data line. This line has to be “pull-uped” – sensor has open colector output.
Attached source code reads data every second. Then data are sent out of module via RF. As receiver, you can use E03-TR example (TR module has to be inserted in CK-USB-0X) and IQRF IDE terminal, or you can use RF-UART conversion source code (UART_LINK.c) and any serial terminal. If you prefer simple solution, use the GW-USB-05.
Source code is written as “Ready To Use”. You have to only call readDHT11 routine and check returned flag.
#define OK 0 - OK #define NO_PULLUP 1 - bad wiring, missing pull-up #define NO_ACKNOWLEDGE_0 2 - ACK "0" does not come #define NO_ACKNOWLEDGE_1 3 - ACK "0" does not come #define NO_DATA_0 4 - timeout for reading log.0 #define NO_DATA_1 5 - timeout for reading log.1 #define NO_CRC 6 - checksum error
Following picture shows interconnection between DHT11 and IQRF TR module.
Post sent by Tomáš Novotný.