SetOption74 and DS18B20

1,811 views
Skip to first unread message

mysch...@gmail.com

unread,
Nov 10, 2020, 8:46:07 AM11/10/20
to TasmotaUsers
I have a sonoff basic and connected a DS18B20 without external pull-up to pin 14 and set SetOption74 to 1 . (Sonoff Basic Module)
I had expected that to see the a temparture reading as I would have with other Sonoff  basic that I have made with an external pull-up.
Do I expect the wrong thing?
THNKS

Erix

unread,
Nov 10, 2020, 11:04:23 AM11/10/20
to TasmotaUsers, erix molinie
Hi,
you did not say which Tasmota binary you did flash on your Sonoff Basic.
Is it the tasmota-sensor.bin ?
can you share a screen copy of the gpios ?
Thanks in advance


--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/33fc3737-153c-4de1-8672-4e127af94b32n%40googlegroups.com.

mysch...@gmail.com

unread,
Nov 10, 2020, 12:21:07 PM11/10/20
to TasmotaUsers
sometime one forgets the obvious :)
It is the ordinary tasmota.bin version 8.5.0 (should support a single DS18b20)

Sonoff Basic Module
tasmota92
Program Version    8.5.0(tasmota)
Build Date & Time    2020-09-09T11:41:02
Core/SDK Version    2_7_4_1/2.2.2-dev(38a443e)
Uptime            0T00:00:43
Flash write Count    784 at 0xF4000
Boot Count        21
Restart Reason        Power On
Friendly Name 1    tasmota92
    
AP1 SSId (RSSI)    indebuurt (64%, -68 dBm)
Hostname        tasmota92
MAC Address        5C:CF:7F:AF:88:E1
IP Address (wifi)    192.168.178.92
    
Gateway        192.168.178.1
Subnet Mask        255.255.255.0
DNS Server        192.168.178.60
    
MQTT Host        MQTT
MQTT Port        1883
MQTT User        tasmota
MQTT Client        DVES_AF88E1
MQTT Topic        tasmota92
MQTT Group Topic 1    tasmotas/cmnd/
MQTT Full Topic    tasmota92/cmnd/
MQTT Fallback Topic    cmnd/DVES_AF88E1_fb/
MQTT No Retain        Disabled
    
Emulation        None
mDNS Discovery        Disabled
    
ESP Chip Id        11503841
Flash Chip Id        0x1440E0
Flash Size        1024kB
Program Flash Size    1024kB
Program Size        595kB
Free Program Space    408kB
Free Memory        25kB

Tasmota 8.5.0 by Theo Arends


Screenshot from 2020-11-10 18-16-48.png

Philip Knowles

unread,
Nov 10, 2020, 12:42:30 PM11/10/20
to mysch...@gmail.com, TasmotaUsers

Bear in mind that hardware may get in the way of firmware sometimes and not allow you to turn on the internal resistor.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

 

On Tuesday, November 10, 2020 at 5:04:23 PM UTC+1 eri...@gmail.com wrote:

Hi,

you did not say which Tasmota binary you did flash on your Sonoff Basic.

Is it the tasmota-sensor.bin ?

can you share a screen copy of the gpios ?

Thanks in advance

 

 

Le mar. 10 nov. 2020 à 14:46, mysch...@gmail.com <mysch...@gmail.com> a écrit :

I have a sonoff basic and connected a DS18B20 without external pull-up to pin 14 and set SetOption74 to 1 . (Sonoff Basic Module)

I had expected that to see the a temparture reading as I would have with other Sonoff  basic that I have made with an external pull-up.
Do I expect the wrong thing?

THNKS

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/33fc3737-153c-4de1-8672-4e127af94b32n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

mysch...@gmail.com

unread,
Nov 10, 2020, 12:48:13 PM11/10/20
to TasmotaUsers
Yes. But it is a Sonoff Basic , one of , if not the most archaic tasmota devices.

Philip Knowles

unread,
Nov 10, 2020, 12:59:52 PM11/10/20
to mysch...@gmail.com, TasmotaUsers

That doesn’t mean it will let you turn on the internal resistor. Personally, I’d just use an external resistor.

 

 

On Tuesday, November 10, 2020 at 5:04:23 PM UTC+1 eri...@gmail.com wrote:

Hi,

you did not say which Tasmota binary you did flash on your Sonoff Basic.

