For the measurement of temperatures in a closed system or of the environment, a lot of sensors can be used with the Arduino. For starters the Dallas DS18X20 sensor is a good choice. Those devices are cheap, easy-to-use, and adding more sensors is simple. The simplicity is archived through the 1-wire technology.
The steps below are needed to get the DS18X20 working with Arduino.
- Installation of the OneWire library
- Installation of the Dallas Temperature Control library
- Open the sample example (Examples -> OneWire -> sample)
- Adjust the connection port to match your Arduino port and upload the sample sketch
Pin layout
Front view (the label is readable)
- Leg 1: GROUND
- Leg 2: DQ
- Leg 3: VDD
Wiring
- Standard wiring for DS18X20
- Parasite power mode wiring for DS18X20