![arduino temperature sensor arduino temperature sensor](https://3.bp.blogspot.com/-aYaJKkzKbhI/VctbdEzG53I/AAAAAAAAAGA/j_kTJFaS4fs/s1600/TMP.jpg)
Scroll down the sub-menu until you are in the section for Examples from Custom Libraries section. Open your File menu and then open Examples. Once you have the libraries installed we can run an example sketch to test our sensor. If you’ve worked on some of the experiments I’ve presented previously you may already have installed this library. Adafruit Unified Sensor Library – This is a “master library” that is used with a number of the Adafruit sensor libraries.Adafruit DHT Sensor Library – This library allows you to easily work with the DHT22, as well as the DHT11 and DHT21.You’ll need to open up your Library Manager in your Arduino IDE and search for the following two libraries: Actually we will need two libraries and the DHT library is dependent upon another one. We will be using a library from Adafruit to simplify our work with the DHT22. You may use any I/O pin for the DHT22, and you can use more than one with the same Arduino.
ARDUINO TEMPERATURE SENSOR CODE
I used digital I/O pin 2 for the sensor output, but that was just because the library I plan to use has example code that uses that pin.
![arduino temperature sensor arduino temperature sensor](https://imgaz1.staticbg.com/thumb/large/2014/xiemeijuan/07/SKU078684/SKU078684A.jpg)
Here is how I hooked up the sensor for my experiment: It is quite easy to connect a DHT22 to an Arduino or any similar microcontroller, as the device only has one output pin that can be connected to any available digital I/O port. The DHT22 is also packaged as the AM2302 (not to be confused with the next sensor on our list). Note that only three of the four pins are used, pin 3 is unconnected. It can be powered with DC voltages ranging from 3 to 5 volts, making it suitable for both 3.3-volt and 5-volt logic devices. It can measure humidity in the range of 20 to 100 percent. The DHT22 has an operating range of -40 to 8-0 degrees Celsius and an accuracy to within 5%.
ARDUINO TEMPERATURE SENSOR SERIAL
This device has a serial digital output and is quite easy to use with the Arduino and other microcontrollers thanks to the availability of several excellent libraries. It is the cousin of the DHT11, it has improved resolution over its relative and is also able to measure negative temperature. The DHT22 is a very popular temperature and humidity sensor. None of these devices is particularly expensive, and all of them are quite easy to use with the Arduino, especially as there are several libraries available for working with them.
![arduino temperature sensor arduino temperature sensor](https://ae01.alicdn.com/kf/HTB16YaAJFXXXXbcXpXXq6xXFXXXY/LM75-Temperature-Sensor-High-LM75A-module-Accuracy-LM75-Temperature-Sensor-Module-for-Arduino-Compatible-withUNO-R3.jpg)
Or you might just want to build your own digital thermometer.Įach of these temperature measurement applications has different requirements. Perhaps you want to keep tabs on a GPU or CPU that’s under a lot of stress. You may be building a data logger for a homebrew weather station. You might be designing an automated fan that switches on when the temperature exceeds a preset value. You may be using your Arduino to control a process where the temperature is critical. There are many reasons you would want to do this. When designing projects around microcontrollers like the Arduino it is often desirable to be able to measure temperature. All of these devices are inexpensive and easy to use.