1-Wire Temperature Sensor
Datasheet
1.
🔽 Install Arduino IDE
Install the Arduino IDE
2.
📦 Install the library
Start the Arduino IDE, press the Sketch menu, and then Include Library > Manage Libraries
. Search for DallasTemperature
and install the library. There are also lots of other 1-Wire/DS18B20 libraries, any of them will work if you prefer.
3.
🔢 Code
Several example sketches can be found in File > Examples > Dallas Temperature
in the Arduino IDE.
Be sure to change the code as needed for the specific wiring.
// Data wire is plugged into port 2 on the Arduino
#define ONE_WIRE_BUS 2
4.
➡️ Upload the code
Pick the board and port, then Upload the code.
5.
🔎 View the output
Open the Serial Monitor, measurements should be displayed in the monitor, with updates every second.
1-Wire/DS18B20 sensors are supported with native ESPHome components. You can read about usage on their website.
Wiring
1-Wire/DS18B20 sensors are natively supported by the Raspberry Pi kernel. Read more about using them here.