Page 3 of 3

Re: NTC thermistor Temp sensor

Posted: Sun Aug 30, 2020 11:57 am
by medelec35
Derrihj wrote:
Sun Aug 30, 2020 10:30 am
your Beta version is right on the money just like " an angry female lion with cubs to feed"
:lol:
Yes that version should be accurate.
There is even an offset function for if there is a slight difference.

Re: NTC thermistor Temp sensor

Posted: Mon Aug 31, 2020 7:00 am
by Derrihj
I've been making some notes from the two videos, took me allot of time to get notes out of there. why? ,Indians are good but i personally, have trouble getting info from their videos due to their accent. Here is a question, how can we set 1.1v internal reference voltage in flowcode such that the Maximum voltage a pic micro-controller can read is 1.1v to be used in this calculation instead of 5v?

Re: NTC thermistor Temp sensor

Posted: Mon Aug 31, 2020 8:52 am
by Steve001
Hi Derrihj

Yes you can you will also have to consult your data sheet for your device.

see this post - it is for V7 though and the screen shots appear to have been lost

viewtopic.php?f=63&t=19014

- there is information here in the wiki (V8)

https://www.matrixtsl.com/wiki/index.ph ... heral_CAL)

Vref Option

This property is of type Fixed list of ints and can be referenced with the variable name VREFOP.

selects the reference voltage option

Vref+ (x10mV)

This property is of type Signed integer and can be referenced with the variable name VREFVOL.

sets the value of the reference voltage (used for conversion calculations)

Steve

Re: NTC thermistor Temp sensor

Posted: Wed Sep 02, 2020 10:35 am
by Derrihj
Hi Medelec35 hope you are having a good day. Is it ok with you if i want to read about your Beta version formula in a detailed writing? That is if you have some free time to write it coz i try to make notes in my books sothat after some years i don't ask the same questions again or even my kids can find those notes and things become easier for them to understand. Thanks allot for the work you do and effort you put in.

Re: NTC thermistor Temp sensor

Posted: Wed Sep 02, 2020 8:29 pm
by medelec35
Hi Derrihj,
I will see what I can put together for you.
Did you sort out the internal reference side?

Re: NTC thermistor Temp sensor

Posted: Wed Sep 02, 2020 9:40 pm
by Derrihj
I just used what i thought can work haven't you looked at my flowchat yet? In the adc settings i used (110 x 10mV) to give me a 1.1v reference instead of (500 x 10mV) then i used the (GetVoltage macro). If you have a better way of doing it, well am ready to learn. And another question, how many samples does the GetVoltage macro take before converting the ADC value to voltage? Just want to know the accuracy.

Re: NTC thermistor Temp sensor

Posted: Thu Sep 03, 2020 3:28 pm
by chad
Hi Martin, Just a quick update. I calibrated your algorithm with my most accurate thermometer here and it tracks exactly.
I just found out that the chip I chose is yet another one that is only half- supported but your little code chunk works great!

Thanks!

Chad

Re: NTC thermistor Temp sensor

Posted: Thu Sep 03, 2020 4:49 pm
by medelec35
chad wrote:
Thu Sep 03, 2020 3:28 pm
I calibrated your algorithm with my most accurate thermometer here and it tracks exactly.
Hi Chad that's great!
Thank you, information like that is always useful to know.
chad wrote:
Thu Sep 03, 2020 3:28 pm
I just found out that the chip I chose is yet another one that is only half- supported
Best to bear in mind any company I contact, now take longer to get issues sorted due to the corna virus.
I would have thought matrix tsl is no exception.
Even though a small business I'm sure that would help you in anyway they can.
Just needs a little time to get sorted.

Re: NTC thermistor Temp sensor

Posted: Mon Sep 07, 2020 8:31 pm
by Derrihj
Added a PWM dc fan control with a percentage representation of it's speed according to temperature variations, starting at 30°C as the lower temp setting value @ 18% of fan max speed.

Re: NTC thermistor Temp sensor

Posted: Mon Sep 14, 2020 8:43 pm
by medelec35
Derrihj wrote:
Wed Sep 02, 2020 10:35 am
Hi Medelec35 hope you are having a good day. Is it ok with you if i want to read about your Beta version formula in detailed writing?
Hi Derrihj,
Sorry for the delay, been really busy with other projects and personal things.
I will post in two parts as it might look a bit confusing otherwise.
The first part is calculation of the thermistor value as that appears on the display:

