mega-20190630, DS18b20: Wrong temp

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

mega-20190630, DS18b20: Wrong temp

#1 Post by M*I*B » 08 Nov 2019, 18:12

Hi there,

I have reactivate an older SONOFF S20 with an DS18b20 on GPIO1. The Plug is used outside and at the moment we have arround 6°C. But the Software like to tell me I can go out in T-shirt: Shows 16,4°C :?: :?: :?:
Ok, maybe broken. Replaced with a brandnew DS18b20 ... Same ... Another brand new? ... nope! Hu????

Any idea what's going on here?
DLzG
Micha

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: mega-20190630, DS18b20: Wrong temp

#2 Post by ThomasB » 08 Nov 2019, 19:33

Any chance your sensor is physically close to the Sonoff?
My story: I was getting elevated temperatures on my Sonoffs with DS18b20 sensors. Sonoffs run warm and my sensors were too close. I solved this by moving the DS18b20 several inches from the Sonoff.

Is the sensor and Sonoff sharing space in the same protective enclosure?
If they are in the same enclosure then the sensor will need to be relocated.

- Thomas

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#3 Post by M*I*B » 08 Nov 2019, 19:49

... nope ... The Sensor is outside the enclosure and plugable on the bottom of the S20. The S20 is still outside without load placed on a small table.

Meanwhile we have arround 6°C outside (four sensors on each side of our house under the roof overhang), the DS see it as 16.25°C...
hmmm... Can it be that the 1st digit is wrong? 6.25°C can match it... Just an upcomming idea...
DLzG
Micha

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: mega-20190630, DS18b20: Wrong temp

#4 Post by ThomasB » 08 Nov 2019, 20:06

Interesting. I grabbed my IR gun and checked a Sonoff Basic that has a DS18B20. Being in North America I use the formula option (%value%*9/5+32) to convert to F. The reported temperature matches my IR measurement.

Maybe there's a formula corruption in your plugin. As a test, if your DS18b20 device formula option entry is empty, then enter %value% in it.

Lastly, clear the flash and update to the latest firmware.
The Sensor is outside the enclosure and plugable on the bottom of the S20. The S20 is still outside without load placed on a small table.
FWIW, my Sonoffs do not have a AC load either. They are just used as remote sensors. The Sonoff's plastic case gets warm even when running idle without a load. The short wire leads to the sensor were conducting this heat. Solved by remotely mounting the sensor with a few inches of wire.

- Thomas

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

Re: mega-20190630, DS18b20: Wrong temp

#5 Post by TD-er » 08 Nov 2019, 20:31

GPIO1 is connected to the TX of the ESP serial.
Are you sure the serial port has been disabled in Tools => Advanced?
See also this table: https://espeasy.readthedocs.io/en/lates ... on-esp8266

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#6 Post by M*I*B » 08 Nov 2019, 22:56

... sorry for late response ... Fridays are shooting club time... And before christmas time to shoot an half Pork... :mrgreen:

ThomasB:
Formular- field are empty. Also insert %value% don't change anything

TD-er:
Jupp, that's deactivated

Thing is, that I have used this plug former inside and I remember that all temp- data are plausible.
I just take a look at the real outside- temp. It's now arround 5.6°C. But the S20m show me 12.13°C. Looks like my digit-idea was wrong...

Tomorrow I will try to update the newest version and then let's see what's happend
DLzG
Micha

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

Re: mega-20190630, DS18b20: Wrong temp

#7 Post by TD-er » 09 Nov 2019, 01:06

Maybe also for testing, try to run an older version also.
Maybe some version of 2 months ago, give or take.

The one I run in my weather station is from 24th September (self built), so maybe take a nightly build from the next build after the 24th.

Just to make sure any recent changes in the Dallas plugin does not cause these issues.

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#8 Post by M*I*B » 09 Nov 2019, 17:54

... ok, any is wrong ...

