Skip to content

DS18B20 is not responding on version 4.0.1 #265

@Chico0212

Description

@Chico0212

The pinnout is right, and the sensor is responding properly when using 3.9.0, but, with 4.0.1 it's not working.

Code

this is my code:

#include "DallasTemperature.h"
#include "OneWire.h"

#define TEMP_PIN 32

OneWire oneWire(TEMP_PIN);
DallasTemperature sensors(&oneWire);
DeviceAddress endereco_temp;

void getTemperature() {
  sensors.requestTemperatures();

  Serial.print("Temperatura = ");
  Serial.println(sensors.getTempC(endereco_temp), 2);

  if (!sensors.getAddress(endereco_temp, 0)) {
    Serial.println("SENSOR NAO CONECTADO");
  } else {
    Serial.print("Temperatura = ");
    Serial.println(sensors.getTempC(endereco_temp), 1);
  }

  data.temperature = sensors.getTempC(endereco_temp);
}

When using 3.0.1

Image

Screencast.from.2025-01-20.11-35-35.mp4

when using 4.0.1

Image

Screencast.from.2025-01-20.11-38-17.mp4

Ps: I didn't post the pinnout because its caotic...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions