1

Background: I'm using an Atmega1284P to add sensors to an off road racing truck onto a CANBUS network. The standard automotive sensors are thermistors, but the Dallas 1 wire temp sensors (DS18B20) with an integrated ADC caught my eye. They don't, however, come in a package that would work for my purposes so I would have to build one. I haven't been able to find one waterproofed in an NPT fitting with only a 1" probe length.

My question: how much more accurate would the 1 wire be over a thermistor? How much of a difference would it make for processor efficiency to not have to do the math involved with thermistors and just read the value from the 1 wire? I don't mind building them, I just want to make sure they're worth it first.

  • Without addressing the issue about which would be "best" or more accurate, there is quite a bit of CPU work involved with "talking to" the 1-Wire devices. Probably a lot more than a couple of calculations with a thermistor. As for which is more accurate, you would need to look at the DS18B20 datasheet, and compare it to the datasheet for a particular thermistor, to be able to say about that for sure. How about a thermocouple instead? – Nick Gammon Mar 5 '16 at 4:57
  • Judging by a few datasheets I found, the DS18B20 is accurate to ± 0.5 °C, and one of my thermistors is ± 1 °C. So yes, the DS18B20 is more accurate than this thermistor, but is 0.5 °C important in this particular application? – Nick Gammon Mar 5 '16 at 6:24
  • Another usefull feature is the fact they come factory calibrated, according to datasheet. – brtiberio Mar 5 '16 at 10:15
  • @NickGammon half a degree doesn't matter, no. I don't think I'll end up being able to use the DS18B20 though, as a few of my sensors need to be able to go up to 300F. With thermocouples, I would need an additional IC per sensor such as the MAX31885, correct? – Jason Stewart Mar 5 '16 at 16:22
  • I haven't tried using thermocouples apart from the one on my multimeter. There are various types, and I gather that they output low voltages which may need amplification and interpretation. – Nick Gammon Mar 5 '16 at 20:40
2

To make an informed decision you first need to understand a few basic concepts and some pros and cons of each system.

Firstly there are the concepts of precision and accuracy. These are two very different properties and each is important in their own way. On the face of it they may sound the same, but they aren't.

Precision

This is how close to the real value your measurements are. This is the "±" value that datasheets list. It's how close a match to the actual temperature the measured temperature is. So a ±0.5° measurement could be anywhere within half a degree of the actual temperature.

Accuracy

This can also be considered as the resolution of the measurement. It is how fine a difference in temperatures the device is able to measure. For instance you may be able to detect 0.0125° differences. This is mostly defined by the resolution of the ADC in the device.

And now the pros and cons:

Digital

Pros

These devices can be factory calibrated for a more precise reading. The accuracy is usually pretty good too, but is fixed by the design of the device. Communication is generally reliable and wire length doesn't generally affect the values reported.

Cons

Communication protocols can have some large overheads limiting the number of samples you can take per second (not just on one sensor but across the whole array of sensors). Excess EMI noise (especially from engines) can corrupt the communication signals over long connections unless extra care is taken (such as implementing a balanced line communication medium).

Analog

Pros

Very simple to connect up and samples can be read very rapidly. Accuracy is determined by the ADC you choose to use.

Cons

Wire length can have a detrimental affect on the values read unless special wiring and sensor schemes are used to cancel out the resistance of the wires. Noise induced into the wires is very hard to detect or cancel out and can give spurious results. Requires more complex mathematics to calculate a resistance.

Summary

So in short: Digital can give you more reliable communication of your sampled values over longer distances but at the cost of reduced sampling speeds.

  • I'd say accuracy is about how close a reading is to the actual/true value, while precision is related to differences when repeatedly getting a reading for the same actual value. And resolution would be a separate thing altogether, I'd say, indeed kind of describing how many digits are produced. – Arjan Mar 5 '16 at 12:23
  • I'd call what you term precision "variance". Anyway, regardless of what one part of the world calls something compared to another (which we can argue over all day and get nowhere) it's the concepts that are important not the names. – Majenko Mar 5 '16 at 12:26
0

I fully agree with Majenko except for the cons for analog.
Basically it is not easy to get a (very) accurate ADC reading with an arduino. The main problem is the reference voltage that fluctuates.

This is the main reason why I prefer digital to analog when it needs to be "correct"

  • Since the ADC inside of something like the DS still relies on the 5V from the Arduino, would it not drift just as much as the Built in ADC? – Jason Stewart Mar 5 '16 at 16:26
  • There are tricks around like doing a comparative read, measure at a lower voltage, capacitors, giving the ds it's own power suply ... – jantje Mar 5 '16 at 17:38
  • I don't know this particular DS but the data sheet should be able to tell you. – jantje Mar 5 '16 at 17:39
  • Internally though, there must be an analog reference somewhere, right? You can get precision analog voltage references. I looked into some here. – Nick Gammon Mar 5 '16 at 20:42
  • Nick; I know it can be done. Basically the tricks I mentioned above can be used with arduino as with any other device. My point is that it is not so easy to get very accurate analog readings. There is needed more than the Arduino analog read example. As such "no matter how accurate the Analog signal is; you still have to account for the accuracy of the ADC" – jantje Mar 6 '16 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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