# DS18B20 Temperature Sensor Configuration

**URL:** <https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429>\
**Category:** General Discussion\
**Created:** [May 16, 2023, 2:48pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429 "2023-05-16T14:48:30Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![sl4m01](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sl4m01](https://klipper.discourse.group/u/sl4m01)\
**Post date:** [May 16, 2023, 2:48pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/1 "2023-05-16T14:48:30Z")

</div>

Dear all,  
i do have a problem connecting a DS18B20 Temperature Sensor to my Raspberry pi 2b.  
I connected VCC to 5V, GND to GND and Sig to GPIO 4.  
Now i want to find out the serial number, however with no success:

First there is no /sys/bus/w1/devices/ and after giving some command i found online i see no serial number …

```auto
pi@fluiddpi:~ $ cd /sys/bus/w1/devices/
-bash: cd: /sys/bus/w1/devices/: No such file or directory
pi@fluiddpi:~ $ sudo modprobe w1-gpio
pi@fluiddpi:~ $ sudo modprobe w1-therm
pi@fluiddpi:~ $ cd /sys/bus/w1/devices/
pi@fluiddpi:/sys/bus/w1/devices $ ls
pi@fluiddpi:/sys/bus/w1/devices $ ^C

```

What am i doing wrong? ☹  
Can someone help?

PS i used KIAUH to install Fluidd and klipper

 ![20230516_164258](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/f/fa7826c4141c25a029b8ae8beb3752f4889142a7.jpeg)

---

<div class="post-metadata">

**Author:** ![sl4m01](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sl4m01](https://klipper.discourse.group/u/sl4m01)\
**Post date:** [May 16, 2023, 2:50pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/2 "2023-05-16T14:50:39Z")

</div>

![20230516_164310](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/a/aa08bd5f59726ee82b8ae341cc09c1de16b73ba4.jpeg)

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [May 16, 2023, 5:15pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/3 "2023-05-16T17:15:56Z")

</div>

It is never good to use the same colour for VCC and GND.  
Did you check those cables twice already?

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [May 16, 2023, 5:55pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/4 "2023-05-16T17:55:20Z")

</div>

1. Call `sudo raspi-config`
2. Activate the 1-wire interface
3. Reboot
4. Call `lsmod | grep -i w1_` to verify that the needed Kernel modules are actually loaded

---

<div class="post-metadata">

**Author:** ![sl4m01](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sl4m01](https://klipper.discourse.group/u/sl4m01)\
**Post date:** [May 16, 2023, 6:06pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/5 "2023-05-16T18:06:26Z")

</div>

Hello, thank you for your answers.  
Just before you wrote the answer i got the sensor to work in ssh.  
I followed this thread [w1-gpio & w1-therm in etc/modules not recognized. - Raspberry Pi Forums](https://forums.raspberrypi.com/viewtopic.php?t=100525)

But i am getting errors in Fluidd.  
I added this to my printer.cfg

```auto
[temperature_sensor Chamber]
sensor_type = DS18B20
serial_no = 28-030897945420
ds18_report_time = 1.0
sensor_mcu = host_mcu

```

I am getting this error after restart:

> Unknown config object ‘mcu host\_mcu’

Already tried `sensor_mcu = host` but didnt work…

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [May 16, 2023, 6:08pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/6 "2023-05-16T18:08:02Z")

</div>

Post your klippy.log

---

<div class="post-metadata">

**Author:** ![sl4m01](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sl4m01](https://klipper.discourse.group/u/sl4m01)\
**Post date:** [May 16, 2023, 6:11pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/7 "2023-05-16T18:11:37Z")

</div>

[klippy.log](https://klipper.discourse.group/uploads/short-url/o4sT5UAYyDbhlDN9WmRJQnth19i.log) (381.6 KB)

---

<div class="post-metadata">

**Author:** ![sl4m01](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sl4m01](https://klipper.discourse.group/u/sl4m01)\
**Post date:** [May 16, 2023, 6:15pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/8 "2023-05-16T18:15:07Z")

</div>

i changed it to

```auto
[temperature_sensor Chamber]
sensor_type = DS18B20
serial_no = 28-030897945420
ds18_report_time = 1.0
sensor_mcu = mcu

```

But now i am getting …

```auto
MCU Protocol error

This is frequently caused by running an older version of the
firmware on the MCU(s). Fix by recompiling and flashing the
firmware.

Your Klipper version is: v0.11.0-148-g52f4e20c
MCU(s) which should be updated:

Up-to-date MCU(s):
mcu: Current version v0.11.0-148-g52f4e20c

Once the underlying issue is corrected, use the "RESTART"
command to reload the config and restart the host software.

mcu 'mcu': Unknown command: config_ds18b20

```

Not sure if i have to flash a newer firmware or i did something wrong in the config :X

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [May 16, 2023, 6:19pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/9 "2023-05-16T18:19:57Z")

</div>

Follow [RPi microcontroller - Klipper documentation](https://www.klipper3d.org/RPi_microcontroller.html)

---

<div class="post-metadata">

**Author:** ![sl4m01](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sl4m01](https://klipper.discourse.group/u/sl4m01)\
**Post date:** [May 16, 2023, 6:27pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/10 "2023-05-16T18:27:22Z")

</div>

Do you mean i have to setup a second mcu on my RPI only to display the temperature values?  
Not sure if i want to touch a smooth running system only for that to be honest.  
Are there other advantages or am i getting it wrong?

Because by setting

> [temperature\_sensor raspberry\_pi]  
> sensor\_type: temperature\_host

i can see the RPi Temperature

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [May 16, 2023, 6:42pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/11 "2023-05-16T18:42:45Z")

</div>

See [Klipper Architecture / Ecosystem](https://klipper.discourse.group/t/klipper-architecture-ecosystem/6313) for how Klipper works.  
If you want to connect any additional hardware to the RPi’s GPIOs, like 1-wire, IMUs etc, then you have no other choice.

Be sure to mind the limitations listed here [Configuration reference - Klipper documentation](https://www.klipper3d.org/Config_Reference.html#ds18b20-temperature-sensor)

---

<div class="post-metadata">

**Author:** ![sl4m01](https://avatars.discourse-cdn.com/v4/letter/s/ce73a5/32.png) [@sl4m01](https://klipper.discourse.group/u/sl4m01)\
**Post date:** [May 17, 2023, 7:04am UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/12 "2023-05-17T07:04:47Z")

</div>

Thank you for the hint. I was not aware of this.  
I set the RPI as a second mcu and now the temperature sensor is working well.  
Was less effort than expected in the end 🙂

---

<div class="post-metadata">

**Author:** ![Gokuh1980](https://avatars.discourse-cdn.com/v4/letter/g/82dd89/32.png) [@Gokuh1980](https://klipper.discourse.group/u/Gokuh1980)\
**Post date:** [January 3, 2024, 12:35pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/13 "2024-01-03T12:35:37Z")

</div>

Hi! It is possible to use DS1821S? i think it´s not, because in config reference only exists DS18B20, could be added to klipper as they are very similar?

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [March 7, 2024, 9:26pm UTC](https://klipper.discourse.group/t/ds18b20-temperature-sensor-configuration/8429/14 "2024-03-07T21:26:33Z")

</div>


