Answer the question
In order to leave comments, you need to log in
Raspberry Pi 3b+ not seeing DS18b20 over 1Wire?
Problem : The new raspbian kernel does not detect the DS18b20 sensor on the 1wire bus. This is due to the Device Tree that was added to Kernel 3.18.8 ( Kernel 3.18.8 breaks 1-wire )
What is available :
Raspberry Pi 3b+ Kernel: 4.14.98-v7+
DS18b20 working, checked on arduino
The signal is pulled up + through a resistor 4.7 to Ω (tested with 1k Ω )
Tested for 3.3v and 5v
Answer the question
In order to leave comments, you need to log in
So there is an answer, but without explaining why this is how the
Clean system works, add it to /boot/config.txt
Next $ pip3 install W1ThermSensor
# DS18B20_test28 tlfong01 2019may10hkt2137 ***
# Raspbian stretch 2019apr08, Python 3.5.3
# W1ThermSensor V0.3.0
# dtoverlay=w1-gpio,gpiopin=14
from w1thermsensor import W1ThermSensor
def findSensor():
for sensor in W1ThermSensor.get_available_sensors():
print(' Sensor ID =', sensor.id)
return
def getTemperature():
sensor = W1ThermSensor()
temperature_in_celsius = sensor.get_temperature()
print(' Temperature in Celsius =', temperature_in_celsius)
return
# *** Main Test ***
print('Begin Testing Ds18B20, ...')
findSensor()
getTemperature()
print('End Testing DS18B20, ...')
'''
Sample Output - tlfong01 2019may10hkt2150
>>>
RESTART: /home/pi/Python Programs/Python_Programs/test1198/ds18b20_test27_2019may1001.py
Begin Testing Ds18B20, ...
Sensor ID = 021312ca3baa
Temperature in Celsius = 25.562
End Testing DS18B20, ...
>>>
'''
# *** End of program ***
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question