Creative Commons images are CC BY-NC-SA 3.0

4.25

added to your
shopping cart

quantity
In stock 987 in stock
4.25 1+ units
3.83 10+ units
3.40 100+ units

Description: This is the latest DS18B20 1-Wire digital temperature sensor from Maxim IC. Reports degrees C with 9 to 12-bit precision, -55C to 125C (+/-0.5C). Each sensor has a unique 64-Bit Serial number etched into it - allows for a huge number of sensors to be used on one data bus. This is a wonderful part that is the corner stone of many data-logging and temperature control projects.

Features:

  • Unique 1-Wire® interface requires only one port pin for communication
  • Each device has a unique 64-bit serial code stored in an onboard ROM
  • Multidrop capability simplifies distributed temperature sensing applications
  • Requires no external components
  • Can be powered from data line. Power supply range is 3.0V to 5.5V
  • Measures temperatures from –55°C to +125°C (–67°F to +257°F)
  • ±0.5°C accuracy from –10°C to +85°C
  • Thermometer resolution is user-selectable from 9 to 12 bits
  • Converts temperature to 12-bit digital word in 750ms (max.)
  • User-definable nonvolatile (NV) alarm settings
  • Alarm search command identifies and addresses devices whose temperature is outside of programmed limits (temperature alarm condition)
  • Applications include thermostatic controls, industrial systems, consumer products, thermometers, or any thermally sensitive system

Documents:

Replaces: SEN-08366