Is it the tasmota-sensor.bin ?

can you share a screen copy of the gpios ?

Thanks in advance

 

 

Le mar. 10 nov. 2020 à 14:46, mysch...@gmail.com <mysch...@gmail.com> a écrit :

I have a sonoff basic and connected a DS18B20 without external pull-up to pin 14 and set SetOption74 to 1 . (Sonoff Basic Module)

I had expected that to see the a temparture reading as I would have with other Sonoff  basic that I have made with an external pull-up.
Do I expect the wrong thing?

THNKS

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/33fc3737-153c-4de1-8672-4e127af94b32n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

mysch...@gmail.com

unread,
Nov 10, 2020, 1:12:36 PM11/10/20
to TasmotaUsers
Well, from the tasmota documentation:


SetOption74

Enable internal pullup for single DS18x20 sensor
0 = disabled (default)
1 = internal pullup enabled

If it does not mean what I think it means, then what does it mean?
I did tell the device to use the module Sonoff Basic (1)  and that the DS18b20 (4) is hooked up to GPIO14 .
Therefore I assume that GPIO14 is internally pulled-up as the SetOption74 is dedicated for such a Dallas device. And that is maybe where my thinking may be wrong.
But that is why I pose the question her in front off more wise people.  :)

sfromis

unread,
Nov 10, 2020, 1:29:35 PM11/10/20
to TasmotaUsers
Do you have it connected with full wiring, or parasite power? Not sure that the latter would work with internal pullup.

Philip Knowles

unread,
Nov 10, 2020, 1:38:31 PM11/10/20
to sfromis, TasmotaUsers

The pull up is very weak and may not work with long  cable lengths or with electrical noise.

 

Sent from Mail for Windows 10

 

From: sfromis
Sent: 10 November 2020 18:29
To: TasmotaUsers
Subject: Re: SetOption74 and DS18B20

 

Do you have it connected with full wiring, or parasite power? Not sure that the latter would work with internal pullup.

 

--

You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

mysch...@gmail.com

unread,
Nov 10, 2020, 2:25:07 PM11/10/20
to TasmotaUsers
I'm using 3 wire connection with a length of less than  15 cm

Basically , the question is What does Setoption74 do?

Philip Knowles

unread,
Nov 10, 2020, 2:32:58 PM11/10/20
to mysch...@gmail.com, TasmotaUsers

It should turn on the internal pullup resistor for one GPIO which has a DS18B20 connected to it. Not all GPIO have internal pullups and, sometimes, hardware may interfere with that.

 

Sent from Mail for Windows 10

 

From: mysch...@gmail.com
Sent: 10 November 2020 19:25
To: TasmotaUsers
Subject: Re: SetOption74 and DS18B20

 

I'm using 3 wire connection with a length of less than  15 cm

Basically , the question is What does Setoption74 do?

On Tuesday, November 10, 2020 at 7:38:31 PM UTC+1 knowles...@gmail.com wrote:

The pull up is very weak and may not work with long  cable lengths or with electrical noise.

 

Sent from Mail for Windows 10

 

From: sfromis
Sent: 10 November 2020 18:29
To: TasmotaUsers
Subject: Re: SetOption74 and DS18B20

 

Do you have it connected with full wiring, or parasite power? Not sure that the latter would work with internal pullup.

 

--

You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

Justin Adie

unread,
Nov 10, 2020, 2:41:57 PM11/10/20
to mysch...@gmail.com, TasmotaUsers
Gpio14 does have a pull-up.  But a weak one (30-100k iirc).

If you attach an external pull-up in the 3.3-4.7k range do you see results? 

sfromis

unread,
Nov 10, 2020, 2:55:34 PM11/10/20
to TasmotaUsers
On a D1 Mini, I'm having a DS18B20 working on gpio14 with SetOption74 internal pullup, 3-wire about 70 cm.

mysch...@gmail.com

unread,
Nov 10, 2020, 5:26:26 PM11/10/20
to TasmotaUsers
So it should be able to make it work.
I have another sonoff basic and probably another wemos laying around as well as multiple DS1820.
So I'll give it another try.

mysch...@gmail.com

unread,
Nov 11, 2020, 4:55:30 AM11/11/20
to TasmotaUsers
I figured it out. The DS18b20 was dead.

Phil Gilbert

