Adding external temperature sensors

The Gateway has an additional connector for connecting external temperature sensors.

Supported sensors

Sensors supported are of the Dallas types:

  • DS1822

  • DS18S20

  • DS18B20

  • DS1825

Multiple sensors can be connected to the connector at the same time and they can be run in either normal or parasitic mode. You can connect several sensors (of the same type only) in parallel. EMS-ESP has no real upper limit for the amount of sensors you can connect simultaneously. Some users are reporting using 10 or more sensors.

Connecting sensors

On the right side of the Gateway you can find a 3-pin JST connector. If you purchased a complete kit a JST cable is included. If you have lost or broke it you can contact me or get a cable yourself. They are very cheap on f.i. AliExpress. You need a three-wire JST ZH (1.50mm) cable for the Gateway S32 and E32 or a three-wire JST ZH (2.50mm) cable for all older ESP8266 Gateways like the Premium (II).

The colors on the cable match the colors on generic waterproof three wire BS18B20 sensors, except for the oldest Gateway model with a round (or no hole) hole in front of the connector. These have a different pinout. See below.

Gateway type

Yellow (left pin)

Black (middle pin)

Red (right pin)

All except 1st ESP8266 edition

Data

GND

3V3

1st edition

GND

Data

3V3

Gateway S32 and E32

The Gateway S32 and the E32 have a small JST ZH connector. The colors on the cable match the colors on the Dallas sensor wires.

JST ZH connector

First unplug the Gateway from bus and power.

Connect the sensors to the cable and insert it into the Gateway. It will only fit in one orientation.

JST ZH connector orientation

When you insert the cable, press it fully inwards with a pen or screwdriver.

JST ZH connector 2

The cable is not designed for a lot of unplugging, so be careful.

After you have connected the sensor(s), connect power and bus to the Gateway and go to the web interface. See below.

Gateway Premium, Premium II, Standard and Regular

First unplug the Gateway from bus and power. Connect the sensors to the cable and insert it into the Gateway. It will only fit in one orientation.

JST XH connector

After you have connected the sensor(s), connect power and bus to the Gateway and go to the web interface. See below.

Gateway 1st edition (round holes)

First unplug the Gateway from bus and power. Connect the sensors to the cable and insert it into the Gateway. It will only fit in one orientation. After you have connected the sensor(s), connect power and bus to the Gateway and go to the web interface.

The oldest Gateways have a different pinout. See below.

JST connector pinout older Gateways

JST connector

The oldest Gateways have a different pinout. Gateways delivered after July 2019 are all version >V1.0.

Gateways < V1.0: When seen from the front the left pin is GND, the middle pin goes to D5 of the Wemos and the right pin is 3V3. Gateways > V1.0: When seen from the front the left pin is D5, the middle pin goes to GND of the Wemos and the right pin is 3V3.

Gateway type

Yellow (left pin)

Black (middle pin)

Red (right pin)

All except 1st edition

Data (D5)

GND

3V3

1st edition

GND

Data (D5)

3V3

A 4k7 pull up resistor between 3V3 and D5 is already on the board. For Gateways < V1.0: If you use the supplied JST cable, please be advised the 3 wires do not color match general waterproof DS18B20 sensor wires!

Sensor pull up resistor

To connect a DS18B20 sensor, there is a 4k7 resistor between data and 3V3. For most cases this pull-up on the board is sufficient. However, if you connect too many sensors or the wires are very long, the pull-up resistor value will be to high. You need to add a through hole resistor on position R20 (also below the Wemos). This optional through hole resistor is routed in parallel to the 4k7 resistor. Recommended in that case is to use a 4k7 resistor, so the final resistor value will be 2k3.

If you don’t have the equipment or skills to solder the resistor, you can also insert the resistor in a screw connector so it directly attaches to the yelow and red wires outside of the Gateway. You can solder one or more DS18B20 sensors to the JST cable or use f.i. a screw terminal.

Please be advised (waterproof) DS18B20 sensors from AliExpress etc are often fake and can have an offset of sometimes 2 degrees Celcius. You can trim the sensor by adding a temperature offset via the web interface of the Gateway.

Resistor location Gateway S32

Remove the NodeMCU board. R19 is the 4,7K SMD resistor. You can add a THT (leaded) resistor on R20. This one will be in parallel with R19.

S32 DS18B20 resistor location

Resistor location Gateway E32

R19 is located on the outside of the board and it is a 4,7K SMD resistor. You can add a THT (leaded) resistor on R20. This one will be in parallel with R19.

E32 DS18B20 resistor location

Resistor location older Gateways

Remove the Wemos board. R19 is the 4,7K SMD resistor. You can add a THT (leaded) resistor on R20. This one will be in parallel with R19.

Gateway DS18B20 resistor location

Gateway configuration

After adding the sensors, reboot the Gateway and go to the Devices and Sensors tab of the web interface.

Sensors on dashboard tab

You should now see new devices in ‘Sensors’. If you can’t see new Sensors, then the Gateway has not detected the sensors. Check the wiring. If wired correctly, you should see an entry for each sensor.

To find out which sensor is which, hold it in your hand or heat it up otherwise individually to see in the dashboard which of the sensors is heating up. In the latest firmware versions it’s possible to give each sensor a name of your choice. If needed you can add a temperature offset for a particular sensor.

You can always add more sensors later, EMS-ESP remembers whcih sensor is which.