The sensor is a DS18B20, I accidentally connected the positive and negative inverted to the sensor and it became very hot then I quickly disconnected the power.

I don't have any other calibrated temperature sensor at hand to check if the temperature reading is correct or not, only a mercury thermometer. The temperature reading from mercury thermometer is around 1.3°C less than the reading from DS18B20...

How can i tell if I damaged the sensor or not?


2 Answers 2


i accidentally connected the positive and negative inverted to the sensor

You mean you applied a negative supply voltage to GND and VDD pins?

If you did that without proper current limiting from the supply then chances are you have damaged the sensor.

This sensor is actually an IC and all ICs have ESD protection consisting of diodes between GND and VDD pins. In normal operation these diodes are in reverse mode. However when the supply voltage is reversed these diodes operate in forward mode so a voltage above about -1.2 V (there are generally two diodes in series) will make the diodes conduct. If the supply has no current limiting then a high current can flow which will damage the diodes and the rest of the IC with it.

When experimenting with circuits it is good practice to limit the current that the supply can deliver. Often a maximum current of 100 mA can prevent most damage.

Since you only see an error of 1.3 degrees, you are probably lucky and the sensor still works. The sensor has an accuracy of 0.5 C that leaves 0.8 C for the mercury thermometer which could be correct. Does the sensor still change its output voltage over temperature? If so it could still work. However, the reverse supply could have done "something" so accuracy is certainly no longer guaranteed!


Fill a cup with ice cubes and pour in water to fill up to the brim. Give it the occasional stir. When the ice is starting to melt you'll be at 0°C. Stick the sensor into the water and take a reading.

I didn't check the datasheet but if your sensor can tolerate it, drop it into a kettle of boiling water. At sea-level that will give you a 100°C reference reading.

  • \$\begingroup\$ i actually did and that 1.3°C is the difference. \$\endgroup\$ Sep 2, 2019 at 7:30
  • \$\begingroup\$ What values did you read on the sensor in melting ice and boiling water? \$\endgroup\$
    – Transistor
    Sep 2, 2019 at 9:32
  • \$\begingroup\$ I only tested it in ice bath, the mercury thermometer showed around ~1.5 degree while DS18B20 was around ~3 degree. \$\endgroup\$ Sep 2, 2019 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.