At the end we will print the temperature and the humidity values on the serial monitor. If you are using Proteus 8 software, then you should have a look at How to add new Library in Proteus 8 Professional.
If you use the DHT11 sensor you will need to you the read11() function. First of all, download this Rain Sensor Library for Proteus, by clicking the below button: Now place these Library files in the Library folder of your Proteus software. Using the read22() function we will read the data from the sensor and put the values of the temperature and the humidity into the t and h variables. In the setup section we need to initiate the serial communication because we will use the serial monitor to print the results.
Related tutorial: Learn how to build an Arduino based Wireless Weather Station Source Codeįirst we need to included the DHT library which can be found from the Arduino official website, then define the pin number to which our sensor is connected and create a DHT object. However, we don’t have to worry much about these timing diagrams because we will use the DHT library which takes care of everything. This protocol requires precise timing and the timing diagrams for getting the data from the sensors can be found from the datasheets of the sensors. The DHTXX sensors have their own single wire protocol used for transferring the data.