Question
DS18B20 not registering with internal pullup resistor
- August 14, 2024
- 2 replies
- 1691 views
I am trying to use the DS18B20 temp sensor on a stm32h7 board to display the current temperature using putty, and if the temp is higher than 45 degrees celsius to display a heat warning, but for whatever reason the sensor is not beign registered.
I have connected the vdd cable to the 5v pin and the data cable to the A2 pin, I have configured the A2 pin as Output Open Drain with pull-up and I think that the sensor is not being registered.
I have attached my code so far
I also get abnormal readings like these, no matter if the sensor is plugged in or not:
"""
"""
Heat Warning! Current Temperature: 2693.75°C
Heat Warning! Current Temperature: 1515.38°C
Heat Warning! Current Temperature: 821.12°C
Heat Warning! Current Temperature: 3424.06°C
Heat Warning! Current Temperature: 1877.06°C
Heat Warning! Current Temperature: 2543.00°C
Heat Warning! Current Temperature: 2560.12°C
Heat Warning! Current Temperature: 1713.81°C
"""
Heat Warning! Current Temperature: 1515.38°C
Heat Warning! Current Temperature: 821.12°C
Heat Warning! Current Temperature: 3424.06°C
Heat Warning! Current Temperature: 1877.06°C
Heat Warning! Current Temperature: 2543.00°C
Heat Warning! Current Temperature: 2560.12°C
Heat Warning! Current Temperature: 1713.81°C
"""
I followed a lot with this tutorial: https://controllerstech.com/ds18b20-and-stm32/#google_vignette
So I think I got the delays correct but I am not entirely sure
Any help would be really appreciated
