![adafruit trinket clone adafruit trinket clone](https://arduining.files.wordpress.com/2014/02/athand.jpg)
If everything went well, we can already read the temperature and humidity. This creates a Python library that we can easily integrate into our projects. I use a pre-built Adafruit library that supports a variety of sensors: git clone https : ///adafruit/Adafruit_Python_DHT.git & cd Adafruit_Python_DHT Now the library for the sensors can be loaded.
#Adafruit trinket clone update
For the sake of completeness, I’ll show it here anyway (you can skip this part if everything worked before): sudo apt - get update
![adafruit trinket clone adafruit trinket clone](https://cdn.learn.pimoroni.com/article/raspberry-pi-programming-adafruit-trinket/assets/trinket-pi-overview.jpg)
There is also another repository from Adafruit, which should no longer be used. Then we execute our code: sudo python dht_example.py We save the file with CTRL + O and exit the editor with CTRL + X. Note that you replace adafruit_dht.DHT22 with adafruit_dht.DHT11 if you are using a DHT11 temperature sensor. Then we create a new file with our code: sudo nano dht_example.py
#Adafruit trinket clone install
I use a ready-made library from Adafruit that supports various sensors sudo pip3 install adafruit-circuitpython-dht The library for the sensors can now be loaded. Sudo apt - get install build - essential python - dev python - openssl git Raspberry Pi Humidity Software Installation and Testingįirst of all, some packages have to be installed: sudo apt - get update The structure is identical for DHT11 or DHT22 since the pins are assigned the same way. The second pin from the right of the sensor remains free. The left pin of the sensor is connected to 3V3 of Pi (pin1), the second sensor pin via a pull-up resistor (4.7k – 10kΩ) with a free GPIO of the raspberry (GPIO4, pin7) and the right senior pin comes at GND (Pin6) from the Pi. In general, the 11er model should also be enough.
![adafruit trinket clone adafruit trinket clone](https://content.instructables.com/ORIG/F31/0F58/IE7J3RWS/F310F58IE7J3RWS.jpg)
For example, I have a DHT22 sensor in my fridge to measure and log temperature and humidity. For applications in “extreme” areas (0-20% or 80-100% humidity), the DHT22 should be used, as it also supports these areas in contrast to the DHT11. As a result, the DHT11 (blue) is cheaper, but the DHT22 (white) is more precise and lasts longer. You can see the difference between DHT11 and DHT22 here. Sensors such as the DHT11 and DHT22 are not only available for a few euros, but they can also measure the temperature as well as the humidity.Īs the sensors already carry (almost) everything, apart from a resistor, not many additional accessories are required. In addition, however, the humidity in certain situations or projects (such as a weather station) can be enlightening. With the Raspberry Pi and some sensors, it is easy to measure the temperature without much effort.