Unlike Arduino, the Raspberry Pi does not have an ADC (analog-to-digital converter, analog-to-digital converter). For this reason we cannot use analog output temperature sensors like LM35 with Raspberry Pi directly. In this course we will use the DS18B20 temperature sensor with digital communication capability.
(*) The DS18B20 temperature sensor (see illustration above) can also be supplied in a TO92 package and in a prefabricated module that is either waterproof or soldered to the printed circuit board. If you supply it from the Ready module, you do not need the 4.7 kΩ resistor in the material list, because this board already has a resistor. You should use this resistor in waterproof and TO92 cases.
We set up our circuit as shown in the following diagram:
After we have established the connection, we start our Raspberry Pi. The DS18B20 sensor uses a protocol called single-wire.