

This is needed because, as already mentioned, multiple devices can be attached to the same bus and this works well if we don’t need to know from which specific sensor the measurement came from. One of the aspects we covered is that, when calling the methods to retrieve a temperature measurement, we can pass a device index, which corresponds to an integer representing from which device we want to get the measurement. Īs also covered in the previous post, we can use the OneWire and the DallasTemperature libraries to interact with the sensor using a higher level interface, without the need to worry about the lower level details of the OneWire protocol.

This protocol allows for more multiple devices to be connected to the same bus and each device has a unique factory programmed and non-changeable 64-bit address. Please check this previous tutorial for the wiring diagram between the ESP32 and the sensor.Īs covered in the mentioned previous tutorial, the DS18B20 uses the OneWire communication protocol. In this tutorial we will learn how to fetch the unique identifier of a DS18B20 sensor, using the ESP32 and the Arduino core. In this tutorial we will learn how to fetch the unique identifier of a DS18B20 sensor, using the ESP32 and the Arduino core. The tests were performed using a DFRobot’s ESP32 module integrated in a ESP32 development board and a waterproof version of the sensor.
