10 Replies Latest reply on Oct 5, 2017 8:04 PM by BoTa_264741

    Fast Thermistor Calculator


      Hi All,


      Attached is my Thermistor Calculator component ("myThermistor"). It calculates thermistor temperature from the resistance, similar to the Creator's stock Thermistor component. Calculated temperature returned as float-precision value with accuracy approx. 0.001 degC. Calculation speed is about 14-15x times faster than stock Thermistor component (formula-based) taking about 1100 CPU cycles.


      The component was developed for fast TEC control, where accuracy, speed and wide temperature range were important. Attached archive contains the workspace bundle of the demo project, datasheet, screenshots and reference materials. Tested on PSoC5LP.





      P.S. Updated link to SRS Thermistor Calculator:



      myThermistor demo.PNG


      SRS Thermistor Calculator.png

        • 1. Re: Fast Thermistor Calculator

           Thanks for sharing this with the community.





          • 2. Re: Fast Thermistor Calculator

            I opened this design and not see any connections to thermistor. How it`s work ?


            Usually exist thermistor and normal resistor and ADC that calculate difference between ... 

            • 3. Re: Fast Thermistor Calculator

              It is a pure software component that offers different ways to calculate the temperature from ADC values. See datasheet.





              • 4. Re: Fast Thermistor Calculator
                        chaplin.u, the Fast Thermistor Calculator is a replacement for Cypress stock Thermistor Calculator component and should be used same way the standard Thermistor Calculator is used. This component optimizes calculation speed (approx. 15x faster) by using log function approximation. Use Cypress standard Thermistor demo project and add/replace Thermistor Calculator.   
                • 5. Re: Fast Thermistor Calculator

                  Thanks, I tried it and it work fine. Just one problem. Instead of it`s "pure software component"  when I change my device to PROC Components tab is not visible and receive error :Component is not supported by this device...

                  • 6. Re: Fast Thermistor Calculator

                    I will take a look what is going on. But don't hold your breath...

                    • 7. Re: Fast Thermistor Calculator

                      Here is an answer. The custom component creation is not supported for PRoC family of devices. (?!)


                      The FastThermistorCalculator is indeed is just a piece of C code with component symbol attached to it. All you need is to copy *.h and *.c files into your project and set parameters in code like that.


                      Replace in *.h:


                      *           API Constants


                      #define `$INSTANCE_NAME`_REF_RESISTOR   ((float) `$ReferenceResistor`) //Reference resistor value [oHm]

                      #define `$INSTANCE_NAME`_K2C    (273.15f)                       //conversion degK to degC, deg: Tc = Tk - K2C


                      #define `$INSTANCE_NAME`_THA    ((float) `$SteinhartHart_THA`)  //Steinhart-Hart coeff A  

                      #define `$INSTANCE_NAME`_THB    ((float) `$SteinhartHart_THB`)  //Steinhart-Hart coeff B

                      #define `$INSTANCE_NAME`_THC    ((float) `$SteinhartHart_THC`)  //Steinhart-Hart coeff C




                      with something like (use your parameters!):



                      *           API Constants


                      #define `$INSTANCE_NAME`_REF_RESISTOR   ((float) 10000.0) //Reference resistor value [oHm]

                      #define `$INSTANCE_NAME`_K2C    (273.15f)                       //conversion degK to degC, deg: Tc = Tk - K2C


                      #define `$INSTANCE_NAME`_THA    ((float) 0.0011259)  //Steinhart-Hart coeff A  

                      #define `$INSTANCE_NAME`_THB    ((float) 0.0002346498)  //Steinhart-Hart coeff B

                      #define `$INSTANCE_NAME`_THC    ((float) 8.564001E-08)  //Steinhart-Hart coeff C

                      • 8. Re: Fast Thermistor Calculator

                        Thanks ! I found second way. Just changed to PSOC device, compiled, copy generated code to my project and return to PROC.

                        Thanks for your code again !!!

                        • 9. Re: Fast Thermistor Calculator

                          Hi !

                          What a range of temperatures this calculator ? In datasheet not exist this information.

                          • 10. Re: Fast Thermistor Calculator

                            Good question. The accuracy was tested using a set of A,B,C coefficients

                            for a 10k thermistor, which I typically use (TS-91), using the test demo

                            project provided.  The Datasheet clearly states that accuracy comparison

                            was done in Range 0-50C (from Rmin=3.602 k to Rmax=33.660 k)

                            You can run demo using your set of Steinhart coefficients to check the

                            accuracy of approximation in the range of interest.