Connect to DS18D20 sensor

Hello,

I’m trying to connect my potato to a DS18D20 sensor.
I am new to using SBCs I have tried to follow instructions for connecting to an RPi.
Does the potato require a different procedure? If yes then in what way and where can I find some information about this?

Thank you.

HI and welcome.

Looking at the datasheet for your sensor, it looks like it uses 1-Wire. You will need to apply a Device Tree Overlay, there appears to be one called “w1-gpio” for 1-wire that should enable that communication protocol on ‘gpio “4” (BCM)’ according to the comment in the overlay. I ran lgpio bcm 4 and that spit out info for GPIOCLK_0, which is physical pin 7.

I have no idea how to read from it after that, I’ve never used 1-Wire myself.

Here’s some info on GPIO and Device Tree Overlays for the tater, hope it gets you started off in the right direction:

EDIT: Two other things I’d note if you’re new to this SBC:

  1. Watch your heat: Le Potato - Long Term Process Heat
  2. Your’re better off using generic Linux guides. Raspberry pi stuff tends to be pretty specific to broadcom chips, where as the folks at Libre Computer try to do everything the upstream Linux way (Which is awesome, since I daily drive Ubuntu Studio).
2 Likes

Thank you for the comprehensive answer!
There is a lot of info here to process, I will look into all of it :smiley:

Thanks for raising the question and the answer.
I just picked up ds18d20 and gave up dhtxx temporarily as you might find me bouncing on other topics in the community. Le potato goes easy with it.

Most straightforward way is “cat /sys/bus/w1/devices/28-092270560264/w1_slave” and you got the temperature.

Thank you Michelle for the answer.
I have managed to receive data by connection the sensor DAT pin to physical pin #7 (GPIOCLK_0)

I am now trying to connect another sensor (same one - DS18D20) to the potato but trying to connect it to a different GPIO doesn’t seem to work - I find folders that start with 00-XX instead of 28-XX. Do you know which GPIOs can work with this sensor?

Thank you.

Also this is a guide I followed to connect the sensor.
Is it relevant to the potato as well or is it enough to just properly connect the sensor?
Also I used the command sudo ldto enable w1-gpio from this guide and would like to know if it was relevant.

Thank you.

You’ll need to clone the wiring tool from github, then either copy the 1-wire overlay, change the pin, and enable both overlays, or create a single overlay that will enable 1-wire on both of the pins you want.

Here is the for the wiring tool on github:

This is the file you’ll need to copy and edit:

Say you wanted to use pin 13 you would change
gpios = <&gpio GPIOCLK_0 GPIO_ACTIVE_HIGH>;
to
gpios = <&gpio GPIOAO_9 GPIO_ACTIVE_HIGH>;

Afterwards, with the new .dts file saved in the same directory as the original you need to navigate to the “libretech-wiring-tool” project folder (should contain the makefile) in the terminal and run the command “make”. In order to use the version of the tool you just built instead of the installed version, run you ldto commands from that directory with the “./” prefix like this:

angus@aml-s905x-cc:~/Projects/libretech-wiring-tool$ sudo ./ldto enable NAME_OF_OVERLAY

I hope that’s helpful, I’m still learning myself.