[SOLVED] Grove High Temperature sensor giving widely different, but consistent temperatures

My high temperature sensor is returning ~12C from the getTemperature() function, but ~ 23C from the getRoomTemperature() command. Subsequent readings are similar.

Is this due to

  1. A bug in the library (I am aware it’s not yet been released)
  2. Due to the fact that the high temperature sensor is reading a low temperature relative to it’s range - and will become more accurate at higher temperatures
  3. Something on the sensor is broken
  4. Something else entirely

?

Hi quasipickle,

If you take a look in the example program I’ve provided you (the prototype I mean), you’ll see these following lines of code:

    # and do this indefinitely
    while True:
        # read the room temperature
        room_temperature = sensor.getRoomTemperature()
        # and also what's important to us: the temperature at the tip of the K-Type sensor
        probe_temperature = sensor.getTemperature()

        # print it in a fashionable way
        print('[room temperature: {:5.2f}°C][probe temperature: {:5.2f}°C]'.format(room_temperature, probe_temperature))
        # and wait for 250 ms before taking another measurement - so we don't overflow the terminal
        sleep(0.25)

As you can see, getRoomTemperature() function returns the temperature that’s measured on the high-temperature board.
The other function called getTemperature() returns the measured temperature at the tip of the K-Type sensor.


And now you wonder: why do they measure different temperatures?

The key is in thermal conductivity.
Every material in this world will have a certain thermal conductivity ratio, which is measured in BTU units.
Because of this, different materials will have different temperatures even in the same room, at the same temperature. It’s related to how fast the heat transfers from one medium to another.

Here’s a table with the appropriate thermal conductivity ratios.



Metals will always have a greater thermal conductivity than non-metals.
That’s the reason heat-sinks are made of metal - so they can transfer heat faster.

And, in our case the tip of the high-temperature sensor is made out of metal, while the other one is non-metallic.
This justifies your readings.

Thank you!

Thanks for the informational response.

However, this presents a problem. It’s not actually 13C in the room - it’s 23C. Is there a translation I can do from degrees > Joules > back to degrees using different ratios?

Hi quasipickle,

I’ve thought about your answer for some time already and I’m afraid I can’t understand what you’re trying to achieve.


It’s not actually 13C in the room - it’s 23C

Technically, it’s neither 23 degrees Celsius. That is just another measurement which obeys the principle of heat convection / conduction / radiation, depending on the scenario (which is also “flawed”).

All around us there are inhomogeneous substances with different specific heat coefficients (this one is measured in Joules/Kelvin and represents how many Joules are necessary for raising the temperature of 1 kg of mass at standard atmospheric pressure).

Because of this, you’ll “experience” different temperatures within different materials in the same room.

So, what are you trying to achieve?

Thank you!

I’m trying to get an accurate temperature reading. Things do have a set temperature - it’s not really something open to interpretation. The weather man says it will be 10C out today, so when I go outside with me thermometer, be it a bi-metallic strip, alcohol, or mercury, the thermometer is going to read 10C (if we perhaps foolishly agree the weatherman is going to be correct ;)). But if I take this probe outside, it will could say 4C. I recognize the physics behind the measurement differences, but that kind of makes the probe useless. I need to calibrate or adjust the probe so it gives me a calibrated temperature to match what all my other sensors are reading. Otherwise I can’t trust it.

Hi quasipickle,

In order to validate your error, I’ve assembled your configuration and tried to measure both temperatures.


This is what I got:

Since the K-Type sensor produces a temperature-dependent voltage as a result of the thermoelectric effect, it makes me think that your off-the-chart values are a cause of a resistive contact.

I did the math and for measurements offset-ed by 10 degrees, there’s only a 1mV change in the voltage across the thermocouple sensor, so this small change confirms my suspicion.


I suggest you check your electrical contacts (with the thermocouple probe) and then come back and tell us how it went.

Thank you!

I think you’re right. My other sensor is returning a WAY different voltage value, so I’ll double check the contacts.

Thanks for the help.

I’ve tried to remove any interference, but I’m not having any luck. I tried using a different connector (Yellow White Red Black) cable, I tried moving to port A2 instead of A0, I re-seated the probe cable, and I tried a completely different sensor and probe. I also disconnected and re-seated the GrovePi onto my Raspberry Pi. In all situations, I’m still getting the probe reading be 10 - 12 degrees below room temperature.

I’ve attached photos of my setup in case I missed something. Ignore the RST light in the first shot. It’s not always on.

Hi quasipickle,

I think you may have a faulty sensor on this one.


Since the on-board amplifier has to be pretty sensitive to what the probe produces, I think things can go bad rather easily.
It’s possible that the amplifier’s input impedance is too lower / higher than expected and that might lead to bad readings.

I would recommend you to check with your supplier on this matter and have them a replacement for you.


Other than that, there’s still the probability of loose connections.
Please take a look at my sensor’s connector and see that I’ve pushed the wires all the way in and I’ve turned the screws really hard.


Please tell us what you have done and if you have solved anything on the way.

Thank you!

I’ve stripped & re-seated the probes on both sensors.

In total I have 3 high-temp sensors. One keeps returning a “Temperature out of range” error, so I think that one might be faulty. The other two (one plugged in to A0, the other into A2) are returning almost identical results to each other: 23C room, 14C probe. If there was a faulty sensor or probe, I would expect their numbers to differ at least a bit.

I’m going to buy a couple more sensors, and another Grove Pi (our project will need 4 if we can get this working) - to see if perhaps something is broken on the GrovePi.

If it matters, I have the first thermocouple pin set as 14, the second as 16. Both are returning an analog value of 67 or 68.

