ESP Easy and an NTC - Possible?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

ESP Easy and an NTC - Possible?

#1 Post by hotspot_2 » 09 Dec 2022, 21:54

Hello,

a am a beginner with ESPEasy. I have build three ESP8266 D1 mini with ESPEasy ony my own with 2-4 DS18B20 to measure temperatures on my heating in my house. This works gently with transmitting the temperatures to iobroker. I am displaying them in my VIS and recording them in the database for further analysis. I also have a buffer water storage for my solar thermal system with three builtin NTCs. At the moment these NTCs are connected with a little display and displaying the three temperatures in the cellar ath the buffer water storage (top, middle, bottom temperature).

This is the device with the NTC and the display:

https://www.waerme24.de/heizung/warmwas ... 43683.html

I got information about the NTC from the manufacturer of the thermometer (see attachment).
2022-11-21_15h49_04.png
2022-11-21_15h49_04.png (190.86 KiB) Viewed 9493 times
Now i want to know if it is possible to connect the NTC to the ESP8266 D1 Mini, getting the temperature and transmitting this via MQTT to the iobroker. Similar to the ESPs and the DS18B20?

Can you help me how to that?

Thanks a lot in advance!

(Sorry for my not so perfect englisch ;-), greetings from germany)

User avatar
Ath
Normal user
Posts: 3011
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP Easy and an NTC - Possible?

#2 Post by Ath » 09 Dec 2022, 22:08

First that comes to mind is the analog input of the ESP8266, that should be usable to get a voltage relative to the temperature in some way. Don't know (see) yet how linear the temperature/resistance curve is, but hopefully it is, then the calculation wouldn't be too difficult.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#3 Post by TD-er » 09 Dec 2022, 22:35

Even if it isn't linear, then you can add a lot of points to reduce the error.
See: https://espeasy.readthedocs.io/en/lates ... processing
You can also add a formula first to make it a bit more linear.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#4 Post by hotspot_2 » 10 Dec 2022, 08:51

So i will begin to build a test build with another 50 k ntc in this setup:
2022-12-10_08h47_20.png
2022-12-10_08h47_20.png (49.96 KiB) Viewed 9466 times
A 50k resistor parallel to the NTC, connected with GND and A0 from the D1 Mini. 3,3V Input also from the D1 Mini.

And then i can adjust the settings in ESPEasy on the D1 Mini? I need three D1 Mini later for each NTC in my use case.

Ok, i will try this and coming up with some questions i think ;-). Really great that it seems to be possible and i am looking forward to solve this.

Tanks for your assistance so far!

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#5 Post by TD-er » 10 Dec 2022, 09:53

Just looked for a chart to get an idea of the non-linearity of the curve.
Then found this, which is actually exactly what you want: https://circuitcellar.com/resources/qui ... ization-2/
The only difference is the applied voltage.
Between -10 and + 45C it seems reasonable steep.

A few suggestions:
- Add a 100 nF cap over A0 and GND, close to the ESP. (will reduce noise when using a long cable)
- select to use oversampling in the Analog input task.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#6 Post by hotspot_2 » 10 Dec 2022, 12:54

Thanks for your advices. I now put into a new circuit plan.
2022-12-10_12h52_52.png
2022-12-10_12h52_52.png (33.86 KiB) Viewed 9447 times
Perhaps you can have o look and help me with the resistance value of Rp. Thanks ;-).

My range of interest would be 10...90 degrees celsius. So the middle woud be about 50 degrees celsius. This means a resistance value of the NTC (Rt) of 16799 €). So i would be fine Rp = 16k, or not?

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#7 Post by TD-er » 10 Dec 2022, 13:05

The 100 nF cap should not be one with a "polarity".
So no need to worry about that one.
And "very close" can be interpreted as "close".
It is more like if you're using longer wires, those may pick up noise. Therefore the capacitor will have next to no effect if positioned near the resistor(s) instead of near the ESP.

