karansoi
(Karanbir)
June 4, 2020, 12:55pm
1
I have integrated a esp8266 with Esphome with name mystudy.
I have connected a NTC thermistor that is about 8.9K @ 30Deg C. So I assume it is a 10 K thermistor @ 25 Deg C. The thermistor is added in series with a 10 K resistor, with thermistor downstream of the resistor. The Junction of the combine is connected to A0. The top pf resistor is connected to 3.3 V.
The mystudy.yaml file is as below
esphome:
name: mystudy
platform: ESP8266
board: d1
wifi:
ssid: "SSID1-2.4G"
password: "7571908313@"
ap:
ssid: "Mystudy Fallback Hotspot"
password: "8csfgeTMT3UB"
captive_portal:
logger:
api:
ota:
###
switch:
- platform: gpio
id: kitchen_pump
name: "led"
pin:
number: D9
inverted: True
- platform: gpio
id: ntc_vcc
name: "ntc_vcc"
pin:
number: D0
inverted: False
sensor:
- platform: ntc
sensor: resistance_sensor
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 10kOhm
name: NTC Temperature
- platform: resistance
id: resistance_sensor
sensor: source_sensor
configuration: DOWNSTREAM
resistor: 10kOhm
name: Resistance Sensor
- platform: adc
id: source_sensor
pin: A0
The temperaure shown in my dashboard is 70 Deg C where as it should be 29.8 Deg C.
What have I missed.
1 Like
karansoi
(Karanbir)
June 4, 2020, 1:07pm
2
I dont know why hyphen(-) appears as a bullet.
tom_l
June 4, 2020, 1:15pm
3
Because you did not format your pasted code correctly. Read point 11 here then edit your post: How to help us help you - or How to ask a good question
karansoi
(Karanbir)
June 4, 2020, 1:47pm
4
thanks @tom_l , I edited my first post.
tom_l
June 4, 2020, 1:54pm
5
How did you obtain the b constant of your thermistor?
karansoi
(Karanbir)
June 4, 2020, 2:08pm
6
I had tested this thermistor with Arduino IDE on the Wemos D1 board and with same calibration assumptions i.e RTh =10K and b= 3950,the temperature on the serial monitor was 30.5 Deg C.
karansoi
(Karanbir)
June 5, 2020, 12:53pm
7
I want to add another question that has emerged.
With what voltage the resistor / thermistor divider is to be powered
A. Vcc(5V) or
B. 3.3 V ?
In either case input to A0 will always be < 3.3V but temperature returned is different.
This is intriguing…
tom_l
June 5, 2020, 1:56pm
8
The docs say 3.3V under the self heating mitigation paragraph:
To do this, replace the 3.3V side of the voltage divider
karansoi
(Karanbir)
June 5, 2020, 2:12pm
9
With 3.3V at the top of the 10K and thermistor to ground, what equation is to be used to get reasonably accurate temperature?
tom_l
June 5, 2020, 2:22pm
10
karansoi
(Karanbir)
June 11, 2020, 5:09pm
11
Got correct valu of temperature from my NTC sensor. Read in an article at Randomnerd tutorials that the adc is divided by 3 on board the esp8266 dev boards. I am using a Wemos D1R1 board . Used a filter under adc for multiplication by 3.
Now temperature matches another gauge that I have.
karansoi
(Karanbir)
June 12, 2020, 7:39am
13
Thanks@tom_l.
Now I think I will need to add a offset to the filter. Would that be a correct approach?
karansoi
(Karanbir)
June 12, 2020, 7:57am
14
This is my yaml file that is uploaded to esp8266 Wemos DR1
esphome:
name: playground
platform: ESP8266
board: d1
wifi:
ssid: "soinsmesh"
password: "3!Syerhacc3!KS"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Playground Fallback Hotspot"
password: "PY8h1v2eIIyg"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
switch:
- platform: gpio
id: builtIn_led
name: "Built In Led"
pin:
number: D9
inverted: True
#######
sensor:
- platform: ntc
sensor: resistance_sensor
name: NTC Temperature B Constant
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 9.9kOhm
- platform: resistance
id: resistance_sensor
sensor: source_sensor
configuration: DOWNSTREAM
resistor: 9.830kOhm
reference_voltage: 3.3V
name: Resistance Sensor
- platform: adc
id: source_sensor
filters:
- offset: -0.042
- multiply: 3.3
pin: A0
update_interval: 60s
The temperature displayed by this sensor is always same as in another temp device that I have.
2 Likes
laca75tn
(My Home)
January 8, 2021, 7:44pm
15
How is this rig working for you? I plant to use something similar for my grill, for the meat temperature.
laca75tn
(My Home)
January 8, 2021, 8:42pm
16
Would you please give me a hand on this? This is my code:
sensor:
- platform: ntc
sensor: resistance_sensor
name: NTC Temperature B Constant
calibration:
b_constant: 3950
reference_temperature: 25°C
reference_resistance: 100kOhm
- platform: resistance
id: resistance_sensor
sensor: source_sensor
configuration: DOWNSTREAM
resistor: 1kOhm
reference_voltage: 5V
name: Resistance Sensor
- platform: adc
id: source_sensor
name: ADC Value
filters:
- offset: -0.042
- multiply: 3.3
pin: A0
update_interval: 5s
These are my results.
Any ideas why the NTC Temp B Constant shows ‘unknown’? Could you please post a picture or diagram of your rig? Thanks!
dadav
June 5, 2021, 9:28am
17
Thanks for this snippet! The filter makes it working for me
karansoi
(Karanbir)
June 5, 2021, 10:05am
18
@laca75tn Under the platform resistance
resistor: 1 K0hm
This must be the same as mentioned under the calibration which is 100K0hm
Check this out
Cheers
karansoi
(Karanbir)
June 6, 2021, 5:19am
19
@laca75tn Under the platform resistance
resistor: 1 K0hm
This must be the same as mentioned under the calibration which is 100K0hm
Check this out
Cheers
1 Like
karansoi
(Karanbir)
August 26, 2021, 6:39pm
20
@laca75tn Please excuse me and disregard my prev relies to your post.
The NTC thermistor is connected with a resistor thus making it a potential divider. Since a meat thermistor is 100K you can use 100K resistor. This point is connected to adc of esp8266.
Which resistor have you used?
BTW pl excuse, I have been busy with other things not been on this forum.
Regards
Karanbir
2 Likes