Skip to main content
4 of 4
make title more descriptive
tlfong01
  • 4.9k
  • 3
  • 12
  • 24

DS18B20 Temperature Sensor - Rpi 3/4 Driver, Wiring, Detection, and Python Programming

I am new in raspberry pi. In my research project, I would like to monitor ground temperature at 60 points. My team decided to set a monitoring system using raspberry pi.

As a preliminary test, I connected 4 DS18B20 sensors to my pi; it can find sensors and read temperature correctly. Unfortunately, when I connected an additional DS18B20 to the pi (so total 5 DS18B20 were linked to the pi), it stopped monitoring and gave no value. (I tried to reboot the system; however the pi can't read the temperature)

After this weird situation, I disconnected the last sensor (so subsequently total 4 sensors were connected to the pi); then the pi started to read the temperature. I have attached two photos of a breadboard with 4 and 5 sensors.

Breadboard with 4 sensors - work Breadboard with 5 sensors - doesn't work

I really want someone can explain this to me.

Thank you for reading.

UPDATE

I updated config.txt and opend 4, 17, 27 pins. So now I am using 3 pins. As a first trial, I connected 4, 4, and 2 DS18B20s to 4, 17, and 27 pins, respectively. Interestingly, my RPi can find every sensors in this case. Followings are PCB and Terminal screen.

teminal with 4, 4, 2 connection PCB with 4, 4, 2 connection

Then, I connected 5, 4, 1 DS18B20s to 4, 17, and 27 pins, respectively. In this time, my RPI can detect only 5 sensors which are connected to 17 and 27 pins. Followings are PCB and Terminal screen.

teminal with 5, 4, 1 connection PCB with 5, 4, 1 connection

I am guessing that there is a restriction on the number of DS18B20 on a bus. Am I right?