DS18B20 digital temperature sensor

robertgatt

New Member
I want to use pin4 (leg3) to read data from DS18B20 digital temperature sensor. I also want to use this pin to light a LED if there is an error. Would the pin going high to light the LED damage the sensor? Would the extra loading on pin4 caised by the LED and is current limiting resistor effect the sensor readings?

thanks,
Robert
 

BeanieBots

Moderator
IMHO not a good idea.
There are two issues. Under normal conditions, just holding the pin high would be OK, but if the sensor is trying to communicate, its output will be overloaded.
Also, the LED will present a heavy load to the output. I have done quite a few tests in this area and although the output seems quite happy driving heavier loads (I've tested down to 330R), your sensor will draw much higher current and heat up as a result. At the sort of currents needed for an LED, you would be looking at about 2 degrees of error due to self heating.
 

d.l.bird

New Member
Seems the easy answer is to use a diode between the 18B20 output and the PIC pin, that way you can isolate the 18B20 when you need to, using the LED limiting resistor as the pull-up for the 18B20 (which is required). That way the 18B20 can output data during the LED illumination or output data as normal to the PIC on data input. I can think of another method too, that of reversing the LED drive, so that the LED is only illuniated when the PIC pin is low.
 
Top