dnb

Cheap (and accurate) temperature data logging

Recommended Posts

I really need to do some experiments with the house to measure the insulation performance.  I want to position temperature probes in the main rooms and outside and log the temperature over several days to measure things so that the risks from the house not performing as planned in the heating/cooling design can be retired.  (This sounds too much like I am at work!)  Ideally I would like to use cheap sensors connected to a cheap central data logger. But I would like them to be well matched since I'll be looking at small temperature differences, and this usually precludes cheap. I could of course calibrate them myself, but if I can avoid it by spending a little more it is worthwhile for me. We have a couple of nice many channelled thermocouple loggers at work that would be ideal but they cost a bit more than I would like to pay for this.

 

My initial thoughts are that cheap one wire sensors are available on ebay that could be used on an ATMega microcontroller with a few lines of WinAVR (insert your own choice of microcontroller here) with the data logger part constructed from an old laptop with a serial port writing down what the microcontroller tells it. The advantage is that I have many of these parts sat in a box of spares somewhere so it is simply the cost of time and sensors. The one wire sensors are an unknown quantity - I'm not sure what technology they work on but suspect it is along the lines of an LM335 as opposed to an NTC thermistor. This means that calibration shouldn't be too much of a headache (at least it is linear!). 

 

Has anyone done anything like this with cheap parts, or am I best spending a bit (lot?) more money on something like the 8 channel thermocouple things? I might have other uses for such a thing in the future, but nothing I can think of immediately.

Share this post


Link to post
Share on other sites

Take a look at the open energy monitor site -> https://openenergymonitor.org/

 

You could do this with an emonTH -> https://shop.openenergymonitor.com/emonth-temperature-humidity-node/  and DS18B20 one wire sensors which connects to an emonBase -> https://shop.openenergymonitor.com/emonbase-web-connected-base-station/   if you have a Pi, then you can just buy the RFM69Pi add on board which is cheaper than the base station which is a Pi with the RF card.

 

Not sure how many DS18B20s the s/w in the emonTH supports but there are plenty of instructions on how to reprogram the emonTH to support more sensors.

 

Simon

 

 

Share this post


Link to post
Share on other sites

I building a temperature monitor and logger at the moment.  From a hardware point of view I'm using DS18B20 (12 bit gives 0.0625°C), Raspberry Pi Zero with a 1-wire HAT.

Temp.jpg

Edited by Adrian Walker

Share this post


Link to post
Share on other sites

I'm using DS18B20 temperature probes with WIFI relay switches (https://shellystore.co.uk/product/shelly-1) to control extractor fans and central heating. What's nice about this is that it's plug and play - no soldering required. Each wifi switch can run up to 3 probes, but you have to combine with with an addon to link the probes to the switch. (https://shellystore.co.uk/product/shelly-temp-addon). The wifi switches broadcast their temperature data using MQTT - you could easily set up an MQTT server on your old laptop and capture the temperature data. 

 

The cost of a switch and an addon works at £20ish per 3 probes (plus the cost of the probes). 

 

A cheaper option is to use a teeny tiny ESP8266 wifi chip. Connect it to power via micro usb, wire in the sensors and you're good to go. Check out https://esphome.io/components/sensor/dallas.html. I haven't tried this approach though. 

  • Like 1

Share this post


Link to post
Share on other sites

Not sure why you think you need very good accuracy or precision. All you are really after is relative differences.

Relative difference is just looking at the deviation from the mean. So that can be done easily in software, post collection.

Having said that, it is worth doing a quick calibration just to establish that all sensors are within a sensible range.

 

Precion and accuracy

https://en.m.wikipedia.org/wiki/Accuracy_and_precision

 

Edited by SteamyTea

Share this post


Link to post
Share on other sites
3 hours ago, SteamyTea said:

Not sure why you think you need very good accuracy or precision.

I didn't mention precision. (But some here have mistaken precision for accuracy.) Or "very good" accuracy come to that! I negelcted any form of specification, so you *should* have accused me of giving a terrible specification... ;) 

 

Sensible accuracy is far easier to work with. They obviously don't need to be accurate to 0.0001 degrees, but +/- 20 degrees depending on absolute temperature and a hugely non-linear response (e.g NTC thermistor) is next door to useless when you want 10+ sensors all to do the same thing. Obviously I could construct a calibration scheme for these, but in my experience from work it is often best to spend a bit more effort on selecting well behaved components before thinking you can fix everything in software. Let's say I want to end up with accuracy to 0.5 degrees from -5 to 40 deg C.

 

My thoughts are that the DS18B20 sensors are a good option, have a linear output with temperature and are probably close to meeting the spec without calibration. It is a simple scale and offset to calibrate anyway, so not hard. (No messing with Steinhart-Hart coefficients or anything daft.) Hopefully the scaling is well matched to 1 from the manufacturing process so leaving just an offset.

 

3 hours ago, SteamyTea said:

All you are really after is relative differences.

Mostly true, yes. But there are a few temperatures I do want to use as absolutes albeit I don't think I need 0.5 degrees accuracy for these. They are for stage 2 of the plan.

 

3 hours ago, SteamyTea said:

Relative difference is just looking at the deviation from the mean.

Medians work better than means (as a rule). They handily ignore with outliers and the median absolute deviation does a good job of emulating standard deviation with a mutiplying factor.

Share this post


Link to post
Share on other sites

If accuracy is important be aware that practically all DS18B20's on eBay and Amazon Marketplace are fakes and so you can pretty much throw the official datasheet out of the window. Worth buying from a trusted source (eg CPC), although of course they'll cost a bit more. 

Edited by MJNewton

Share this post


Link to post
Share on other sites
47 minutes ago, SteamyTea said:

They are genuine ones and work fine.

Thanks for this - fake components are a damned nuiscence both at home and at work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now