Temperature sensor options

I’m building a (maybe some) wireless temp sensors and I’m currently using a DS18B20, nice and easy to use.

While trying to conserve battery life I am switching off the power to the sensor and re-enabling it when I want to read the current temp. The DS18B20, however, needs a little time after booting up before it can read the temperature or else it gives 85C. My module is switching on for almost a second each time and I’d like to minimise that if possible.

So are there any other accurate digital (I’d prefer digital) temp sensors which could be activated quicker?

The conversion time can be dramatically reduced if you use a lower resolution. I recognise that power is power but I understand the DS18b20 consumes almost nothing when dormant and it might not be worth switching off. Check the data sheet.

I've set the sensor to 10 bit which should only need 187.5 ms to read the temp, but it's the startup delay that seems to cause the issue. I've tried increasing the delay when first using the sensor and could only get the first reading to be correct after ~500ms delay.

I have the sensor running off a 3.3V step up regulator which might be wasting some power when the sensor is sleeping. In standby the DS18B20 uses very little.

I have the sensor running off a 3.3V step up regulator which might be wasting some power when the sensor is sleeping.

Quite likely, but more certainly a waste of money. I guess you are using a Pro Mini or the like. I'm sure the DS18B20 can run off 3.0v and has no problem with 3.3v Arduinos.

Yup, using a Pro Mini but running it off batteries. I have the clock lowered so it can run at 1.8V and the DS18B20 needs 3-5.5V.

OK, I now understand the 3.3v is the output. I’m afraid this is getting a bit extreme for me…

I understood the sensor started to take a new reading as soon as it delivered the old one, so I find hard to see how it can cause a problem at res 10.

Two possible problems are

  1. By switch off the DS18B20 you are throwing out a reading, or perhaps a partial reading.

  2. By lowering the clock speed you are increasing the time the Arduino takes to retrieve the data

Just guessing…

It only seems to be the initial read and I get the same with my 8MHz Minis too, the first read is 85C and after that it works fine.

The first read seems to need longer to initialise than subsequent reads.

OK, it looks like that's guess #2 out the window.

And all your reads are, in fact, "first reads?

Here is a shot in the dark. Through a self-inflicted comedy of errors, I did, for a while, use an entirely different approach to the DS18B20. I wouldn't normally recommend it to anybody but it doesn't use any libraries and therefore just might carry less baggage and hence may work a bit faster.

You might consider a thermistor, as done in all the commercial remote temperature sensors. Start up time is close to zero and it can be powered from a port pin. You will have to calibrate it, of course, but if that is carefully done, the accuracy can exceed that of the DS18B20.

Since we're talking about analog sensors now, how about this ratiometric temperature sensor (Analog Devices AD22100)

Thanks. I'll have a look at thermistors/analog devices. I'd prefer the simplicity of a digital one but maybe analog would be better this.

My other thought is to switch the power on to the DS18B20, send the Arduino back to sleep for x amount of time, wake up, then read the temp. I'll experiment with that later I think.

Since we're talking about analog sensors now, how about this ratiometric temperature sensor (Analog Devices AD22100)

Requires >=4V so would need a step up to 5V.

Would the temperature of the Arduino itself affect the results fron a sensor like that. For example if it outside and the temperature fluctuates would I get different readings?

I've just realised I've been really stupid. I'm using delay() after requesttemp. I can just change that to the power down option with the sleep library I'm using.

The AD22103 is a 3.3v version. [edit] oops - you're running at 1.8v? Never mind.

Not sure I understand your question. Wouldn't the heat from the arduino affect any temperature sensor that's too close to it?

3.3V would be fine as I have some step ups.

I mean does the temp of the Arduino affect the ADC as that sensor gives a variable voltage.

So if the Arduino was outside in freezing temps, with the temp sensor inside, then bring the Arduino inside in the warmth, would it read the sensor the same?

ADCs with internal gain amplifiers drift some (usually small amount) with temperature. I don't know about plain vanilla ADCs without amplifiers. Check the datasheet to see if there is temperature effect and if so, whether it is significant for your application and the temperature range you are expecting.

After all that it's not the sensor that's the problem, it's the way I removed the voltage reg or power LED. I've setup another module and that one is fine.

My first one is leaking current somewhere.