Sensors gather data about some physical phenomenon (e.g., light, temperature, etc.) and convert that data into analog or digital signals. You will create a sensor resource in Octave any time you have an external asset connected to the Octave-enabled device from which you want to poll data in Octave.

📘

Note

If the asset pushes data to the Octave-enabled device, then you must use an input instead.

The following subsections describe how sensors are represented and configured in Octave.

Common Sensor Fields

Depending on their functionality, some or all of the following fields can be configured in Octave for a sensor:

  • period: The period, in seconds, at which to poll an input sensor for its value. If a polling period doesn’t exist on a sensor, it usually means the value will be received when the driver is ready to send one (e.g. motion detected by a motion sensor).
  • enable: Enables or disables the sensor.
  • trigger: The resource used to trigger a new value. You can push a value to the specified trigger resource, and when the driver is ready, it will put a new value on the value resource.

Configuring a Sensor

Sensors automatically appear as resources on the Device > Resources screen but require configuration before they can be used.

The steps below use the on-board light sensor as an example, to illustrate how to configure the frequency at which a sensor on the mangOH Red reports data to the Data Hub:

  1. Navigate to Device > Resources.
  2. Locate and expand redSensor > light.
  3. Click the edit button to the right of the period property.
  4. Set the value to 5 and click Set. This sets the resource polling period to 5 seconds.
  5. Wait for five seconds to elapse and check that the Value column for the Resource has updated.
  6. Place your finger over the light sensor which is located as shown here:
300
  1. Observe the Value for the sensor on the Device > Resources screen. After the polling period has elapsed, the value should drop significantly due to the lack of light.

📘

Note

You see this update on the Resources screen because the device is in Developer Mode. In Developer Mode, the device periodically updates all of its last-known values for every Resource, regardless of whether they are set to be observed or not. Note that in Developer Mode, the Resources screen is updated approximately every 20 seconds and not in real time.