Author Topic: Anyone have a readTemperature calibration table for the RFM69?  (Read 4642 times)

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Anyone have a readTemperature calibration table for the RFM69?
« on: February 26, 2016, 12:17:03 PM »
At best the on-chip sensor would report the temperature to the nearest degree C, but that might be just fine for a lot of things, provided it stays within 1 degree C of the true temperature.  Has anyone here checked it for accuracy over a wider temperature range than just ambient?

For instance, our refrigerator failed recently due to a defrost problem, but it's not the sort of thing you tend to notice right away.  If there had been a Moteino in there... even without a fancy temperature sensor, if it has a reliable and repeatable 1 degree C accuracy, it might have sent us a wireless alert earlier.

Is a calibration table even needed, or is it pretty much bang on for a wide range if you calibrate it only at ambient?

I read that John K2ox "gave up" trying to do it and instead decided to add a DS18b20, but he didn't explain why it was that he gave up. 
« Last Edit: February 26, 2016, 12:36:15 PM by WhiteHare »

jra

  • Jr. Member
  • **
  • Posts: 81
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #1 on: February 26, 2016, 01:54:16 PM »
You need to calibrate each chip individually to get anywhere close to +/- 1C.  Quoting from http://www.avdweb.nl/arduino/hardware-interfacing/temperature-measurement.html
Quote
One-point calibration. Offset removal using room temperature as reference gives +/-5C accuracy from -30C to 100C and +/-3C accuracy between 0C and 85C.
Two-point calibration. Here, +/-1C accuracy from 5C to 95C can be achieved.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #2 on: February 26, 2016, 02:17:06 PM »
You need to calibrate each chip individually to get anywhere close to +/- 1C.  Quoting from http://www.avdweb.nl/arduino/hardware-interfacing/temperature-measurement.html
Quote
One-point calibration. Offset removal using room temperature as reference gives +/-5C accuracy from -30C to 100C and +/-3C accuracy between 0C and 85C.
Two-point calibration. Here, +/-1C accuracy from 5C to 95C can be achieved.
That's interesting.  What you referenced is for the atmega328 rather than the rfm69, although  I guess for my purposes it doesn't really matter which temperature sensor gets read.  Thanks!
« Last Edit: February 26, 2016, 02:18:44 PM by WhiteHare »

jra

  • Jr. Member
  • **
  • Posts: 81
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #3 on: February 26, 2016, 02:54:45 PM »
My bad, saw RFM69, read 328.  Where the radio is soldered to the underside of the Moteino I suspect the two temperatures may track fairly closely.  That would be an interesting experiment in itself to perform as you slowly raised or lowered the ambient temperature while you read the temperature from:
  • The radio
  • The MCU
  • Some more accurate/precise temperature sensor

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #4 on: February 26, 2016, 04:22:55 PM »
I suppose one advantage of the RFM69, versus some of the dedicated temp chips, is that "It takes less than 100 microseconds for the RFM69W to evaluate the temperature (from setting TempMeasStart to 1 to
TempMeasRunning reset). "

A DS18B20 requires a minimum of 3v, which is bad news if it's everything is running direct from just 2x AA's.

An Si7053 only requires 1.9v, but it can take up to 80ms just to power up, plus another 10.8ms before it can produce a temperature reading.  It's $2.

The STSC1 is fairly quick: it can power-up and take a measurement all within 1ms, and it's accurate to within 0.3C, but it's $4.23 each and has a very narrow operating voltage range of 1.62-1.98v, so I guess it might require it's own LDO to power it.

For nearly the same price, there's the TSYS02P, which is insanely accurate to within 0.2C, and a resolution to 0.01C, and has a better operating voltage range of 1.5-3.6v.  However, it can take up to 150ms to reach an idle state after power up.  I suppose it would be a good reference standard for calibrating other sensors.

I suppose the figure of merit will be total system amps per temperature measurement, because impact on battery life will be a significant consideration to weigh in the trade-offs.

john4444

  • Jr. Member
  • **
  • Posts: 71
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #5 on: February 26, 2016, 11:00:27 PM »
Hi WhiteHare,
An issue to keep in mind is the RFM69's self heating.
This also applies to the 328 but to a lesser extent.
I found the 328's internal temp-sensor useable but not +/- 1F.
Also, it increased several F depending on how busy the processer is.
RFM69/328 operating at low power are practically at ambient and it
takes a second or two before self heating begins to push the numbers up.
Reading the die-temp before doing anything else can give repeatable results.
But, I never tried to "calibrate" the numbers generated to a temperature.

John AE5HQ
John AE5HQ

joelucid

  • Hero Member
  • *****
  • Posts: 867
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #6 on: February 27, 2016, 02:44:20 AM »
WhiteHare,

