NTC thermistor Temp sensor

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

NTC thermistor Temp sensor

Post by Derrihj »

Hi Everyone, am trying to make a temp sensor with a 10k NTC thermistor and the Steinhart and Hart Equation, I need it to read the temperature of upto 120 degrees Celsius but am having trouble please check my code, Help show me where i go wrong.And how do we enter a coefficient of say 1.125509474e-3 into the calculation box?
Attachments
Steinhart and Hart TEMP.fcfx
(14.83 KiB) Downloaded 244 times
Last edited by Derrihj on Thu Aug 27, 2020 3:31 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: NTC thermistor Temp sensor

Post by Benj »

Hello,
how do we enter a coeffient of say 1.125509474e-3 into the calculation box?
I beleive that would be...

0.001125509474

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

Ok that is what i used Benj but my display shows only 28.68 degrees at full range , there must be something am not doing right with the Steinhart and Hart equation as in Flowcode entry data eg the calculation box. Here is my Temperature (in Degrees C)/Resistance (in Ohms) Table of my 10K NTC Thermistor: (-40c/336,500 Ohms), (-30c/177,000 Ohms), (-20c/97,070 Ohms), (-10c/55,330 Ohms), (0c/32,650 Ohms), (10c/19,900 Ohms), (20c/12,490 Ohms), (25c/10,000 Ohms), (30c/8,057.0 Ohms), (40c/5327.0 Ohms), (50c/3,603.0 Ohms), (60c/2,488.0 Ohms), (70c/1,752.0 Ohms), (80c/1,255.0 Ohms), (90c/915.30 Ohms), (100c/678.30 Ohms), (110c/510.30 Ohms), (120c/398.30 Ohms), (130c/300.93 Ohms), (140c/235.27 Ohms), (150c/185.97 Ohms). But on my hardware, when i replace the NTC thermistor with a well known 10k 1% resistor to work as my NTC @ 25 °C , my displays shows 26.70°C on a real board this is wrong and it only goes up to 31.02°C at full range with the NTC in place.This is dead wrong.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: NTC thermistor Temp sensor

Post by mnf »

Hi Derrihj,

I'm not sure the calculation of the resistance of the thermocouple is correct (for example you will get an error at vOut = 1.0 (div by 0) )- see https://circuitdigest.com/calculators/v ... calculator
and also https://www.ti.com/lit/an/sbaa439/sbaa439.pdf

Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: NTC thermistor Temp sensor

Post by medelec35 »

Hi Derrihj,
There is a thermistor component built in to Flowcode, just use search and enter therm.
If not suitable then I created a flowchart that uses a themistor based on the beta value and results are very accurate.
It does not even rely on VDD fluctuations or what the supply voltage is!
If you want me to post it then let me know.
It's part of a huge flowchart so will need to modify to your needs.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

Am trying to convert an Arduino project to flowcode here is the link; https://www.ametherm.com/blog/thermisto ... hermistors

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

Medelec35, nice to see you please post your project i have a look at it am very sure i will learn allot from it

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by chad »

Hi Martin, I also am tiring to read a thermistor. I got the sensor package and used the thermistor component. It is reading but the values don't work correct. I think there might be something broken in it.

If you have a nice flow of a temp reader it would be super cool if you could strip it out and post it. :)

I wish that flowcode had a curated user component or code chunk menu.

Thanks,
Chad

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

I also used the thermistor component but the results were not good am also waiting for Medelec35's flowchat

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by chad »

Thanks for confirming that. Looking at the adc numbers things look ok but there is something broken with the component.
Martin is super smart so I would like to see what he comes up with too.

Thanks,
Chad

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

It will be so nice if Medelec35 can do for both the Beta version and also the Steinhart and Hart equation version in a flowchat example.But all in all what he has to offer i believe will be profitable.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: NTC thermistor Temp sensor

Post by medelec35 »

Been a busy couple of days.
Currently modifying & testing the beta version works.
Should be able to post this evening, all going well.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

That is great take all your time and thanks for the Love Medelec35

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: NTC thermistor Temp sensor

Post by medelec35 »