First calculation box determines thermistor = R2 value:

Code: Select all

.ThermistorCalc = SeriesPullUpResistance * 1.0 / (1023.0 / .ReadThermistorADC * 1.0 - 1.0)
Note used *1.0 so the Float is not converted to a int which is called Type casting
Standard theory, Vout of a potential divider =

Code: Select all

R2/(R1 + R2)*VDD
Suppose we have VDD of 5V, 22K pull-up resistor and 10K thermistor.
We have

Code: Select all

Vout = 10K/(22K + 10K)*5 = 1.56V
As using a microcontroller

Code: Select all

ADC = Vin * 1023 / Vref
.
The Vin from above is really the Vout.
So you have

Code: Select all

ADC = R2/(R1 + R2)*VDD * 1023/Vref
Since Vref is the supply voltage:

Code: Select all

ADC =  10K/(22K + 10K)*5*1023/5
The two lots of 5 Cancel out:

Code: Select all

ADC =  10K/(22K + 10K)*1023 = 319.6875
This means the ADC vale is independent of supply voltage, which is a good thing.
As we know how the ADC is calculated, we need transpose for R2 = thermistor value:

Code: Select all

ADC =  R2/(R1 + R2)*1023
Therefore

Code: Select all

 R2 = R1 * ADC/(1023 – ADC)
It can be simplified to

Code: Select all

R2 = R1/(1023/ADC -1)

Code: Select all

R2 = 22K/(1023/319.6875 – 1)
R2 = 10K

Re: NTC thermistor Temp sensor

Posted: Mon Sep 14, 2020 10:04 pm
by Derrihj
Thanks allot Medelec35, now i know why the 1.0 comes in play just for explicit casting from int to float right? another thing did i do the 1.1v internal reference the way it should be done in Flowcode?

Re: NTC thermistor Temp sensor

Posted: Mon Sep 14, 2020 10:18 pm
by Derrihj
But that can come in after we look at part2 that is Temp with the offset in the calculation box

Re: NTC thermistor Temp sensor

Posted: Tue Sep 15, 2020 10:19 am
by Derrihj
Thanks allot with that moved, we can look at part2.

Re: NTC thermistor Temp sensor

Posted: Thu Sep 24, 2020 11:56 pm
by Derrihj
Hi Mr Martin hope you are fine, just asking kindly, do you have some time for part2?

Re: NTC thermistor Temp sensor

Posted: Fri Sep 25, 2020 3:45 am
by chad
Rather than all of this back and forth maybe Martin and Ben need to collaborate and update the Thermistor component
?
Chad

Re: NTC thermistor Temp sensor

Posted: Mon Sep 28, 2020 12:39 am
by medelec35
chad wrote:
Fri Sep 25, 2020 3:45 am
Rather than all of this back and forth maybe Martin and Ben need to collaborate and update the Thermistor component
the thermistor component works differently to the calculations I have given.
The thermistor component requires different resistances for different temperatures.
The flowchart i posted only requires the thermistance vale at 25C and beta value.
When I can find time and can remember source, I will post details.

Re: NTC thermistor Temp sensor

Posted: Mon Sep 28, 2020 4:19 am
by Derrihj
Learning different ways of doing something does not hurt but rather equips you with allot of info some of which can be used to solve other problems @ hand in another application. I love it when a solution is looked at in different ways in that way, you even get to choose which is better,simple and more accurate, which on the other hand i think the Thermistor component works as it should, Martin's method is just another way of doing things to choose from which is good for learning.

Re: NTC thermistor Temp sensor

Posted: Sun Nov 15, 2020 10:47 am
by Derrihj
Hi Medelec35, hope all is well,I've just realised that we didn't look at part two of the Thermistor cal.In my note book, i left a gap for it's notes i just pray you get some little time and have a look at it in your free time that will be great for me.Thanks for all the work and help you give out to others God Bless you.

Re: NTC thermistor Temp sensor

Posted: Tue Nov 24, 2020 6:04 pm
by medelec35
Hi Derrihj,
Sorry for the delay,
I have sent you a PM.

Re: NTC thermistor Temp sensor

Posted: Sun Dec 06, 2020 8:36 pm
by Derrihj
Thanks the PM was helpful.