Comments 58 comments

  • This is super easy to hook up to an arduino. 5v to pin 3, ground pin 1 and hook up a digital line to pin 2. Make sure to put a 4.7k resistor between pin 3 and 2. You can find some sample code here: http://www.arduino.cc/playground/Learning/OneWire. The temperature sensitivity is great.
    have fun!

    • i tried to upload this code and it said that “ ‘onewire’ does not name a type” ??? does anybody have any ideas?

    • Hello Scott,
      this might be a silly question, plz help me understand. I ran the code as it was given here, http://www.arduino.cc/playground/Learning/OneWire.
      the output numbers are in the range of 190-193. the setup was @ room temperature. how can i relate this number to degree C or F. thanks.

    • Really helpful - easily got it working now. Thx :).

  • Accurate and easy-to-use. I posted the design and source of a simple 4-channel monitor/logger using this device, an arduino and EA DOG-M LCD display using the libraries listed here to my website if that’s of any help to anyone.

  • Okay, so I have a dilemma. I want to sense three different temperatures, so, I need three of these. I have one now for testing that I ordered and got it working with little or no issue. It does appear to work great and is very accurate. I also want to keep a timer or stopwatch (like a kitchen timer) in my application. Here is the issue, these take 750ms to convert the temperature to the data word that I can read out. A “delay(750);” is an eternity in the microcontroller world, especially if I want to do other time sensitive things, such as keeping a stopwatch that ticks every second. So, any ideas? I am worried about when I do need three of these, I know you can put multiples of them on the bus but is it 750ms each??? What about timing issues, how do I know they have each converted their temperature at the same time when reading multiples on the bus?

    I am considering changing out to a TMP36 or a thermistor. Granted, I would give up some accuracy but I would be able to read them out in microseconds. I have even considered running a parallax propeller because it can run 8 cores.

    I don’t know, thoughts?

    Thanks!

    • You dont need to do nothing in those 750ms, you can come back later and read the data.

      For example you can call the function every second and toggle between start convert and read temperature. If you have multiple devices, you can make them all convert at the same time (SKIP ROM command), so you dont need to wait 750ms for each of them.

      Also if you lower the precision of them, they convert much faster, if you can do with .5C readouts they only need 100ms

  • this is great, do you have this product here in the Philippines?.

    • I believe we do ship this there, but our customerservice@sparkfun dot com team will be able to give you an answer for sure.

  • I have two of these sensors connected to an Arduino. One of them is right on the breadboard with the Arduino, the other is on a long wire (about 8 inches). The two sensors have about 2.3 F difference in their readings. If I put both on the breadboard, or both on a long wire away from the breadboard, they are within 0.2 F of each other which is understandable. But why do I get a significantly higher reading from the one that is on the breadboard ? I even tried a TMP102 and a DS18B20. Again one on the breadboard the other on a long wire and I get similar disrepancy in readings; i.e. the one on the breadboard always shows about 2.3 F higher reading. Is there an explanation for this ? Thanks !

    • Hmm, that is very strange. I haven’t heard of this problem previously - it may be something related to signal degradation over the long wire, but you aren’t placing them far enough apart for that to be such an accurate and large difference. You might want to check the forums to see if anyone else has run into this problem. Or try switching out your breadboard and see if the issue is with the sensor location or the breadboard itself.

      • I’ve tried different breadboards, longer/short wires, changed the location of the sensor, but nothing changed. My last experiment was to put both sensors on breadboards, one on the same breadboard as the arduino (which is a mirco by the way) and the other on a different breadboard. The breadboards are still next to each other as close as possible. But the sensor that is on the same breadboard as the arduino always shows 2.3-2.5 F more… It’s driving me up the wall … next I’ll try different power supplies (same ground) and different arduino boards, to see if that makes any difference. I looked and looked on line but I can’t find any other resports of this same problem… My guess is that nobody has noticed this.

        • Different power supplies didn’t fix it…. and different arduino boards (pro mini instead of micro) didn’t fix it either.

          • I’ll see if we can duplicate it here and find a possible explanation for you. What a head scratcher!

            • That would be awesome ! At least I’ll know if I’m going crazy or not … :-) By the way, I’m not using parasitic power and I’m using the latest version of the OneWire library. Now I have three sensors as follows : Two are on a tiny breadboard (the kind you sell here) and one is on the same breadboard as the arduino (pro mini). I’ve hooked up power to all three sensors (same power supply). The one-wire pin is pulled up with a 4.7k resistor on the breadboard that has the arduino. I can move the other end of the 1-wire bus from the sensor on the arduino breadboard to each of the sensors on the smaller breadboard; I get 74.8 F from the sensor on the arduino breadboard and 72.1 F, 72.3 F from the other two sensors. All the sensors are within 3 inches of each other and I’m careful to not touch or otherwise disturb any of them. This is very mysterious !! Thanks for your interest in my problem…

              • It appears that proximity to the arduino matters afterall… The only explanation I can come up with is that the arduino has enough heat dissipation that it affects the readings of a sensitive sensor like the DS18B20.

  • Anyone know how long the data line can be before it starts running into trouble? Looking to run it using three wires (gnd, +5v, and data), over some moderately long distances (25-35 feet or so).

    • I’ve used many of these, some on data lines up to 75 feet long with no problems (I use phone RJ11 cables). My favorite technique is pulling apart phone union jacks, putting a DS18B20 inside the jack, and putting it all together again. I’ve daisy-chained up to 4 this way.

  • i want to know the region (distance ) that ths sensor can read the temp in it ???

  • I bought one of these to monitor soil temperature in my garden and so far it has held up. I used heatshrink to build a cheaper (read: handy man special) version of DS18B20. It has faired well being submerged in moist-to-wet soil however over the past 14 days there have been 3 small, one-off, events where the temperature reading ended up being -196.6 F.

    Readings are taken every 15min. and I have not yet confirmed if it might be a timing calibration issue or if my heat shrinking capabilities are sub-par (I’m going to bet the latter).

    I’ll be buying up to DS18B20 for next growing season but can certainly find a few other uses for this type of sensor; namely indoor gardening. Great product when used within reason.

  • Planning on buying some of these, what type / model number of extension cabling should I use for this?

  • OK, I was lauding the effectiveness and simplicity of the TMP102 just a few weeks ago.. then I tried the DS18B20. Every bit as stable as the TMP102 but in a nicer package for remote sensing (I just bought the probe version to make it easier.) Excellent sensor. The extra code involved is actually not that bad. The newest library works perfectly. The DS18B20 is well-suited for temperature controller applications with Arduino and such. I am using it in an egg incubator, and it holds temperature very well.

  • Is there a wider range available?, I’m looking to measure up to 200ÂșC

  • I’m running a couple of these from a Raspberry Pi. One of them is right on a breadboard, the other is on a 15ft wire lead. When I place the two sensors next to each other indoors they read within 0.1 degree Fahrenheit, Awesome! When I run the wire lead outside the accuracy goes down substantially as much as 30 degrees. The outdoor accuracy is almost perfect at night but when the sun comes out I get the wide range of error. Are these things light sensitive? Where is the noise coming from?

    Note that I’m using a LaCrosse thermometer, which work great, as my reference.

    Thanks Rich

    • Is the outdoor sensor in sunlight? If so it will get warmer than the surrounding air. Put the sensor in the shade. Weather stations use a vented, white enclosure to keep sunlight off the temperature sensor.

  • Does anyone know how to connect this sensor to a Zigbee Radio? without arduino? Any example will be appreciated… thanks

  • Do you need an MBed Application Board to try the mbed example above or could it be done on an Arduino UNO R3 by changing pin 25 to lets say pin 2?

  • I realized it was a stupid question and wanted to delete it but it wouldn’t let me! I could only edit it…

  • This should work on 3.3V right?

  • Great sensor.

    Pros: 1: Easy to hook up. 2: Accurate (as far as i can tell). 3: Fast response time. You place your finger on it and immediately the reading starts to rise.

    Cons: 1: It would be VERY easy to mix this sensor up with a standard NPN transistor since they look almost exactly the same, so make sure you keep it in a separate box.

    they recommend you use a 4.7k resistor between pin 3 and pin 2, but I have found a 10k works fine, accurate within at least 2 or 3 degrees Fahrenheit of the actual temperature. Perhaps if you need the EXACT temperature you should use a 4.7k, but if you just need a good estimate and you have a 10k lying around, just use that it works fine.

  • I want to operate this sensor from audio plug via PC with audio input/output. Is there some way to do this? do I need more other product to do this?

  • Anyone able to speak to waterproofing these with epoxy? I’m hoping to build my own inline water temp sensors similar to: http://martinsliquidlab.org/2012/01/05/radiator-test-bench-v2-design-build-log/ about half way down the page (search for inlet sensors). I tried contacting the author, but still have yet to hear back.

    I need several of them, and epoxy into a tubing coupler may work better than any pre-packaged setups out there.

  • Does anyone have experiences with DS18B20 and long wires?

    I want to hookup mine on a 80 feet (25 metres) wire.

  • Has anyone used this sensor with the LIFA toolkit? I'’ve been having some problems on my Mega 2560.

  • Anyone know what order the 64 bit ROMs are returned in in a ROM search request of a multidrop configuration?

    I’m using the code from the Arduino Playground OneWire examples… The function ds.search(addr) returns an array of the found sensors - but in what order?

    In particular, if I add a new drop to an existing setup, won’t the array ordering change?

    • the search works in a binary manner, so its likely going to be fully sorted, you would want to search that array for each address you want to know about, and then query things by address

  • Just a note for anyone who decides to use the code from the Bildr Tutorial.. Some guy told the author that he had a bug in his code, and so he changed a value near the end from 16 to 2, but now it does have a bug.
    I changed my code back to 16, and the code is now working properly.
    float TemperatureSum = tempRead/16-0.25+(CONT_PER_C-CONT_REMAIN)/CONT_PER_C;

  • Hello all,
    this might be a silly question, plz help me understand. I ran the code as it was given here, http://www.arduino.cc/playground/Learning/OneWire.
    the output numbers are in the range of 190-193. the setup was @ room temperature. how can i relate this number to degree C or F. thanks.

    • Divide your output by 16 and that should be degrees C. I’m assuming your values are in hexadecimal (we usually write that 0x192) since that would be the correct output for room temperature.
      0x192 = 402 decimal / 16 = 25.125 degrees C.

  • Anyone has a sample code of this sensor for verilog?

  • Dear all,
    if you get this sensor you need to know how to retrieve the serial unique number from the sensor if you design one wire multiple thermometer.
    youtube

  • Hi all,
    I just purchased a few of these recently. I was wondering if anyone knows whether it’s possible, and how difficult, it would be to interface these sensors with a NI USB-6008 DAQ and LabView.
    Thanks!

  • Great, great sensor. Very clean output. Very sensitive. If you hold it in your hand it will spike very quickly.

  • Eagle part?

  • Great sensor. Do you have an eagle file for it? I know I could modify a transistor layout but it would be nice to have an accurate one for it.

  • I’ve ordered these from here in September and they were the DS18B20’s. They are actually labeled on the face of the IC but you’ll have to use a magnifying glass and strong light to read it to verify what you have. A brief description of the differences between versions: The DS18B20’s have 12 bit resolution capabilties. The original DS1820’s (note lack of B or S) have 9 bit resolution. The DS18S20 (note S) was meant as a drop-in replacement for the original DS1820. It gets a 12 bit temp value but rounds it to a 9 bit value. You CAN however get 12 bit resolution with the DS18S20’s but it requires extra calculations/reading of registers to be done that the DS18B20’s don’t require. The DS18B20’s also allow you to specify 9, 10, 11, or 12 bit resolution programmatically. Taking 9 bit values takes less time and power.

  • I am also having problems getting this to work with a Picaxe-08M. Are these the old style sensors? The Picaxe manual states “Note the readtemp command does not work with the older DS1820 as they have a different internal resolutiom.” If these are the old style that should be listed in the product description.

  • Mine does not work and i am using mine with a PICAxe. Help me someone, KATE!!!!

    • Check the wiring diagram. The datasheet for the PICAXE 08M should show the diagram. There is a command already written for it, by the way. Try “readtemp (pin),(variable)”.

  • Miles Burton has an easy to use Arduino library for this sensor here:
    DallasTemperature Library
    It currently supports the DS18B20, DS18S20 and DS1822.

  • Thx. for the link ScottS.
    Excellent sensor that’s a huge package in a small box. The best temperature sensor to have in your toolkit. With so much on board capability you will save memory and processing time.
    Please consider carrying more 1-wire devices:
    http://www.maxim-ic.com/pl_list.cfm/filter/21/ln/en

  • Fun little devices – accurate and cheap. They’re also insanely easy to wire up. When Maxim says “one wire,” they mean it; you can even power it using the data line if you’re careful about timings and provide a strong pull-up when needed. Developing code to drive them is nontrivial, though (various layers include bit timings, commands and ROM codes etc), but once it’s working, they’re very reliable.


Related Products