Soracom LTE-M Button
Measuring Temperature using a Temperature Sensor
Tip: There is a small recess inside the Soracom LTE-M Button for storing the accessory port cover so that you don't lose it.
The Temperature Sensor external I/O mode allows you to connect a DS18B20 temperature sensor in order to read the current temperature when a button is clicked, or automatically at regular intervals.
When the operation mode is configured as Event, Event + Timer, or Event + Heartbeat, the button will read the value of the temperature sensor each time the button is pressed (Single short click, Double short click, or Single long click) and send a corresponding Event with Temperature message.
Additionally, when the operation mode is configured as Timer or Event + Timer, the button will automatically read the value of the temperature sensor at regular intervals and send a Timer message containing the temperature measurements.
Alert and Alert + Heartbeat modes do not support using a temperature sensor.
Important! The Soracom LTE-M Button provides its own voltage to power and communicate with an attached DS18B20 sensor. When building your own circuit, ensure that the sensor is wired according to the Pin Assignment section below.
Connecting the DS18B20 sensor to an external power source may result in communication errors or damage.
Additionally, ensure that the DS18B20 sensor is not wired for "parasitic power" mode.
Behavior
When configured for Temperature Sensor, each time the Soracom LTE-M Button takes a temperature measurement, it will apply a voltage to the external I/O in order to power and communicate with the attached DS18B20 sensor. Once it receives the measurement from the sensor, the value is sent using the Event with Temperature message and/or Timer message, depending on the configured operation mode.
If the button is unable to communicate with the attached DS18B20 sensor, it will send an Event message instead of an Event with Temperature message, and the temperature measurements in Timer messages will be 0
.
Measurement
The Soracom LTE-M Button will read the temperature measurement from an attached DS18B20 sensor using its maximum 12-bit resolution. When sending the temperature measurement, this value is rounded to the nearest 0.01 degrees (°C).
Note that although the button will report the temperature value with a precision of 0.01°C, the accuracy of the DS18B20 sensor is generally limited to ±0.5°C when measuring temperatures between -10°C and +85°C, with additionally loss in accuracy outside of that range.
Timer message
When the operation mode is configured as Timer or Event + Timer, the button will send Timer messages at regular intervals according to the configured Uplink frequency.
To provide additional granularity, each Timer message is subdivided into 5 summaries, with the duration of each summary equal to 1/5th the duration of the Uplink frequency.
The button will measure the temperature sensor at the end of each summary, and then report all five measurements in the Timer message, each labeled with a number from 1–5.
For more information on the Timer message, refer to the Timer Mode documentation.
Configuration
Temperature Sensor can be enabled in Event, Timer, Event + Timer, and Event + Heartbeat operation modes.
-
Follow the Configuration instructions for configuring Soracom LTE-M Button settings.
-
When prompted, select Temperature Sensor for the external I/O mode:
After configuring Soracom LTE-M Button settings, follow the instructions to sync your button.
Pin Assignment
A DS18B20 temperature sensor should be connected to button using a 3.5mm TRRS plug with the following connections:
Pin | Connection |
---|---|
Tip (T) | VDD |
Ring 1 (R) | — |
Ring 2 (R) | Data I/O (DQ) |
Sleeve (S) | GND |