the resolution of the temp sensors in both the 328p and the RFM69 is 1C per LSB. These internal temp sensors need to be calibrated from chip to chip (see http://www.atmel.com/images/doc8108.pdf).

You can use both facts to your advantage: calibrate the sensors on both the 328p and the radio and you will get higher accuracy and resolution results (e.g. say the 328p switches LSB's at 18.6, 19.6, 20.6 C and the radio at 18.1,19.1,20.1 C).

I've done some tests recently to model temperature curves to reduce radio communication and prolong battery life (I still want to build a lifetime TH Mote using a cr2032  ;) ). I found the idea wasn't new (e.g. http://www.vs.inf.ethz.ch/publ/papers/santinis_AMS_07.pdf).

I found that when measuring temps like room temperature of freezer temperature these optimizations can work very, very well, allowing a reduction of >80% in packet frequency while keeping error smaller than 0.1C.

The reason this works so well is that temperature curves are often linear for long times (e.g. when cooling down over night or warming up in the morning, or during the day when they are most often constant).

I mention this because you might be able to measure the temperature slope using the calibrated 328p/rfm69 combination fairly accurately and use it to produce results of much higher resolution than the 1C the sensors provide themselves.

Of course you'd have no way of knowing whether they're correct for any given moment. But on average they'd be better than the non extrapolated values.

Joe

joelucid

  • Hero Member
  • *****
  • Posts: 867
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #7 on: February 27, 2016, 03:05:59 AM »
If I wanted to try anything like this I would probably create two full temp mapping tables rather than one or two point calibrations. You'd want to tease as much info as possible out from the measurements.

Does it make sense? No!

But you could probably milk it for a couple days of fun.

TomWS

  • Hero Member
  • *****
  • Posts: 1925
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #8 on: February 27, 2016, 08:05:29 AM »
But you could probably milk it for a couple days of fun.
LOL!

There is an ancient saying: NEVER take TWO chronometers to sea.  Take one, take three, but never two!

Tom

joelucid

  • Hero Member
  • *****
  • Posts: 867
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #9 on: February 27, 2016, 08:28:59 AM »
Quote
NEVER take TWO chronometers to sea

Ok, yes, how careless of me ...  :)

Let me present the third chronometer: measure the radio's rc oscillator frequency against the Moteino's crystal and use its temperature dependence to infer temperature. Problem will be that it automatically calibrates on startup. So you'd have to counter-calibrate your measurements once you know the temp pretty precisely (say when the 328p just flipped one LSB upwards). I think this could be an excellent input to verify your slope assumptions between identical measurements on the 328p/radio front.

I should call out JTC - Joe's Thermometer Challenge: Using only a Moteino build the thermometer with the highest average accuracy, defined as the one with the lowest error integral over time.   ;D

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #10 on: February 27, 2016, 08:48:56 AM »

Does it make sense? No!


Why doesn't it make sense? 

Assuming the built-in temperature sensor measurements are highly repeatable (and I don't know that they are), then I would think that with one or two tables you could get measurements accurate to within about plus or minus 1C on the RFM69.


WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #11 on: February 27, 2016, 09:23:48 AM »
But you could probably milk it for a couple days of fun.
LOL!

There is an ancient saying: NEVER take TWO chronometers to sea.  Take one, take three, but never two!

Tom

If  you average their readings, then you're back to one chronometer.   ;)

joelucid

  • Hero Member
  • *****
  • Posts: 867
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #12 on: February 27, 2016, 09:24:56 AM »
Quote
Why doesn't it make sense?

I would guess that if you combine all 4 methods (328p, radio, slope extrapolation and rc frequency deviation) you could get at least to +-0.5 Celsius which would be pretty great.

But the price is measuring these tables - which is probably much more work than putting a DHT22 on a mote. That's where the senselessness comes in.

WhiteHare

  • Hero Member
  • *****
  • Posts: 1300
  • Country: us
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #13 on: February 28, 2016, 06:05:18 PM »
According to the datasheet, the Energizer Ultimate Lithium AA are actually good for up to 1.7v for a short period of time when the battery first gets used.  So, one could take a hybrid approach, to automatically create a calibration table at the start of deployment, by using a DS18b20 (available from Aliexpress at 50 cents each) to take a temperature reading every time the RFM69 senses a new temperature.  Then, once the two AA batteries fall below the 3.0v minimum, you stop using the DS18b20 altogether.

joelucid

  • Hero Member
  • *****
  • Posts: 867
Re: Anyone have a readTemperature calibration table for the RFM69?
« Reply #14 on: February 29, 2016, 02:27:54 AM »
Quote
Then, once the two AA batteries fall below the 3.0v minimum, you stop using the DS18b20 altogether.

I don't know. For me the beauty of the bare bones approach is (a) no extra components needed and (b) ultra low power consumption. So I think the calibration component shouldn't be on board during deployment.

The challenge for the calibration process is probably to create an environment with very slow temperature change so that you don't get errors due to temperature inertia of the different types of sensors. And so you can measure with low frequency and avoid heating the 328p/radio.

I'm thinking a thick styrofoam container that you first put into a freezer overnight, taking measurements from within as you cool down. then let it warm up in the fridge. Then warm up further to room temperature and finally bring it up to 50 degrees in an oven (hey another use for your reflow toaster :-) ) and let it cool down again.

You want to take measurements on the way up and down to see of there is any hysteresis.

Just put an extra moteino with the best temp sensor money can buy in the same box and have it log in parallel.

One caveat: the temperature curves of the watchdog and internal rc oscillator are also dependent on vcc - though from the datasheet it looks like it's pretty much an offset that's constant across the whole temperature range.