The link I gave you was using a NTC which has 10k and they used a 10k resistor between A0 and GND.
When using 10V, the practical highest was 8V out.
But 0.8 * 5V is more than 3V3. So you better use 3V3 on the NTC.
Then you don't need a parallel Rp resistor as it will only make the voltage higher.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#8 Post by hotspot_2 » 10 Dec 2022, 13:13

Cool, getting closer I think. :D
Really cool!

So this would be my setup?
2022-12-10_13h09_58.png
2022-12-10_13h09_58.png (26.83 KiB) Viewed 9441 times
I will try this first with a 47k NTC and a Rs with 47k on my breadboard. Getting the ESP D1 Mini Working transmitting the temperatures to ioBroker and so on. Then i will go for my use case with the buffer storage thermometers and the 50K NTCs.

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#9 Post by TD-er » 10 Dec 2022, 13:19

Yep.
You will probably want to use the multi-point feature of the ADC plugin.
And I think you might also want to calibrate the ADC input first to map it to calibrate it.

Keep in mind that a typical 5% tolerance of carbon resistors might have quite a big effect on the NTC measured temperature as it is not a really steep curve on the range you plan on using.

Just curious, what you try to measure.
Perhaps a thermocouple is a better idea?

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#10 Post by hotspot_2 » 10 Dec 2022, 13:30

I want to measure three temperaturs in a buffer storage for my house heating.
2022-12-10_13h22_10.png
2022-12-10_13h22_10.png (176.24 KiB) Viewed 9435 times
There are three temperature sensors already placed in the buffer (top, middle, down). I can't really get them out and change them or place another sensor because this is really hard. So i asked the manufacturer of these already placed sensors what there is in it. I hoped for DS18B20 but it is an NTC with 50k. So i now want to use them with the ESPs and get the temperatures for my iobroker server.

Because i am a complete noob in these things, i only build some temperature sensors with DS18B20 and several ESP D1 Mini (they work fine) i am not really in what you mean with "calibrating"?
And your hint with the 5% tolerance would mean better not use the resistor or a better resistor?

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#11 Post by TD-er » 10 Dec 2022, 13:43

If you have 1% resistors, please use them.
The reason I mention to use both the 2-point calibration and the multipoint is because you will be making several of these.
The curve remains the same, so the computed multi point values should be the same.
However you need to calibrate at least 1 temperature to compensate for all the tolerances in your setup.
These unknowns are:
- Tolerance per ESP module on measuring the analog voltage
- Tolerance per NTC
- Tolerance per used resistor.

But the curve you need to correct is the same, so you only need to calibrate one extra point.
For example you calibrate using 100C (boiling water) and then you only need to change/update 1 pair of values in the settings per ESP.

Simply put:
- Input voltage -> 0...1023 ADC value
- Convert ADC value to some range like 0 ... 10 using the 2-point calibration section. (which matches the curve in the link I gave)
- Use the multipoint calibration to convert 0 ... 10 to some temperature value (essentially matching the curve shown in the link I gave you)

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#12 Post by hotspot_2 » 10 Dec 2022, 14:03

Ok, i'm getting closer.

Calibration is done by measuring a temperature (with another temperature sensor) and the settings / adjustments are done in the ESPEasy Software that the temperature fits.

I have 1% resistors ;-).

User avatar
Ath
Normal user
Posts: 3011
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP Easy and an NTC - Possible?

#13 Post by Ath » 10 Dec 2022, 14:05

When trying to measure 3 of those levels, you might consider using an ADS1115 analog input board. That's supported by ESPEasy, offers 4 separate inputs and some more accuracy (16 bit over 10-12 bit of the internal ADC), especially as the level differences are not really big. For measuring 3 inputs you will have to configure 3 device tasks, and the plugin also has the 2-point calibration feature :)

Additional advantage: You only need 1 ESP module ;)
/Ton (PayPal.me)

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#14 Post by hotspot_2 » 10 Dec 2022, 14:12

Great idea! Thanks. I will order this board. Set up my test board and than i will surely ask some questions again how to this "calibration" will work.

The board cannot be used with the D1 mini? I have to buy also an ESP32?

Really, really a big thank you to you all! I think i will get this job done with your help!

User avatar
Ath
Normal user
Posts: 3011
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP Easy and an NTC - Possible?

#15 Post by Ath » 10 Dec 2022, 14:28

That ADS1115 board is connected via I2C, and that is supported both using an ESP8266 board and an ESP32 (or ESP32s2), so no need to switch your ESP unit.

The ESP32 chips do support multiple analog inputs with 12 bit resolution, with some (minor) restrictions as noted here, so if you have an ESP32 available, that could also be used instead of an ESP8266 (or ESP32) with an ADS1115 board (the ESP8266 only has 1 analog input).
/Ton (PayPal.me)

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#16 Post by hotspot_2 » 10 Dec 2022, 14:39

Ok, got it.

And this is how to connect them:
2022-12-10_14h37_59.png
2022-12-10_14h37_59.png (180.1 KiB) Viewed 9413 times
Perfect. Going to order and then i'll be back ;-)

I think placing the 100 nf caps would be more difficult. :)

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#17 Post by TD-er » 10 Dec 2022, 15:35

The caps are mainly to make the readings more stable.
Especially when using some longer wires to the NTC, you will pick up noise.
Since the curve of the NTC isn't linear, nor steep at the range you will be using it, a little bit of noise may make the readings fluctuate quite a bit.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#18 Post by hotspot_2 » 14 Dec 2022, 14:22

Hello all ;-),

i now have the ads1115 board and the esp8266 connected and espeasy is installed. I'm now building the breadboard and going for the settings with espeasy.

For the testing i am using a 47k NTC and a 47k resistor. But my build-in ntcs have 50k. Until now i haven't found a 47k resistor. But i am still searching.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#19 Post by hotspot_2 » 14 Dec 2022, 14:51

Build it up. Connected A0 und GND to the ads1115 board (and also 3,3V and SDL and SDA) and i now can see this:
2022-12-14_14h47_46.png
2022-12-14_14h47_46.png (10.91 KiB) Viewed 9294 times
When i touch the NTC it changes:
2022-12-14_14h49_06.png
2022-12-14_14h49_06.png (12.17 KiB) Viewed 9294 times
The settings are as follows:
2022-12-14_14h46_26.png
2022-12-14_14h46_26.png (30.98 KiB) Viewed 9294 times
Can you now help why there is no voltage value? And how to set the values for calculating the right temperature?

Thanks in advance!

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#20 Post by TD-er » 14 Dec 2022, 15:37

The ADS1115 only outputs raw ADC readings.
So you can convert those in the formula field (or in the rules) to some value you can work with.

For this you may need to have a look at the datasheet: https://www.ti.com/lit/ds/symlink/ads1115.pdf
See page 17, where Table 3 shows the relation between the raw ADC values and the voltage, per set range.
So in the 6.144V range you should multiply the ADC value with 187.5 uV => Formula field: %value%*0.000187.5
Please take into account the remark below this table, that the input should never exceed Vdd + 0.3V.
I assume you're powering the chip with 3V3, so this means you should never exceed input voltages over 3.6V.

User avatar
Ath
Normal user
Posts: 3011
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP Easy and an NTC - Possible?

#21 Post by Ath » 14 Dec 2022, 15:56

I think the Input Multiplexer should also be set to "AIN0 - GND (Single-Ended)", and not to a differential measurement like the screenshot shows, as AIN1 is not connected to anything (floating).
/Ton (PayPal.me)

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#22 Post by hotspot_2 » 14 Dec 2022, 21:14

Now it looks better.
2022-12-14_21h11_08.png
2022-12-14_21h11_08.png (38.64 KiB) Viewed 9269 times
and the volt value now looks much better.
2022-12-14_21h11_23.png
2022-12-14_21h11_23.png (8.99 KiB) Viewed 9269 times
Now how can i get degrees celsius out of the value and do the calibration?

User avatar
Ath
Normal user
Posts: 3011
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP Easy and an NTC - Possible?

#23 Post by Ath » 14 Dec 2022, 21:24