Hi Derrihj,
You're welcome.
Attached is beta version working for Eblocks2 PIC Multiprogrammer (16F1788).
So will need to change Target device, LCD and ADC to suit your hardware.
Attachments
Thermistor Temperature Measurement v1.0.fcfx
(12.8 KiB) Downloaded 235 times
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

Thanks allot Medelec35 , let me get my self ready to have a look.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

Ok now this is where it becomes interesting "learning time" i changed the code to work with my hardware running @ 8mhz external crystal with the PIC16F886 but to my supplies when i heat up the thermistor with a soldering gun interested of the temperature going up,it goes down to negatives but the resistance increases so it's the opposite of what it should do when i increase the heat may be am doing something wrong.And when i replace the NTC with a 10k res 1% it gives me -20C
Attachments
IMG_20200829_015617_062.jpg
IMG_20200829_015617_062.jpg (98.13 KiB) Viewed 11120 times
Last edited by Derrihj on Sat Aug 29, 2020 12:13 am, edited 1 time in total.

chad
Posts: 198
Joined: Sun Nov 04, 2018 7:13 pm
Has thanked: 27 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by chad »

I think you have a PTC thermistor? How to inverse all of thins I have no idea.

I just got mine up and running.

Chad

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

No it's an NTC coz before i hook it up on the board i first heat it up with a soldering gun and it does what NTC does best as temp goes up resistance goes down see pics below.
Attachments
IMG_20200829_021918_483.jpg
IMG_20200829_021918_483.jpg (72.35 KiB) Viewed 11116 times
IMG_20200829_021931_115.jpg
IMG_20200829_021931_115.jpg (72.25 KiB) Viewed 11116 times
IMG_20200829_021947_603.jpg
IMG_20200829_021947_603.jpg (74.71 KiB) Viewed 11116 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: NTC thermistor Temp sensor

Post by medelec35 »

Can you let me know the thermistor value at 25C and have you got the themistor connected to i/p pin and GND?
What value pull-up resistor have you got between i/p and +ve?
LCD is saying it thinks the current value of thermistor is 47K which does not sound correct as if 10K thermistor, it will be really cold.
You will need to look at all the Constant variables and make sure all values are correctly entered.
The issue might be to have connected themistor between ADC i/p and + supply?
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: NTC thermistor Temp sensor

Post by medelec35 »

chad wrote:
Sat Aug 29, 2020 12:12 am
I just got mine up and running.
Hi chad, you getting expected results?
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

Thanks Medelec35 issue was themistor between ADC i/p and + supply? Since i had already done the PCB before your flowchat so i changed to pull-up to +ve 5v and thermistor to GND and it obeyed like a humble dog now i have a task and that is to get to understand the code.

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

I know my thermistor Datasheet may not be that correct at the moment as i got this from an old DC to AC inverter coz when i measure it at room temp, I get around 12k but that isn't a big deal as i just wanted a code that works so that when i order a well known thermistor with the correct Datasheet am pretty sure things won't back fire on me.
Attachments
IMG_20200829_025150_652.jpg
IMG_20200829_025150_652.jpg (85.66 KiB) Viewed 11106 times
Last edited by Derrihj on Sat Aug 29, 2020 1:27 am, edited 2 times in total.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: NTC thermistor Temp sensor

Post by medelec35 »

Glad you have got your issue sorted out now.
If the beta is not known,
what about using the Flowcode built-in themistor component?
Just search for therm .
You will have to enter resistance values for a few set temperatures.
Some data sheets just give those values.
Don't need to know beta or Steinhart and Hart Equation.
Martin

Derrihj
Posts: 348
Joined: Mon Jul 09, 2018 12:43 pm
Has thanked: 67 times
Been thanked: 33 times
Contact:

Re: NTC thermistor Temp sensor

Post by Derrihj »

Thanks allot for the code Medelec35 God Bless u am planning to build a digital timer with a temperature sensor for my mother for her local cake cooker and mount it on the wall in an adaptable box and run sensor wires down to the cooker oven,what do you think is the best temp sensor i should use Medelec35, RTD or Thermister with that sensor distance from the wall thanks.
Last edited by Derrihj on Sat Aug 29, 2020 1:36 am, edited 1 time in total.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: NTC thermistor Temp sensor

Post by medelec35 »

You're welcome.
What is the expected maximum temperature?
Martin

Post Reply