Esp32 V2 with DS18B20

Hi I’m nic.
I am testing with esp32V2 and DS18B20.
However, there was a problem.
Read the correct data only on pin 14. The rest of the pins are shown as Caution-127.
I used onewire and dallas library.
Is there a problem?
I want to read the data using pin 36.

Hello, I want to know more about the situation.
I don’t know how pin 14 differs from other pins.
Can you show your code?

Pin36 is a free pin,

Pin36 I believe is an input only pin. It will not send a the commands to the DS18B20.

The DS18B20 can be programmed as an alarm only device, I have not done this myself but from what I understand you would put the DS18B20 in to another arduino and set the alarm threshold, the chip will then check the temperature and compare it with what you have set in the user rom and if that is exceeded fire an alarm state out the 1wire line.

If however you are reading the temperatures you need to send a command to the DS18B20 using the onewire lib and tell it to return the temperature.

on startup you also need to configure the DS18B20 with the relevant settings like what resolution you want returned etc…

I have a unit that was running 40 DS18B20’s off pin 4 and was working a treat, there however was a minor timing issue I had to deal with. After the system came out of deep sleep I had to send the request temperatures twice for some reason or the first sensor in the chain would not return the correct temperature.

To conserve poser I also used the VEXT line to cut power to the sensors when they were not being read. So how my program flow went was like this…

  1. wakeup from deep sleep
  2. enable VEXT
  3. send the resolution required to the DS18B20 (could have set this permanently but for the sake of one line versus several lines it was easier to set it each time the system woke up)
  4. broadcast the get temperatures message
  5. read each sensor’s temperature based on the sensors index.
  6. store the temperatures on the CF card
  7. go back to sleep

Hope this makes sense and helps you out :slight_smile: