ESP32 DS18B20 Temperature Sensor
This practical low-voltage sensor project turns a generic ESP32 development board into a local temperature monitor. The browser installer removes the Arduino toolchain from the build: flash the matching firmware, open the SpacePC setup page, choose up to two GPIOs and give each probe a useful name. The native SpacePC Home Assistant integration discovers the device over mDNS and creates an independent temperature entity for every configured sensor. MQTT remains optional.
- Build time
- 30 min
- Cost
- from €9.00
- Firmware
- Not available
Features
One or two probes
Use one DS18B20 for a room, aquarium or pipe, or configure a second GPIO and name both measurements independently.
Browser installation
Install the tested ESP32, ESP32-S2, ESP32-S3 or ESP32-C3 build without Arduino IDE or PlatformIO.
Native Home Assistant
The SpacePC integration discovers the device locally, exposes every configured probe and links back to the setup page.
Assembly and wiring
The complete ordered steps are documented below.
Assembly
1. Identify the exact ESP32 family
Read the module or board marking before flashing. Generic ESP32, S2, S3 and C3 builds are separate installer targets even when the boards look similar.
Selecting the wrong chip family can prevent the board from booting. It can normally be recovered by flashing the correct target.
2. Prepare the sensor wiring
Identify VDD, GND and DATA from the sensor supplier's datasheet. Do not rely on wire colours alone, because waterproof probe cable colours are not standardised.
3. Install the pull-up resistor
Connect a 4.7 kΩ resistor between the DS18B20 DATA wire and 3.3 V. The firmware enables the weak internal ESP32 pull-up for short test wiring, but it does not replace the external resistor in a reliable installation.
Wiring
1. Connect ground
Connect the probe GND wire to an ESP32 GND pin while the board is disconnected from USB.
2. Connect 3.3 V
Connect probe VDD to the board's regulated 3.3 V pin. Do not connect the probe to an unverified 5 V pin.
Check the exact development-board pin labels and probe datasheet before applying power.
3. Connect the data GPIO
Connect DATA to a suitable free GPIO. The tested classic ESP32 setup uses GPIO 13. Enter the actual GPIO number in the web setup after flashing.
4. Optional second sensor
Wire the second DS18B20 to a different GPIO with its own 4.7 kΩ pull-up. Leave Sensor 2 GPIO at -1 when no second probe is connected.
Comments (1)
Questions, experiences or notes about this project. New contributions are reviewed before publication.
Heiner
Ich habe damit die Midea Portasplit überwacht, die hat ja diesen Scheiß Bug im Eco Modus und dann kühlt sie nicht mehr richtig. Hab die Sensoren direkt in die Portasplit gebaut, wenn sie jetzt nicht mehr kühlt killt mein HomeAssistant die Steckdose der Midea für 30 Sekunden und dann tut sie wieder richtig. Richtig dummer Worksround aber bei 30 Grad im Dachgeschoss wird man erfinderisch :D

