Jump to content

Cheap (and accurate) temperature data logging


dnb

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.

Link to comment
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

 

 

Link to comment
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
Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
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.

  • Like 1
Link to comment
Share on other sites

18 hours ago, dnb said:

Medians work better than means (as a rule)

There is a reason it is abbreviated to MAD.

 

I usual filter out the odd readings by putting limits in place, though this was the problem with collecting data about the Ozone layer over the Antarctic.  But that would have been picked up soon if they had used standard deviation of the mean.  Lesson learnt, do both.

All depends if the important part is the tails or the central tendency.

Edited by SteamyTea
Link to comment
Share on other sites

The easiest way to spot if your DS18B20 is fake is by its ROM code as all genuine Maxim/Dallas devices have their 64-bit ROM code (consisting of 28<48 bit serial><8 bit CRC>) reporting as:

 

28 xxxxxxxx0000 xx

 

Fakes don't have the 0000 in the most significant bits of the serial code.

 

There's further information here along with ways of finding out what family of fakes you might have and known deviations from the spec for each.

Edited by MJNewton
  • Like 1
Link to comment
Share on other sites

3 hours ago, SteamyTea said:

All depends if the important part is the tails or the central tendency.

True... Most of the stats I end up doing end up non-Gaussian in some way or from the tails of Weibull distributions. Radar signal processing can be full of horrors seemingly specially designed to defeat standard statistical methods if you keep looking at it in ever more detail because you want to see that really small thing hiding in the clutter.   

Link to comment
Share on other sites

28 minutes ago, dnb said:

Radar signal processing can be full of horrors seemingly specially designed to defeat standard statistical methods if you keep looking at it in ever more detail because you want to see that really small thing hiding in the clutter.   

I would like that sort of challenge, beats cooking 2,000 meals, in 4 days.

In this much space (not my mess, was out doing the washing up).

 

IMG_20210611_150654463_HDR.jpg

Edited by SteamyTea
Link to comment
Share on other sites

  • 1 month later...
7 hours ago, MortarThePoint said:

 

I'm keen to get some of these probes. How do you know they were genuine? Did you read the serial numbers etc?

I took a punt on them, but the serial numbers checked out ok.

I am not a good a good enough programmer to write a python scripts that can automatically insert the serial number into the scripts, so do it manually anyway.

Link to comment
Share on other sites

20 hours ago, SteamyTea said:

I took a punt on them, but the serial numbers checked out ok.

I am not a good a good enough programmer to write a python scripts that can automatically insert the serial number into the scripts, so do it manually anyway.

 

Thanks. I have ordered 5 to have a play.

 

I am also considering MAX31820. Similar sort of deal, except on Farnell or RS (reliable) they are half the price of DS18B20 and the +/-0.5C accuracy range is limited to +10C to +45C. That should be fine for indoor applications. £1.68 at 10 off. May not work with standard libraries but should be easy to port. A bunch of these on telephone wire covered in rubbery potting compound or some flexible grab adhesive should work nicely.

 

Please note: big difference is working voltage 3 to 3.7V so wouldn't work with 5V Arduino.

 

Laid ready for screed to go over could be asking for the screeder to kick the wires though.

image.png.7a8438690ddb491c910a58cf114044a9.png

 

https://uk.farnell.com/maxim-integrated-products/max31820mcr/temperature-sensor-2deg-c-to-92/dp/2515555?st=max31820

https://uk.rs-online.com/web/p/temperature-humidity-sensor-ics/1905324

Link to comment
Share on other sites

3 hours ago, MortarThePoint said:

May not work with standard libraries but should be easy to port

Let me know how you get on.

I have used some BME280s, they work well, but are obviously not for a wet location.  Just wish they were packaged better.

Link to comment
Share on other sites

26 minutes ago, SteamyTea said:

Let me know how you get on.

I have used some BME280s, they work well, but are obviously not for a wet location.  Just wish they were packaged better.

 

Nice part. I have used some parts like BMP180 before and these pressure sensors are very precise.

Have you found a use for the pressure measurements?

Link to comment
Share on other sites

8 hours ago, MortarThePoint said:

 

Nice part. I have used some parts like BMP180 before and these pressure sensors are very precise.

Have you found a use for the pressure measurements?

I was hoping to make a differential pressure gauge, but got sidelined.  When I am forced to stay at home I shall pick the project back up again.

Link to comment
Share on other sites

2 hours ago, MortarThePoint said:

Is it to minimise air leakage

Was hoping to make an MVHR balancer, an air test gauge and general interest.

My one experiment failed, but I think that was more to do with the poor design of the venturi. 

Link to comment
Share on other sites

  • 3 weeks later...

I bought a batch of 10 (later bumped 20) canned DS18B20 thermometers, much as @Adrian Walker pic above.  I did however calibrate them against each other by immersing them as a bundle in warm water (~50°C) in an insulated container but without a lid and left this to cool overnight logging the temp every 5 mins.  I also did a run in water with melting ice.  I discarded a couple that didn't track the herd, the remainder had a spread of less than 1°C. I recorded the temp offset of each device by OW address and my app adjusts all the readings by the device offset.  Less the discards, the remaining thermometers (and with this offset applied) tracked within ¼°C over a repeated cooling test run.

 

I didn't run a second reference temperature (e.g. 100°C) to calibrate gradient accuracy. However I felt this was good enough for my purposes.

 

 

  • Like 2
Link to comment
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
×
×
  • Create New...