Description

A motion sensor detects motion and provides a High output when motion is detected.

Block description

This block can be used in digital mode to receive the states (High or Low) inputs from an externally connected Motion sensor. The reading changes when a motion is detected on the external motion sensor connected to any of the ports S1, S2, S3.

Hardware interface

Connecting an external Motion sensor

Note: While connecting an external sensor to the Cloudio board, care must be taken to match the polarities of the sensor with that of the port (S1/S2/S3) that it is being connected to.

Motion Hw

App interface and usage

Port selection:

Here, you can select the port the Switch is connected to - S1/S2/S3.
Motion Ex

Operator:

Here, you can select the operator to be used while comparing the sensor reading against threshold values of High or Low.
Motion Ex

State:

You can set the threshold state to be compared against the value received from the sensor.
You can use the Read option to read/receive real-time values from the port selected.
Motion State
After you set the parameters for the block, you can press Done to confirm and save your changes.

Example

  1. This code snippet checks the reading of the Motion sensor and turns the LED red and the buzzer on if a high reading is received, i.e. motion is detected.
    Note: This is a code snippet to explain the working of the block. In this case, this code will be executed once and at the time of uploading the code.
    You will need to use this snippet inside a loop infinitely block if you want this code to run on the board for the entire duration that the board is on.
    Motion Ex

Also read

Input
Control