Help! Dallas DS18B20 works on any Arduino UNO pin apart from pin 13

Hi,

Tearing my hair out hear.

For my project I am using a DS18B20 on pin 13.

All other digital pins are in use Nothing can be moved around due to the shield combo I am using so it has to be pin 13 DS18B20 has to be used in parasitic mode

And it just wont work. I get readings of 0

If I temporarily move it to any other digital pin (And change the pin number in the code) it works

I assume it must be something to do with the fact that pin 13 has an LED hard wired onto it.

any help would be appreciated

Yes, the LED and resistor will be interfering with the parasitic power. You could try reducing the 4.7K? resistor to attempt to compensate, but the only real way of curing it would be to remove the LED from the board.

A number of other boards isolate the LED from the data line either using an op-amp or a simple transistor. The op-amp method is best as it presents a very high impedance, where as a transistor isn't as high impedance.

You could also use the analog pins. They can be used as digital pins as well.

If you buy an Arduino Uno R3, the led is powered by a seperate logic chip, and pin 13 can be used like the other pins.

You could tell us how the other pins are used, and which shield(s) you use. Perhaps it is possible to change it. There are many ways to interchange pins, to combine them, to reduce the number of pins.

My problem is that stray leds light up.

Hello pingguoyue,

Welcome to this forum. We need a better explanation what is going on. Which Arduino board are you using, how are the leds connected, and so on.

When the internal pullup resistor is enabled, it could cause leds to light up a little.