hotspot_2 wrote: 14 Dec 2022, 21:14 Now how can i get degrees celsius out of the value and do the calibration?
If you click the question mark icon, next to the Device name, you are directed to the documentation page (on the Wiki) that has a description how to set up the calibration. That way you determine a mapping for the lowest and highest feasible temperatures you expect to measure, and map the readings to the temperature measured. All the calculation is then done by the plugin :D
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#24 Post by TD-er » 14 Dec 2022, 21:42

Well the curve is absolutely not linear, so maybe you should first pick the range you need and then pick 2 calibration points at roughly 20% and 80% of that range.
Then use these points as reference points.
For a linear interpolation, this will then probably have an acceptable error.
If the values inbetween don't really matter, but the upper and lower limit are rather crucial, then you should of course take those 2 points for your calibration.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#25 Post by hotspot_2 » 14 Dec 2022, 21:51

Ok, i will check this. So the curve of my NTC 50k (above) is not linear, so i will try with 2 calibration points (at 20 / 80%). I think my range would be from 10..90 degress celsius.

Can you help if it would be also acceptable to use an 47k resistor with the 50k ntc? It seems to be really hard to get 50 k resistors.

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#26 Post by TD-er » 14 Dec 2022, 22:24

50k = 47k + 3k in series.
Given the tolerances, you probably can get away with 47k + 3k3 in series.
Or 47k + 1k5 + 1k5

But the only thing it does here, is to make sure you don't need to re-calculate all from the page I linked.
Functional, you can use 47k resistor and 50k NTC.

The 20% and 80% points of 10...90C are roughly 25C and 75C

At 25C you have a 50k resistance.
at 75C it is 6466 Ohm.

So the expected voltages when using a 47k resistor are:
(47k/(50k+47k) ) * 3V3 = 1.5989V for 25C
(47k/(6466+47k)) * 3V3 = 2.9009V for 75C

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#27 Post by hotspot_2 » 02 Jan 2023, 17:49

At the moment my setup is not really working. The value measured jumps from 4850 to 4961 with the settings above on A0 - GND. It does not really change with changing temperatures. When i put the function in for calculating the voltage the value does not move anyway (always 0.92). Really disappointing that i can't get this done.
2023-01-02_17h43_00.jpg
2023-01-02_17h43_00.jpg (77.71 KiB) Viewed 8910 times
My hardware setup:
image0.jpeg
image0.jpeg (3.14 MiB) Viewed 8910 times
Perhaps someone can help my with any ideas?

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#28 Post by TD-er » 02 Jan 2023, 17:52

Can you draw a schematic on how you wire the NTC?
I can't see it based on these pictures.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#29 Post by hotspot_2 » 02 Jan 2023, 20:10

Sure.
2023-01-02_20h08_31.jpg
2023-01-02_20h08_31.jpg (203.28 KiB) Viewed 8901 times

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#30 Post by TD-er » 02 Jan 2023, 20:46

Can you add some potentiometer (or just some resistors) at the position of the NTC, so you can see the values actually change.
Just disable any calibration or any functions and see if you actually see the correct inputs change.

N.B. there have been some reports by some other users about the ADS1115 where apparently the wrong input pin was measured.
I have not looked into this myself, so no idea how or when these may occur.
But for this reason, it is best to make sure you are "measuring" a predictable value and preferrably different values on each input.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#31 Post by hotspot_2 » 06 Jan 2023, 17:12

I now tried several resistors 22kOhm, 47 kOhm, 4,7 kOhm and the value is not really changing. It stays at 0,89..0,91. I also have some doubts because the value when no NTC or resistor is connected in on my self build board is also 0,90..0,92. It should be 0, or not?

Is the ADS1115 not working? Should i change it?

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: ESP Easy and an NTC - Possible?

#32 Post by igorka » 07 Jan 2023, 13:12

Try to close the ADC output to GND, the value should be 0. It seems that the ADC value is just a tip.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#33 Post by hotspot_2 » 07 Jan 2023, 21:39

Thanks! I will check that. What do you mean with „is just a tip“?

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: ESP Easy and an NTC - Possible?

#34 Post by igorka » 07 Jan 2023, 21:59

hotspot_2 wrote: 07 Jan 2023, 21:39 What do you mean with „is just a tip“?
Sorry, I meant something else. Google translit translated it wrong. I wrote that the ADC input does not receive a useful signal - interference. And if this is true, then after you connect the ADC pin to the GND bus, the value should be 0. Just make the wire as short as possible. Also, the ADC values may randomly change due to poor power supply of the module, but this is the second possible reason.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#35 Post by hotspot_2 » 12 Mar 2023, 17:53

Hello,

i now used the single analog input of the ESP8266 D1 Mini and built one NTC and 50 k@ Resistors. It now works much better in my first test. I am using 3,3 Volt (output D1 Mini) and i get an temperatur of about 16 degress 1,65 Volt. When i grab the NTC the voltage goes up and when not grabbed it goes down. Seems quite good ;-).

The Formula is like this: %value%*0.000187.5.

The other settings are standard (after flashing the esp8266_1M_normal image).

So the only thing i have to do now is setting two points with 25 and 75 degress celsius and then i can get my temperatures?

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#36 Post by TD-er » 12 Mar 2023, 18:05

The relation between temperature and measured voltage isn't linear, so you need to do a bit more.
On a small temperature range the response can be approximated by a linear interpolation.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#37 Post by hotspot_2 » 12 Mar 2023, 23:35

Ok.

I am going from about 15 degrees celsius to 80. Is this a small range? If not what else will i have to do.

Thanks.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#38 Post by hotspot_2 » 19 May 2023, 20:18

Meanwhile i made three seperate litte boards and now three ESPs with the A0 input are working quite well. Some litte problems, but quite qood.

The measurement of temperatures is really good, about 0.5 degrees more or less than another thermostat.

Here my settings in ESP Easy:
lcit_1.jpg
lcit_1.jpg (116.6 KiB) Viewed 7133 times
lcit_2.jpg
lcit_2.jpg (102.56 KiB) Viewed 7133 times
The problem i want to solve is that the temperature is jumping up and down (about 1 degree) and i want to know if there is way to solve this. Not really bad, but for the recording of the data a little bit more precise.
lcit_3.jpg
lcit_3.jpg (100.67 KiB) Viewed 7133 times
Thanks a lot for your help, and also thanks for your help so far. I''m really pleased how it is working!

User avatar
Ath
Normal user
Posts: 3011
Joined: 10 Jun 2018, 12:06
Location: NL

Re: ESP Easy and an NTC - Possible?

#39 Post by Ath » 19 May 2023, 20:48

hotspot_2 wrote: 19 May 2023, 20:18 The problem i want to solve is that the temperature is jumping up and down (about 1 degree) and i want to know if there is way to solve this. Not really bad, but for the recording of the data a little bit more precise.
You could use the average of the last 16 (or 64 on ESP32) measurements, by using the statistics included in the builds that have the Stats option for Values, see the docs and you can also use the average of the last X measurements if you prefer that. You won't be able to use the regular Controller checkbox to send these average values to your HA server, but should use rules for that, using the Publish command, the value part would then be: [temperatur_pufferspeicher_oben#temperatur_pufferspeicher_oben.avg] (or end in .avg10 for the average of the last 10 measurements)
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#40 Post by TD-er » 19 May 2023, 21:26

In the range from 60 - 80C, I see only 2 "dots" on the conversion curve.
Each dot is 32 ADC steps, so each degree C is roughly 3 ADC steps.
That's about the noise of the ADC.

I suggest to add some small capacitor (100 nF) close to the ESP's analog port and the GND.
This will filter out some of the noise picked up by the cable from the sensor to the ESP.

Also you are measuring at the edge of the measurement range of the ADC, which is probably also adding something to the noise.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#41 Post by hotspot_2 » 20 May 2023, 08:35

The 100 nF transistors are in now. I put them "on" the ESPs.

Now i have to figure out the average thing with "stats" and how to send the average value with mqtt to ioBroker. The documentation (links above) didn't really help till now for me.

Just a question: The setting for Oversampling is right in my settings? I am not really sure about this setting.

I will try on with the average setting (stats) but thanks really close now ;-).

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#42 Post by TD-er » 20 May 2023, 11:04

Placing the capacitor "on" the ESP is exactly what I meant, as close to the ESP as possible :)

Yep, with 'oversampling', the analog pin will be read quite often and being averaged.
Also the max. and min. value seen in that period will be left out to filter out 'spikes'.


As linked by Ton: https://espeasy.readthedocs.io/en/lates ... statistics

When you enable 'stats' for a task value, you can use some additional 'features' of task values.

For example your task is called "oben" and the taskvalue is called "temp" (your names are way too long to be practical as it would end up like "temperature_pufferspeicher_oben#temperature_pufferspeicher_oben")

Right now, you send directly to the MQTT controller, but to use the average, you need to act on the new values via rules.

So let's assume your task/taskvalue are as I suggested: oben#temp
And the topic you're publishing to is something you need to change in the rules for yourself.

Code: Select all

on oben#temp do
  publish,some/topic/you/need/to/set/yourself,[oben#temp.avg]
endon
If you just need to take the average over something like 5 samples, then use [oben#temp.avg5]

Just make sure to either disable sending to the controller from that task as you're now sending via the rules, or send to a different topic to be able to compare the effect of filtering.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#43 Post by hotspot_2 » 20 May 2023, 21:13

Hello,

i just connected the second ESP to my built in NTCs but the value which are measured her differ quite a lot. The temperature is the same at the moment (about 67 degrees) but the ESP1 is measuring a current of 992 and the ESP2 is measuring 1024.

As i copied the values (8) from ESP1 to ESP2 the temperature doesn't fit at all. Is this possible and how can i fix this? Always doing the measurements with water (20,30,40,50....) for each ESP?

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#44 Post by hotspot_2 » 20 May 2023, 21:55

TD-er wrote: 20 May 2023, 11:04 Placing the capacitor "on" the ESP is exactly what I meant, as close to the ESP as possible :)

Yep, with 'oversampling', the analog pin will be read quite often and being averaged.
Also the max. and min. value seen in that period will be left out to filter out 'spikes'.


As linked by Ton: https://espeasy.readthedocs.io/en/lates ... statistics

When you enable 'stats' for a task value, you can use some additional 'features' of task values.

For example your task is called "oben" and the taskvalue is called "temp" (your names are way too long to be practical as it would end up like "temperature_pufferspeicher_oben#temperature_pufferspeicher_oben")

Right now, you send directly to the MQTT controller, but to use the average, you need to act on the new values via rules.

So let's assume your task/taskvalue are as I suggested: oben#temp
And the topic you're publishing to is something you need to change in the rules for yourself.

Code: Select all

on oben#temp do
  publish,some/topic/you/need/to/set/yourself,[oben#temp.avg]
endon
If you just need to take the average over something like 5 samples, then use [oben#temp.avg5]

Just make sure to either disable sending to the controller from that task as you're now sending via the rules, or send to a different topic to be able to compare the effect of filtering.
Thanks! Works so far as i get the values as topics in my mqtt server. But the value is (null) right now. Hopefully it would change when 5 measurements came up ;-).

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#45 Post by TD-er » 20 May 2023, 22:44

hotspot_2 wrote: 20 May 2023, 21:13 Hello,

i just connected the second ESP to my built in NTCs but the value which are measured her differ quite a lot. The temperature is the same at the moment (about 67 degrees) but the ESP1 is measuring a current of 992 and the ESP2 is measuring 1024.

As i copied the values (8) from ESP1 to ESP2 the temperature doesn't fit at all. Is this possible and how can i fix this? Always doing the measurements with water (20,30,40,50....) for each ESP?
Yep, each device has components which each have their tolerances.
Also when you're so close to the end of the measurement range, it is very easy to get 'clipping' values.

It is best to change some values of the resistors so you end up a bit more in the middle of the measurement range.

Each setup needs its own calibration.
That's why I made the ADC plugin such that you can first try to get the ADC to voltage calibrated and then you can basically use the same conversion table as for others.
But first you need to get a bit more in the middle of the measurement range.

bidrohini
Normal user
Posts: 54
Joined: 03 Nov 2022, 16:24

Re: ESP Easy and an NTC - Possible?

#46 Post by bidrohini » 21 May 2023, 07:55

The ntc platform is a helper sensor that allows you to convert resistance readings from a NTC thermistor to temperature readings.

First, you need to get resistance readings from the sensor - you can set this up with the resistance and adc sensors.This platform will then convert the resistance values to temperature readings. It also requires calibration parameters for this conversion. There are two ways of obtaining these values: By looking at the datasheet or manual calculation.

If you have the datasheet of the thermistor, you can look at its “B-constant” and reference temperature/resistance.

https://esphome.io/components/sensor/ntc.html

By the way, you can also make a thermostat with thermistor NTC. You can use it for air conditioning, central heating, coolers, laboratory, greenhouses, aquariums, ventilation.

https://www.pcbway.com/project/sharepro ... r_NTC.html

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#47 Post by hotspot_2 » 21 May 2023, 07:58

First: I now calculated the values for the second ESP. I added a value x to all current values (the same) so that the temperatures fit. The scaling is the same as in ESP1. It seems to work with a constant temperature at the moment. Is this a way to do the calibration? The behaviour of the NTC should be the same, shouldn't it?

Second: The calculation of the average value (5) doesn't work right now.
lcit_4.jpg
lcit_4.jpg (35.93 KiB) Viewed 6944 times
This is my rule:

Code: Select all

on temp_puffer#mitte do
  publish,ESPs/ESP_FFHomeNet_6/temp_puffer/mitte_avg,[temp_puffer#mitte.avg5]
endon
Third: It seems that at the second ESP the current stays constant 1024 and doesn't change at all. 1024 ist the maximum range, isn't it? So will have to check the board or the ESP is not working.

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#48 Post by TD-er » 21 May 2023, 11:58

Some boards differ in the resistors being added to the A0 pin.
The A0 pin on ESP8266 can only measure upto 1V.
So to make it capable of handling upto 3.3V, you need 2 resistors.
For example:
GND ---- 100k --- A0 --- 270k --- Analog Voltage.

This allows the ESP to measure upto 3.7V while not exceeding the 1V limit on the A0 pin of the ESP8266 chip itself.

However it is not guaranteed those resistors are present, nor their exact value.

hotspot_2
Normal user
Posts: 26
Joined: 09 Dec 2022, 21:43

Re: ESP Easy and an NTC - Possible?

#49 Post by hotspot_2 » 21 May 2023, 16:31

hotspot_2 wrote: 21 May 2023, 07:58 First: I now calculated the values for the second ESP. I added a value x to all current values (the same) so that the temperatures fit. The scaling is the same as in ESP1. It seems to work with a constant temperature at the moment. Is this a way to do the calibration? The behaviour of the NTC should be the same, shouldn't it?

Second: The calculation of the average value (5) doesn't work right now.

lcit_4.jpg

This is my rule:

Code: Select all

on temp_puffer#mitte do
  publish,ESPs/ESP_FFHomeNet_6/temp_puffer/mitte_avg,[temp_puffer#mitte.avg5]
endon
Third: It seems that at the second ESP the current stays constant 1024 and doesn't change at all. 1024 ist the maximum range, isn't it? So will have to check the board or the ESP is not working.
Problem one an three are solved right now. I had an open circuit on my second board, closing it solved the problem. Only minimal difference now in the values for the voltage and the temperature and everything is fine with ESP 2 right now. ESP 1 and ESP 2 working as expected at the moment ;-).

Now i only need some help withe the average thing! This doesn't work with my rule, the value remains at (null).

Thanks a lot in advance for your help.

TD-er
Core team member
Posts: 8106
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: ESP Easy and an NTC - Possible?

#50 Post by TD-er » 21 May 2023, 22:24

Do you have the "stats" checkbox enabled for that task value? (thus the checkbox between the formula field and the nr of decimals)

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests