The external pins in the Raspberry Pi are great, but they don't offer much without a connection to the outside world. Another constraint that these pins have is that they cannot read analog values (such as the pins on an Arduino board). This means that each pin can read only a binary value.
Traditional sensors work by having a variable resistance, which changes with the quantity they want to measure. This, in turn, changes the current flowing through the circuit that can be measured by analog pins but not by the ones on the Pi.
We solve this problem using a digital sensor. These sensors work by giving us information in the form of bits at a fixed sampling rate. This is where the DHT11 sensor comes in. It is a low-cost digital temperature and humidity sensor. It has four pins, out of which three will be of use to us.
If you purchase a DHT11 sensor in the...