The sensor has the following 4 pins:
Simply ignore pin 3, it’s not used. You need to place a 10K resistor between VCC and the data pin, to act as a medium-strength pull up on the data line. The Arduino has built in pullups, so, you can turn on but they’re very weak, about 100K.
This diagram shows how we will connect for the testing sketch. Connect data to pin 2 of Arduino, you can change it later to any pin.
To test the sketch, we’ll use an Arduino. You can use any micrcontroller that can do microsecond timing, but since its a little tricky to code it up, we suggest verifying the wiring and sensor work with an Arduino to start.
Begin by downloading the DHT library from Adafruit’s github repository. To download, click the DOWNLOADS button in the top right corner. Rename the uncompressed folder DHT and make sure that it contains the dht.cpp file and others. Then drag the DHT folder into the arduinosketchfolder/libraries/ folder. You may have to create that libraries sub-folder if it doesn’t exist. Restart the IDE