linux icon indicating copy to clipboard operation
linux copied to clipboard

Pi 5 + Bookworm: DS18B20 1-Wire unstable on GPIO 4 (worked fine on Pi 3)

Open Fr8929 opened this issue 6 months ago • 0 comments

Describe the bug

Board: Raspberry Pi 5
OS: Raspberry Pi OS Bookworm (2025), fully updated
Kernel: Output of uname -a: (paste it here)

Problem description:
The DS18B20 temperature sensors connected to GPIO 4 via the w1-gpio overlay are highly unstable on Pi 5.

Same wiring, cables, sensors, and power supply worked perfectly on Pi 3 with Raspberry Pi OS Bullseye.

With Pi 5:

  • Sensors frequently disappear and reappear.
  • Readings fail randomly.
  • w1_slave sometimes returns empty or nothing at all.

All sensors are connected through:

  • Shielded cable (2m),
  • 4.7k pull-up to 3.3V,
  • Standard dtoverlay=w1-gpio in /boot/firmware/config.txt

This makes the system unusable in production for home automation.

Request:
Please confirm if this is a known kernel/GPIO/pinctrl issue on Pi 5.
Are there GPIO changes that break the timing for 1-Wire?

Thanks for your support.

Steps to reproduce the behaviour

  1. Connect DS18B20 sensor to GPIO 4 (w1-gpio).
  2. Use a 4.7k pull-up to 3.3V.
  3. Add dtoverlay=w1-gpio to /boot/firmware/config.txt.
  4. Boot the Raspberry Pi 5.
  5. Use cat /sys/bus/w1/devices/w1_bus_master1/w1_master_slaves and cat /sys/bus/w1/devices/28-*/w1_slave to read values.
  6. Sensors appear/disappear or return invalid data.

Device (s)

Raspberry Pi 5

System

Raspberry Pi reference 2025-05-13 Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 5dabc7dc940059dfbc46af5d97b60a1e812523dd, stage2 2025/05/08 15:13:17 Copyright (c) 2012 Broadcom version 69471177 (release) (embedded) Linux Domoticz 6.12.25+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.12.25-1+rpt1 (2025-04-30) aarch64 GNU/Linux

Logs

No relevant kernel logs for w1 found with dmesg | grep w1.

Additional context

Used same wiring and sensors with Raspberry Pi 3 (Bullseye), everything worked reliably.
On Pi 5, the 1-Wire bus is unstable even with a short cable and clean wiring.
I disabled notifications from my domotic system (Domoticz) because of false loss of sensors.

Fr8929 avatar Jun 21 '25 19:06 Fr8929