Page 1 of 1
Thermistor component with extern AD-converter
Posted: Tue Jul 16, 2024 3:09 pm
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 (60.89 KiB) Viewed 9164 times
These values can already be found on very cheap NTCs like this one

- 2024-07-16_16-00-41.PNG (21.5 KiB) Viewed 9164 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 (48.42 KiB) Viewed 9164 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 (859.71 KiB) Viewed 9164 times
Re: Thermistor component with extern AD-converter
Posted: Fri Jul 19, 2024 3:41 pm
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.
Re: Thermistor component with extern AD-converter
Posted: Fri Jul 19, 2024 4:23 pm
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 (44.41 KiB) Viewed 9104 times
vref external:

- 2024-07-19_17-06-58.PNG (33.93 KiB) Viewed 9104 times
ADS1115 Gain option:

- 2024-07-19_17-12-27.PNG (38.4 KiB) Viewed 9104 times
Re: Thermistor component with extern AD-converter
Posted: Mon Jul 22, 2024 9:44 am
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.
Re: Thermistor component with extern AD-converter
Posted: Mon Jul 22, 2024 10:19 am
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 (126.14 KiB) Viewed 8916 times
Program:
Re: Thermistor component with extern AD-converter
Posted: Tue Aug 06, 2024 2:27 pm
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?
Re: Thermistor component with extern AD-converter
Posted: Fri Aug 09, 2024 2:56 pm
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 (50.87 KiB) Viewed 7744 times