sensor ds18d20 not working on NRF52840 dongle

Dear all,

I was trying to run example code for nrf52840 dongle. The example exists for nrf52840 Development Kit on this page:

https://docs.zephyrproject.org/latest/samples/sensor/ds18b20/README.html

I fine fine with compiling and running the code, but the way the sensor is set up results in firmware not being able to find the device.

I find two potential causes:

1. I attached the sensor to UART RX pin (I personally modified uart0 pin RX to GPIO 29 instead of default GPIO 24) and I redirected 1-wire bus to uart0 instead of uart1 alias

arduino_serial. Can I do it just so simply? The sensor power line is connected to VDD (I guess default REG0 is 3.0V for nrf52840 dongle), GROUND line is connected to GND and sensor DATA line is connected to GPIO 29 aka uart0 RX. The nrf52840 dongle is powered from 5V USB. There is a 4.7KOhm resistor in between power line and dataline. Do I have to increase REGOUT0 voltage?

2. I am also running USB serial console and sending log printk messages to Uart - USB to see messages on computer.Is the serial console communicating on UART0 therefore misinforming the communication with DS18D20 sensor?

Thank you

Does anyone have a clue why the firmware cannot find the device?

  • Hello,

    I would say that cause #2 is more likely. Perhaps you can try to disable the UART - USB logging, and see if that changes things. Or you can try to replicate the issue on the DK, and then see if you can find a way to solve it. It is a bit easier to work on the DK, because it has a debugger. That way, you can use RTT logging on the DK, and compare the behavior with RTT logging to UART logging, and see if it changes. Does it stop working when you turn on UART logging on the DK, and the sensor and UART shares pins?

    Best regards,

    Edvin

  • Dear sir,

    Thank you very much for your answer,unfortunately, I do not own nrf52840dk.

    Anyway, I disabled all the things related to uart0 except the definition in *pinctrl.dtsi and finally the sensor yields reasonable values.

Related