Interference of Adafruit Logger Shield with DS18B20 Temp Sensor?

Hello Everyone

I want to use my Arduino Uno with the Adafruit Data Logger Shield (R3 comp.) and a DS18B20 Temperature Sensor.

To test the sensor I use the code below. If i plug the sensor to Pin 10 I get good readings. So I assume the wiring and code are both working fine. However, if I connect the sensor to any other Pin I only get 0°C as result.

Any thoughts what could be wrong? Is there an interference with the logger shield? I tested a bunch of other sensors (dht, photoresistance, capacitive moisture sensor) and they are all working fine on any pin I like. So I really don't know what could cause the problem.

Thanks in advance for your thoughts!!

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 5

OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

 float Celcius=0;
 float Fahrenheit=0;
void setup(void)
{
  
  Serial.begin(9600);
  sensors.begin();
}

void loop(void)
{ 
  sensors.requestTemperatures(); 
  delay(1000);
  Celcius=sensors.getTempCByIndex(0);
  Serial.print(" C  ");
  Serial.print(Celcius);
  delay(1000);
}

Did you change this line when you changed the pin

#define ONE_WIRE_BUS 5

Have you got a 4k7 resistor in circuit ?

Also the shield maybe using some of the pins, check that .

yes, i always adapt the pin number to the one i m intending to use.

the 4.7 k resistor is there. like i said: i get good readings on pin 10.

the shield is using pin 10 for communication with the sd card. the weird thing is that when i stack the shield on top but dont use it i get good readings on pin 10. but only on pin 10. all the others dont work. if i use the shield to store data on the sd card the sensor stops working on pin 10 as well. (which makes sense since pin 10 then is used for communication with the shield...).

i dont understand why other pins dont work.