Thermistor component with extern AD-converter

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
stefan.erni
Valued Contributor
Posts: 1037
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 198 times
Been thanked: 218 times

Thermistor component with extern AD-converter

Post by stefan.erni »

Hi Ben
There is a nice component for NTC resistor.
would it be possible to extend the component to an external AD converter?
for example an ADS1115 :)

The Thermistor component has so many advantages
A simple configuration of the AD converter.
Just enter the used pull down resistance value.
it is very comfortable to insert the few values according to the temperature.
2024-07-16_15-48-27.PNG
2024-07-16_15-48-27.PNG (60.89 KiB) Viewed 9154 times
These values can already be found on very cheap NTCs like this one
2024-07-16_16-00-41.PNG
2024-07-16_16-00-41.PNG (21.5 KiB) Viewed 9154 times
https://www.mouser.ch/ProductDetail/Bu ... ulQ%3D%3D

On page 7 the complet list
https://www.eaton.com/content/dam/eato ... x1226.pdf
2024-07-16_15-01-20.PNG
2024-07-16_15-01-20.PNG (48.42 KiB) Viewed 9154 times
simple to test and easy to expand to 4 NTC and with an I2C multiplexer component to many sensors
2024-07-16_16-05-50.PNG
2024-07-16_16-05-50.PNG (859.71 KiB) Viewed 9154 times

BenR
Matrix Staff
Posts: 1944
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 508 times
Been thanked: 690 times

Re: Thermistor component with extern AD-converter

Post by BenR »

Hello,

Many thanks for the suggestion, I've now added in a new property to the thermistor component that allows you to select between internal ADC and an external ADC. For an external mode the ADC conversion is skipped and instead you need to provide the sample value using the new SetADCValue component macro.

Let us know how you get on.

stefan.erni
Valued Contributor
Posts: 1037
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 198 times
Been thanked: 218 times

Re: Thermistor component with extern AD-converter

Post by stefan.erni »

Hi Ben

On my ESP32 Wroom i get a fail if I choose extern ADC (no fail if intern).

One more question. With the internal ADC I can (must) select Vref

I can't with the external ADC, but I have different gains with the ADS1115.
can I use a specific one?
A small remark. The ADS1115 delivers a very stable signal.

vref internal:
2024-07-19_17-16-29.PNG
2024-07-19_17-16-29.PNG (44.41 KiB) Viewed 9094 times
vref external:
2024-07-19_17-06-58.PNG
2024-07-19_17-06-58.PNG (33.93 KiB) Viewed 9094 times
ADS1115 Gain option:
2024-07-19_17-12-27.PNG
2024-07-19_17-12-27.PNG (38.4 KiB) Viewed 9094 times

BenR
Matrix Staff
Posts: 1944
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 508 times
Been thanked: 690 times

Re: Thermistor component with extern AD-converter

Post by BenR »

Hello,

Thanks for letting us know, Hopefully compile error with external mode now fixed for you.

The thermistor component assumes that you have the full resolution of the ADC so the gain probably needs to reflect this too, I imagine it's the lowest setting you need but I could be wrong.

stefan.erni
Valued Contributor
Posts: 1037
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 198 times
Been thanked: 218 times

Re: Thermistor component with extern AD-converter

Post by stefan.erni »

Hi Ben

I have still the fail compile error with external mode.

With the ADS1115 I test later if it's correct with the best Vref.setting


Several to choose:
2024-07-22_11-08-10.PNG
2024-07-22_11-08-10.PNG (126.14 KiB) Viewed 8906 times
Program:
L24_1.fcfx
(228.95 KiB) Downloaded 493 times

stefan.erni
Valued Contributor
Posts: 1037
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 198 times
Been thanked: 218 times

Re: Thermistor component with extern AD-converter

Post by stefan.erni »

Hi Ben

I can compile with the thermistor component now.

There are still little problems:

When I set the component to 16 bits, save the program and load it again, the bits are set to 12 bits again.

Something is also wrong with the ADS1115.
This has such special Vref settings and never delivers a signal above 32767. With this value I only get 25 degrees or less.

I can set the NTC supply voltage with a lab power supply, but more than 25 degrees (32767) is not possible. No matter what Vref I set

Would it also be possible to use the NTC supply voltage about 3.3 volts or would it be adjustable independent from the Vref of the ADS1115?

stefan.erni
Valued Contributor
Posts: 1037
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 198 times
Been thanked: 218 times

Re: Thermistor component with extern AD-converter

Post by stefan.erni »

Hi Ben


I found the problem from the ADS1115, it's just to 32767 possible.
Single-ended signal measurements, where VAINN = 0 V and VAINP = 0 V to +FS, only use
the positive code range from 0000h to 7FFFh
So calculated the value fron NTC resistor
It working nice but I need a component
which has the resistance value as an imput and the table with the 7 pairs of values.
There can also be more than 7 pairs .
This component could also be used not only for temperatur but also for other values such as a pressure sensor
where I have 20 different calibrated values, every 25 Newton a value up 500 Newton

I calculated the value fron NTC resistor like this
2024-08-09_15-41-09.PNG
2024-08-09_15-41-09.PNG (50.87 KiB) Viewed 7734 times

Post Reply