Hi @quasipickle,

Did you approximate your room temperature or have you used a standard thermometer for measuring it?
Here’s the quote from back then:

It’s not actually 13C in the room - it’s 23C

If you didn’t actually measured it, can you do it now?
I want to see what’s the “real” temperature in the first place.


Depending on what you say, I’ll be trying to narrow down a bit the possibilities.

On the other hand, do you intent to use these sensors for monitoring room temperatures (like from 10C degrees to 35C degrees) or do you want to use them for applications that require extreme temperatures?


Thank you!

Hi,

The 23C was what was being reported from the room temperature sensor portion of the high-temperature sensor. Just running it now, I get the output:

Probe: 11.957345216258856°C
Room: 22.57658174261985°C

Verifying by querying a DHT temp/humidity sensor, I get 25.2 °C

I intend to use these sensors for extreme temperatures - inside a barbeque where I anticipate the maximum temperature would get to 150C.

Hi @quasipickle,

I understand your situation and I can make the following summary - we are talking about 7 measuring sensors in total.

  1. 3 high temperature probes - of which 2 are indicating around 11 °C and the last one is giving errors (temperature out of range)

  2. 3 room temperature sensors (which are found on each of the high temperature Grove boards) - of which 2 are indicating around 22 °C and the last one is giving errors (temperature out of range)

  3. 1 DHT sensor - which indicates around 25 °C


All of the above are inconsistent and prevent me from getting a diagnostic.
My own tests look different from what you’ve got and make me think that those 2 functional boards are decalibrated and you need replacements.


Thank you!

That is an accurate summary.

So… 3/3 high temperature sensors aren’t working?

Is decalibration something that I could have done on my end? I’d like to know so I don’t do it again.

Thanks.

Hi @quasipickle,

It’s quite impossible to determine on my side what really happened there.
From my experience I haven’t encountered such a situation - as you already know, I’ve reproduced the test a couple of times after you’ve mentioned the issue and in all the situations, the readings were okay.

We’ll be waiting for you to test the new batch of sensors and then come back with some news.

Success!
And thank you!

I just received 2 more sensors and tried them out. I’m getting the same results. I thought since typically white is ground, that I would reverse the wires and put the white in the hole labelled “GND”, and the red in the hole labelled “TP4”. That made the results a little more accurate. For a while I was getting readings of 20/24 & though that had fixed it. Now I’m getting readings of 16/22 and 14/22.

analog_value in the method __getThermocoupleVoltage() is always 68 or 69. Is that an expected value (therefore possibly indicating a software problem) or is that too low (therefore possibly indicating a hardware problem).

Hi @quasipickle,

Seeing that all of your 5 sensors behave exactly the same, it means they all share a common problem.

On the other side of things, I have tried again my sensor and it gives me good readings with an absolute difference of 1 Celsius Degrees between the room temperature and the temperature of K-Type tip - which is expected and fine - even 2-3 Celsius Degrees would be totally acceptable.

Having my sensor work in the right parameters and seeing yours behaving such similarly between them, makes me think that something isn’t setup properly. A mistake that’s probably easily overlooked may lead to such situations, because 5 sensors going faulty is highly unlikely.

I’d suggest you start this mini-project from ground 0 again and see how it goes. Maybe something has been missed out.

Thank you!

I concur - the problem is something other than the sensors. I don’t know where else to look though. I just updated the GrovePi firmware and re-cloned & installed the GrovePi python libraries. Running your high_temperature_example.py, I get the same old numbers - not close numbers like you’re getting.

I agree that the problem is system-wide, I just don’t know what I could possibly have done to change anything. If something isn’t set up properly, what could it possibly be - I haven’t set up anything?

In my last post I said

analog_value in the method __getThermocoupleVoltage() is always 68 or 69

Is that an appropriate value for 22C? Or is it an appropriate value for 14C/16C? I’m wondering if the problem is somehow not enough voltage is getting to the sensors? Maybe the GrovePi itself is broken? None of the digital sensors I connect seem to have any problem - just the analog sensors, and just the high-temperature component.

Hi @quasipickle,


The analog_value in the __getThermocoupleVoltage() function sits at around 71 - my room is significantly warmer.
Heating up the K-Type tip by a couple of degrees only raises the analog_value to about 72-73.

So the precision that’s offering is quite low. I’m starting to think there’s a bad electrical contact somewhere (it can be something really minor), because for an increment of the analog_value variable, the temperature changes significantly - so it could justify your “offset”.


While thinking about it, the difference between 69 and 71 is almost neglectable, but for the sensor it matters a lot, because it represents a change of a couple of Celsius degrees.


Are you powering your Raspberry Pi (and hence the GrovePi) with anything else than a microUSB?
Whether you’re using a microUSB or not for powering it up, what’s the maximum amperage you can get?

I’ve checked my voltages I get on the Raspberry Pi and these are the following figure:

  • 4.97V for the 5V power supply

  • 3.33V for the 3V power supply

These figures look alright to me. How do they look at you?


Thank you!

Hi Robert,

We’re using microUSB.

I tested the voltages by connecting to pin 6 (the ground) and pin 2 (5V) and pin 1 (3V)

The 5V supply is kicking out 5.14V
The 3.3V supply is kicking out 3.31V

FYI, I also dipped the sensor into a cup of hot water. Our chemistry department lent me a datalogger so I could get a reliable temperature. When I measured the water, it was 78C, the sensor was returning around 68C. I realize this doesn’t change the direction of debugging, but it does show that the offset is not temperature dependent.

Thanks.