unread,
Nov 14, 2020, 11:37:10 AM11/14/20
to TasmotaUsers
I'm trying to get a DS18B20 to work with a Sonoff Mini running Tasmota 8.5.1.  without any success at all.
Would you be able to share your wiring or comment on mine as below?
I have set GPIO4 to DS18x20 in module configuration but I don't really understand the other console options


Philip Knowles

unread,
Nov 14, 2020, 2:43:32 PM11/14/20
to Phil Gilbert, TasmotaUsers

How have you connected it (+ve, Signal -ev)

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: Phil Gilbert
Sent: 14 November 2020 16:37
To: TasmotaUsers
Subject: Re: SetOption74 and DS18B20

 

I'm trying to get a DS18B20 to work with a Sonoff Mini running Tasmota 8.5.1.  without any success at all.

--

You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

lesterb...@gmail.com

unread,
Nov 14, 2020, 3:13:37 PM11/14/20
to TasmotaUsers
The pull up resistor should be 4K7 (4700 ohms) not 4R7 (4.7 ohms).
Maybe it's a typo but check what resistor you are using with an ohm meter.

Phil Gilbert

unread,
Nov 14, 2020, 3:59:39 PM11/14/20
to TasmotaUsers
My picture didn't come through so referring to the 2.5mm jack plug (which I don't really want to cut off) I've got:
R3 to +3.3v
R2 to GND
R1 not used
Tip to GPIO4
Resistor 4.7k across R3 and Tip
FWIW I've got 3.3v between R3 and R2 and a bit less between Tip and R2.

Phil Gilbert

unread,
Nov 14, 2020, 4:15:44 PM11/14/20
to TasmotaUsers
Thanks. It's a typo. I'm actually using two 10K in parallel which measure 4.8K. 

Phil Gilbert

unread,
Nov 14, 2020, 4:34:17 PM11/14/20
to TasmotaUsers
Is it possible that I should have R3 GND and R2 +3.3V?

Philip Knowles

unread,
Nov 14, 2020, 5:16:07 PM11/14/20
to Phil Gilbert, TasmotaUsers

The wiring looks correct. You can use a 10k resistor on its own. Does anything appear in the webui and/or console?

The device is digital so some voltage between Tip and 0V is about right too. I had an TH16 which I needed to enlarge the hole in the casing as the contact to the jack was iffy if the circuit board got knocked.

Phil Gilbert

unread,
Nov 15, 2020, 8:51:07 AM11/15/20
to TasmotaUsers
Absolutely zilch in the webui. There's no temp sensor in the MQTT showing when I use Setoption19 1 to retrigger autodiscovery. Other than that I don't actually know how to use the console to interrogate individual GPIOs. 
I don't think I've got the pin out on the DS18B20 right. I can't find it anywhere on the web and I really don't want to cut off the jack as I'd ;ike top be able to plug it in and out, but exposing the wiring my be the final resort.

Phil Gilbert

unread,
Nov 15, 2020, 11:47:12 AM11/15/20
to TasmotaUsers
I pulled back the plug sheath on the DS18b20 and confirmed that the wiring is

R3 to +3.3v

R2 to GND

R1 not used

Tip to GPIO4

However the tags on my 2.5 socket which were labelled 2 & 3 did not connect to R2 and R3 so I have corrected that and now and getting the right signals through, but still no joy.

Do I need to change the Module type? Currently Sonoff Basic (1).

Philip Knowles

unread,
Nov 15, 2020, 12:03:22 PM11/15/20
to Phil Gilbert, TasmotaUsers

This is the website I first used for flashing a TH16. It has a annotated image of the PCB which shows the pinout of the jack socket (which looks to be correct for you). If it’s not appearing you’re perhaps using the wrong GPIO

Can you attach a screenshot of your module configuration page?

Phil Gilbert

unread,
Nov 15, 2020, 12:38:20 PM11/15/20
to TasmotaUsers
moduleconfig.png

Philip Knowles

unread,
Nov 15, 2020, 2:27:48 PM11/15/20
to Phil Gilbert, TasmotaUsers

Perhaps try GPIO14 (it probably won’t work but you never know). If not try Generic just in case.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: Phil Gilbert
Sent: 15 November 2020 17:38
To: TasmotaUsers
Subject: Re: SetOption74 and DS18B20

 

To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers..@googlegroups.com.

--

You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.

lesterb...@gmail.com

unread,
Nov 15, 2020, 2:57:58 PM11/15/20
to TasmotaUsers
These plugs are referred to as tip, ring and sleeve or in your case tip, ring, ring and sleeve.
The only time I have seen the sleeve used for +ve is in some power supplies.
99% of the time the sleeve is negative. 
I would connect -ve (GND) to the sleeve and +ve (3.3v) to the first ring.

Philip Knowles

unread,
Nov 15, 2020, 5:30:45 PM11/15/20
to lesterb...@gmail.com, TasmotaUsers

 

image

 

Sent from Mail for Windows 10

 

Phil Gilbert

unread,
Nov 16, 2020, 4:03:22 AM11/16/20
to TasmotaUsers
Thanks. I think I used a picture like that one to work out the DS18b20 pin outs.
However it seems counter intuitive that the Sleeve would be 3.3V as you might want to case mount the female socket
I have now disassembled my sensor jack as below:
The sleeve clearly is 3.3V, the next ring is GND, and the tip is SIG.
I also have continuity through to red, black, yellow and 10k across red/yellow.
Despite my slightly dodgy soldering, I am getting 3.3V between red and black on the jack plug.
DS18b20pinout.png


Phil Gilbert

unread,
Nov 16, 2020, 1:09:21 PM11/16/20
to TasmotaUsers

OK. Having eliminated all the hardware problems, I think this is a firmware issue. 
Release notes for 9.1.0 https://github.com/arendst/Tasmota/blob/v9.1.0/BUILDS.md say that USE_DS18x20 should work with tasmota.bin there are threads that suggest the tasmota-sensors.bin would resolve my problem. Latest release 9.1.0 says the same. All I need to do is to find out how to shoe-horn the tasmota-sensors.bin into my device!
For rev 9.1 the file sizes are: minimal 379k, tasmota.bin = 600k, and sensors = 633k.

Philip Knowles

unread,
Nov 16, 2020, 1:38:44 PM11/16/20
to Phil Gilbert, TasmotaUsers

Sensors.bin is only needed for multiple DS18B20s.  You can upload the gz version now. I’d downgrade to 8.5.1 to see if that works.

 

Regards

 

Phil K

 

Sent from Mail for Windows 10

 

From: Phil Gilbert
Sent: 16 November 2020 18:09
To: TasmotaUsers
Subject: Re: SetOption74 and DS18B20

 

OK. Having eliminated all the hardware problems, I think this is a firmware issue. 

Release notes for 9.1.0 https://github.com/arendst/Tasmota/blob/v9.1.0/BUILDS.md say that USE_DS18x20 should work with tasmota.bin there are threads that suggest the tasmota-sensors.bin would resolve my problem. Latest release 9.1.0 says the same. All I need to do is to find out how to shoe-horn the tasmota-sensors.bin into my device!

For rev 9.1 the file sizes are: minimal 379k, tasmota.bin = 600k, and sensors = 633k.

On Monday, 16 November 2020 at 09:03:22 UTC Phil Gilbert wrote:

Thanks. I think I used a picture like that one to work out the DS18b20 pin outs.

However it seems counter intuitive that the Sleeve would be 3.3V as you might want to case mount the female socket

I have now disassembled my sensor jack as below:

The sleeve clearly is 3.3V, the next ring is GND, and the tip is SIG.

I also have continuity through to red, black, yellow and 10k across red/yellow.

Despite my slightly dodgy soldering, I am getting 3.3V between red and black on the jack plug.

 

Phil Gilbert

unread,
Apr 29, 2021, 4:48:56 AM4/29/21
to TasmotaUsers
I can back to this problem and found a solution.
Instead of of using GPI04, I soldered directly on to GPI02 on the back of the board.
It's working now "out of the tin" using tasmota basic v9.1.
No idea if it was my soldering or a clash with the GPI04 switch but now I can turn my pump on and stop it when the hot water is circulating, Happy Days!
Thanks 
2021-04-28 11.49.48x.jpg

sfromis

unread,
Apr 29, 2021, 5:42:20 AM4/29/21
to TasmotaUsers
GPIO2 already has a pull-up resistor on the board due to strapping requirements for ESP8266 to boot.

Reply all
Reply to author
Forward
0 new messages