Pulse Detection using the 2-Wire Accessory

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 Pulse Detection external I/O mode allows you to connect your own circuit to the Soracom LTE-M Button using the 2-wire accessory in order to electronically trigger messages using external inputs.

In this mode, the button will detect when an external switch is pressed and released, and send a message similar to the message sent when clicking the built-in button.

If you want your circuit to trigger each time its opened or closed state changes, use the Edge Detection mode instead.

You can easily test this by connecting the included 2-wire accessory to the external I/O accessory port, then touching and releasing the two exposed wires, just as you would press and release the built-in button. You should see the LED start blinking green, indicating that the Soracom LTE-M Button has detected the external click and is now connecting to a cellular network.

As an example, you can connect a momentary switch that can be positioned separately from the Soracom LTE-M Button itself. Clicking the switch will send an Event message or an Alert message, with a detect type (Single short click, Double short click, or Single long click) corresponding to the length and number of clicks detected, just as if the built-in button was pressed.

Example using Pulse Detection

Important! The Soracom LTE-M Button provides its own voltage in order to detect whether the circuit is open or closed. The 2-wire accessory must not be connected directly to an external power source. Doing so may permanently damage the button.

There are many other types of sensors or circuits that can be used with Pulse Detection, such as a pressure pad to detect when someone steps on a particular area. You can also use a relay switch to connect other electronics, such as using an Arduino or Raspberry Pi with other sensors to trigger the relay.

Behavior

When configured for Pulse Detection, the Soracom LTE-M Button will apply a small voltage to the external I/O. When it detects a change in voltage that indicates the circuit is closed due to an external switch being pressed, it will start a timer to measure the duration of the press. Once it detects another change in voltage that indicates the switch was released, it measures the timer and sends a message:

When the operation mode is configured as Alert or Alert + Heartbeat, the button will send an Alert message.

Detect Types

The message sent by the button will indicate the type of change it detected:

These detect types correspond to the same detect types of the built-in button.

Note that if the external switch is clicked for longer than 10 seconds, this will trigger a Status message, which is used for reporting the status of the button and syncing button settings, rather than an Event message or an Alert message.

Debounce

Due to the physical limitations of mechanical switches and sensors, the change in voltage detected by the Soracom LTE-M Button will often bounce up and down before settling (also called "noise"), which may result in multiple messages being triggered. You can apply a debounce in order to allow the change in voltage to settle and avoid interpreting the noise as individual triggers.

Although enabling debounce will reduce unwanted triggers, incorrect detections may still occur due to inconsistent or noisy signals caused by loose wiring, faulty switches, or other circuit component issues.

When using Pulse Detection with debounce enabled, the Soracom LTE-M Button may not be able to detect external clicks shorter than 100ms.

Timer message

When the operation mode is configured as Timer or Event + Timer, the button will count the number of Single short clicks, Double short clicks, and Single long clicks. However, these detections will not be separated from clicks detected from the built-in button.

Configuration

Pulse Detection can be enabled in any operation mode.

  1. Follow the Configuration instructions for configuring Soracom LTE-M Button settings.

  2. When prompted, select Edge Detection for the external I/O mode, and select whether or not to enable debounce:

    Select Pulse Detection

After configuring Soracom LTE-M Button settings, follow the instructions to sync your button.

Pin Assignment

The 2-wire accessory can be used to connect an external switch or circuit to the button. You can also prepare your own connector using a standard 3.5mm TRRS plug with the following connections:

TRRS pin assignment

Pin Connection
Tip (T)
Ring 1 (R) Sensor interrupt
Ring 2 (R)
Sleeve (S) GND