Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: New Internal Temperature Library

  1. #1

    New Internal Temperature Library

    Here's a library to read the internal temperature of the Teensy 3.x or LC. Now you can see how hot the processor gets when running your new algorithm at maximum overclocking . Or run it in low power mode to get an approximation of the air temperature.

    Library is at https://github.com/LAtimes2/InternalTemperature.

    Documentation is here.

  2. #2
    Senior Member
    Join Date
    Apr 2017
    Posts
    156
    Thanks for writing this, i can't wait to give it a shot

    Kris

  3. #3
    Member
    Join Date
    Oct 2017
    Location
    Ukraine
    Posts
    21
    Hi everyone!
    I tested this library, and noticed shortcomings:
    Together with temperature measurements of a kernel I make the analysis of ATsP on other channels. Almost always it uses resolution of 12 bits (default) and voltage reference of Aref - too default. Your code leads to the fact that the ATsP settings and to the incorrect indication of other analog signals get off.
    Why you use resolution of 16 bits and internal voltage reference?
    Perhaps it is necessary to save the previous settings at measurement and after temperature measurement to recover them or to use current settings which were set for measurement of other channels? It will result in correctness of reading of other measurements.
    Perhaps, this function needs to be added to a kernel of Arduino in the future?

    Forgive for my English.
    Last edited by Lukashuk; 01-13-2019 at 10:17 AM.

  4. #4
    Thank you for your comments. When I wrote this, I was not thinking about also using the ADC for other measurements. This was the first time I had used the ADC for anything.

    Quote Originally Posted by Lukashuk View Post
    Why you use resolution of 16 bits and internal voltage reference?
    I think it can use any settings, I chose these from other examples I saw.

    Quote Originally Posted by Lukashuk View Post
    Perhaps it is necessary to save the previous settings at measurement and after temperature measurement to recover them or to use current settings which were set for measurement of other channels?
    I will change it to either use the current settings, or save and restore the settings.

    Thanks for helping me make this library better.

  5. #5
    Member
    Join Date
    Oct 2017
    Location
    Ukraine
    Posts
    21
    Hello! I think you need to use the current settings, as a rule - for measurements, the settings are made at the beginning and do not change later.
    If the library is fixed, maybe I can use it in my new project. I will need to do continuous multichannel measurements from 8 to 10 + temperature.

  6. #6
    I just released a new version of the temperature library (https://github.com/LAtimes2/InternalTemperature).

    It uses the current ADC settings when reading the temperature, so it won't interfere with other ADC readings.

    By default it still sets the ADC settings for maximum accuracy. But if you don't want it to change any ADC settings, add a pass parameter to begin:

    Code:
    temperature.begin(TEMPERATURE_NO_ADC_SETTING_CHANGES);
    This should make it useful in more applications.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •