EspEasy (8266 adc)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
goblin
New user
Posts: 7
Joined: 07 Mar 2018, 21:02

EspEasy (8266 adc)

#1 Post by goblin » 09 Mar 2024, 20:31

hello all,
i am using a the ADC of Espeasy Esp8266 to measure the temperature (TMP37 20mv/C)
full scale is 1024= 1v which means in my case that i need to divide the ADC value by 19
According helppage i can do this by using %valu%/19 at the bottom of the Devices / task settings / values.

Problem:
sometimes it shows the "Raw" value and sometimes the calculated values.
Therefore Domoticz via MQTT sometimes e.g. 20 (degrees) and sometimes 380.

any idea.
using Binary Filename:⋄ ESP_Easy_mega_20240229_normal_ESP8266_4M1M

thanks/ Dankie

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

Re: EspEasy (8266 adc)

#2 Post by TD-er » 09 Mar 2024, 21:19

You should use this in the formula field:

Code: Select all

%value%/19
(You had a typo in your post)
And how is this sensor connected?
Do you use a long cable?
Have you tried adding some small capacitor close to the ESP over A0 and GND? (100 nF)
Does your board have resistors soldered to the A0 pin? A lot of boards have resistors to scale 3V3 or 3V6 down to 1V to the A0 pin.

goblin
New user
Posts: 7
Joined: 07 Mar 2018, 21:02

Re: EspEasy (8266 adc)

#3 Post by goblin » 10 Mar 2024, 11:58

Thanks, indeed a typo,
the sensor is connected via a buffer opamp directly connected to ESP8266 ADC input.
Voltage are verified with an oscilloscope (Tektronic ) no spike whats so ever.
besides that. if so then you can't have one moment 377 and next moment 19
these two values are pretty close to the formula %value%/19
(the reason why it is not exactly 19 is die the fact that i cannot read the adc value "raw" and divided at the same time)
If the input voltage is "unstable" then there should be more different values then close to divided by 19 and it is always close to 19.

i am pretty sure its not a hardware issue. i have attached the schematic. please shoot at it if something is not correct.

thanks
i will try to add an 100nF at the input but that's not considered as good engineering because the opamp is capable to source/sink a lot of current into/from the capacitor.
Ps
ignore dutch and english text in schematic
Attachments
schematic 2024-03-10 114828.png
schematic 2024-03-10 114828.png (190.28 KiB) Viewed 522 times

goblin
New user
Posts: 7
Joined: 07 Mar 2018, 21:02

Re: EspEasy (8266 adc)

#4 Post by goblin » 10 Mar 2024, 12:04

in addition attached a picture of Domoticz temperature of the central heating radiator. temperature is going from eg 20 degrees to 383.
As you can see a normal cooling down of a radiator if you ignore the scale.
Attachments
chart.jpeg
chart.jpeg (47.42 KiB) Viewed 519 times

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

Re: EspEasy (8266 adc)

#5 Post by TD-er » 10 Mar 2024, 12:55

I meant 100 nF at the analog input of the ESP.
It is just to suppress any noise picked up when using a longer cable.

Took me a while to find the Dutch words in the schematic, but found them :)
I can be blind to those myself as it is my "moerstaal" :)

Do you use "oversampling" on the ADC plugin?
This will also leave out the min and max. value seen during the oversampling period.
The analog input may give some erratic value when WiFi is active.
ESPEasy will try to not take a sample when WiFi is active, but if there is only a single sample taken every N seconds, you might get the fluke value, which would have been filtered out when using oversampling.

I don't understand how you may get any value over ~50 if you're using the formula %value%/19.
Do you have some other calculations set in the ADC plugin?

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

Re: EspEasy (8266 adc)

#6 Post by Ath » 10 Mar 2024, 13:02

In your graph I was expecting to see mostly values around 20 degrees, and a couple of 'spikes' around the 400 mark, but it's more the other way around, mostly around 400, and only a few in the 20-range. Not sure what to think of that yet.
/Ton (PayPal.me)

goblin
New user
Posts: 7
Joined: 07 Mar 2018, 21:02

Re: EspEasy (8266 adc)

#7 Post by goblin » 10 Mar 2024, 17:11

That's what i want to explain.
it is mostly the measured value and not the calculated value. so it cannot be the input voltage and an 100nF won't do anything unless it is at the input of the buffer
must be software but will replace the ESP8266, maybe an micro issue.

Post Reply

Who is online

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