The code example demonstrates how to interface PSoC4200BLE device with DHT11 sensor.
OverviewDHT11 is the temperature and humidity sensor used to measure the temperature and humidity of the environment. The sensor output is digital value and is interfaced with PSoC4200BLE to decode the digital output.
This code example demonstrates the interfacing PSoC4200BLE with DHT11 sensor. The custom protocol is developed to receive the data from DHT11 sensor.
RequirementsDesign Tool: PSoC Creator 3.3 SP1 and above
Programming Language: C (ARM GCC 4.9-2015-q1-update – included with PSoC Creator)
Associated Devices: PSoC4200, PSoC4200BLE, PSoC4200M, PSoC4200L devices
Required Hardware: CY8CKIT – 042-BLE Pioneer kit
Hardware SetupThe project can be tested on the CY8CKIT-042 Pioneer Kit. DHT11 sensor has to be interfaced with PSoC4200BLE device.
This project demonstrates developing custom protocol on PSoC4200BLE to interface with DHT11 sensor. The below link explains the details about the timing diagram of the DHT11 sensor:
http://www.micropik.com/PDF/dht11.pdf
PSoC Creator Schematic:
DHT11 has the data terminal which is bidirectional. The PSoC GPIO is configured as open drain drive low mode. External pull up resistor which is 5k is used at Data line of DHT11 sensor. So DHT_Pin is used to interface with Data pin of DHT11 sensor. The output is displayed over UART terminal.
In order to generate delay without using CyDelay() API, timer block is used. Delay_Timer is used for generating delay. Similarly Data_Timer is used to capture the counter values when DHT_Pin_ISR is generated.
Build the project and program it to the PSoC 4200 BLE Pioneer Kit. The output will be displayed in Serial communication viewer, using UART terminal.
The Data waveform of DHT11 pin is:










Comments