I have try different versions with the exact same result. Now I have flash the newest version to two S20 and set one to use GPIO1 and the other one to use GPIO3 for 1W-Data. And now we have a difference between both!

Both don't show the correct temp but both on GPIO1 show similar. Now the one on GPIO3 shows arround 6 Kelvin less but 8 Kelvin to much (real on this place are 6°C). It makes no difference if I swap the sensors over cross; same result
.
.
capture_001_09112019_174634.jpg
capture_001_09112019_174634.jpg (308.46 KiB) Viewed 15228 times
.
.
I'm shure there must be a bug that only comes up if the real temp goes under a unknown level. At roomtemp maybe it's going well but this thing is not useable outside to control some about the real outside temp ...


BTW: It isn't possible to set the resolution of the sensor to 9 or 10 bit. Only 11 or 12 are possible. This is occure since I know and work with ESPeasy ...
DLzG
Micha

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

Re: mega-20190630, DS18b20: Wrong temp

#9 Post by TD-er » 09 Nov 2019, 18:02

BTW: It isn't possible to set the resolution of the sensor to 9 or 10 bit. Only 11 or 12 are possible. This is occure since I know and work with ESPeasy ...
It is possible, the settings will be stored in the sensor itself.

But recently we have had quite some discussions about the Dallas sensors and it appears a lot of these issues are caused by using not original Dallas sensors.

About the lower temperature, I will place one outside and check.

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#10 Post by M*I*B » 10 Nov 2019, 11:53

... just temp showing in the morning today.

Real outside temp on this place: +3,3°C

GPIO 1 : +18,62°C
GPIO 3 : +12,50°C

Swap DS18B20 over cross

GPIO 1 : +19,25°C
GPIO 3 : +13,00°C

(maybe a little more while touching)
DLzG
Micha

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: mega-20190630, DS18b20: Wrong temp

#11 Post by ThomasB » 11 Nov 2019, 02:10

This is quite the mystery.

Try this:
1. Unplug the Sonoff device and leave it outside near the AC outlet. Your trusted reference thermometer should remain next to it.
2. Wait one hour, then plug-in the Sonoff device to the outlet.
3. Immediately after the device connects to Wifi observe the DS18b20 temperature. Compare it to the reference thermometer.

Is the "cold boot" power-up temperature accurate?
Watch it for a couple hours. Does it slowly get worse as the device continues to run?

- Thomas

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#12 Post by M*I*B » 11 Nov 2019, 16:38

... just start that...

Real 4,9

6,12
9,38

... and fast rising !!!

You have the right idea! It looks like the sensor is picking up too much energy and heating itself up.

Since the sensor is located outside the housing, only the current consumption of the sensor itself can be the cause. The power supply is eliminated because the sensors tolerate up to 5V and are only operated at 3.3V. So only the "outgoing" current remains over the data line.
Suppose, that's the case, then the GPIO's are too low resp. there is still some internal or external resistance that causes these problems.
DLzG
Micha

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: mega-20190630, DS18b20: Wrong temp

#13 Post by ThomasB » 11 Nov 2019, 17:05

Since the sensor is located outside the housing, only the current consumption of the sensor itself can be the cause.
Being outside of the housing does not stop the temperature rise from the Sonoff. Heat is also conducted from the warm PCB to the wire leads on the DS18b20. That is one of the reasons why I recommend using long wire leads.

Here is a photo of one of my Sonoffs that is installed in the attic. It shows the DS18b20 at the end of 3-inch long 26AWG wire leads. The long thin wire provides conducted heat isolation from the PCB. It also moves the chip away from the warm plastic housing. Your installation should do this too.
ds18b20 installed on 3-inch wire leads.
ds18b20 installed on 3-inch wire leads.
ds18b20.jpg (149.4 KiB) Viewed 15140 times

Please post a photo of the DS18b20's installation on your existing Sonoff. It will be interesting to see how you have it connected.

- Thomas

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

Re: mega-20190630, DS18b20: Wrong temp

#14 Post by TD-er » 11 Nov 2019, 20:56

Are you able to measure the current consumption of the sensor?

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#15 Post by M*I*B » 11 Nov 2019, 21:32

... yapp, I will messure the current, take pictures a.s.o. but ... tomorrow... :roll:
DLzG
Micha

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#16 Post by M*I*B » 14 Nov 2019, 11:25

... ok, somtimes things take a little longer :roll:

I have messured the current. That's ok arround 0,9mA, also the current of the dataline is arround 550µA peek (messured with a scope). All inside specs...

Now one of the S20 I have solder a tube-sensor with a long cable...

You are all right! The problem is realy the heat out from the S20 over the copper... Unbeliveable... :roll: :roll: :roll: I haven't noticed that before in an roomtemp ambiente. Now the temp match the real one...
But now I have a long cable on it. Not the solution I have in my brain. I have to think hard again how to do it so that the sensor can remain on the device (see pictures).
Attachments
SoNOFF S20, 02.jpg
SoNOFF S20, 02.jpg (488.65 KiB) Viewed 14932 times
SONOFF S20, 01.jpg
SONOFF S20, 01.jpg (830.33 KiB) Viewed 14932 times
s-l1600.jpg
s-l1600.jpg (60.73 KiB) Viewed 14932 times
DLzG
Micha

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

Re: mega-20190630, DS18b20: Wrong temp

#17 Post by TD-er » 14 Nov 2019, 11:36

Well it is quite hard to get a proper reading of temperature (and thus also humidity) from inside a confined enclosure where also quite some heat is generated.
The ESP itself does take about 50-70 mA on average when not in "eco mode", which is > 200 mWatt.
If you're using an sub-optimal power supply, then that one will add some more heat. (very likely it is >50% efficient, so upto another 200 mWatt)
That's quite a lot of heat in a small non ventilated space.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: mega-20190630, DS18b20: Wrong temp

#18 Post by ThomasB » 14 Nov 2019, 17:13

Good to hear you found the problem.

- Thomas

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#19 Post by M*I*B » 15 Nov 2019, 09:50

... jepp ... Would only be nice if a found problem would immediately provide the solution :roll: 8-)
DLzG
Micha

Drum
Normal user
Posts: 300
Joined: 07 Feb 2016, 11:56

Re: mega-20190630, DS18b20: Wrong temp

#20 Post by Drum » 15 Nov 2019, 17:07

One other thing to check, I have several of those DS18b20 on a long cable with stainless steel tip and the specs say they have a 4.7k resister between power and data. I may not be reading the data sheet for the DS18B20 correctly but I think it is required, but I could be wrong, I have never used the bare chips.

And, after looking at the picture again, it looks like you have a resister there.... :oops:

User avatar
M*I*B
Normal user
Posts: 319
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: mega-20190630, DS18b20: Wrong temp

#21 Post by M*I*B » 15 Nov 2019, 18:26

... jes, I have a R there ;o)
I have test many different ones before I use WeMOS, ESPEasy and similar... Datasheet say 4k7 but if you only have one sensor on the bus and also not so long cables (I talk about 10m or more) you can also use 5k6, 10k, 15k... If you have a scope just connect it to the dataline and raise the R... arround 20k or more you will see that the square wave data signal goes ugly. That's the point some GPIO's can't read the signal. It hangs on the GPIO-IN resistance and capacity...
Normaly you can take any between 1k and 18k and you will not see any problems... Just what you can find in your blackbox :D
DLzG
Micha

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: mega-20190630, DS18b20: Wrong temp

#22 Post by ThomasB » 15 Nov 2019, 19:40

Would only be nice if a found problem would immediately provide the solution
Sure, but instant gratification is a lazy human expectation. You're a DiY hacker, so no need for that nonsense.

It's not clear to me what the remaining issue is; I suppose you don't like using a couple inches of wire? If you describe the issue (and what you prefer) I suspect some good ideas could be exchanged.

- Thomas

Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests