# Temperature Sensor

Syrus can communicate with compatible 1-wire digital thermometers such as the DS18B20. We recommend this one from Diymore (opens new window). The DS18B20 (opens new window) is capable of communicating in two modes, a normal power mode and a parasite mode which derives power from the data line, eliminating the need for an external power supply.

General Overview

  • The way it works is that you connect one or several temperature sensors in normal or parasite mode to Syrus
  • You read the temperatures with the apx-onewire temperature getall command
  • Give your temperature sensors aliases and install them

# Installation

Syrus 4 Datasheet with Pinout (opens new window)

1-wire Wiring Pinout (found in 14-pin molex)

# Parasite mode

Parasite Mode

Temperature Wires Signal Description Syrus Signal Syrus Wires
Yellow DQ Data signal, connect to the Syrus white/red 1-wire cable. Make sure to use the 14-pin molex white/red cable. 1WIRE
Red PWR Connect to the Syrus electrical ground cable in parasite mode GND
Black GND Connect to the Syrus electrical ground cable in parasite mode.

# Configuration

Once you have the temperature sensors connected, you can use the apx-onewire to read temperature

$ sudo apx-onewire temperature get_all
    "temperatures": [
            "alias": "tempsen1",
            "id": "8D01144D07DBAA28",
            "value": 22.625,
            "connected": true,
            "epoch": 1608047806
            "alias": null,
            "id": "3C12345D07DBAB29",
            "value": 22.437,
            "connected": true,
            "epoch": 1608047807

Afterwards you can set an alias and proceed to install on a real life scenario.

# Redis Interaction

To notify changes on a temperature sensor, the onewire application publishes:

onewire/notification/temperature/state onewire_temp_json_object

"PUBLISH" "onewire/notification/temperature/state" "{\"alias\":null,\"id\":\"8D01144D07DBAA28\",\"value\":27.437,\"connected\":true,\"epoch\":1610658389}"

# Tips

The ID of the 1-wire sensors is not printed on the temperature sensor, so you'll have to connect one at a time and use the get_all command to read the values, then assign an alias to each sensor.

Last Updated: 2/9/2021, 4:36:15 PM