## 3 Re-Usable Re-Constructible Sensor Device
### Software
#### 3.3.1 Intelligent Calibration
The two sensors are both VL53L1X infrared distance sensors connected via the I2C to the Arduino. The Arduino samples the distance values at 10 Hz. The XSHUT pins are used to sweep between the sensors. Figure 5: Final motion sensor device with respect to the human hand. Measurements are in mm. #### 4.1.2 Software

The software was developed to facilitate the calibration process and aid in assessing whether the motion sensor device functions as intended. This software took the data output from the motion sensors and communicated whether the sensors were positioned correctly by adjusting the two rectangles on the screen. The software followed Algorithm 1 with two sensors, resulting in the two solid rectangle shapes, which move depending on the distance between the human body and the sensor in the device. There are also two shaded regions corresponding to the sensors. As shown in Figure 1, the overhead blue sensor points towards an infinite distance over the head when seated and maintains a fixed distance of approximately 80-100 cm when standing. The blue sensor always returns a value of 80-100 cm. If the person is not at the desk, then both sensors would point at an infinite distance (or the blue sensor would at least return a different value from when seated, in case a chair is left in position). In the software design, it was decided to put the _overhead_ sensor that is actually pointing upwards (relative to the _underhead_ sensor) on the lower part of the screen, i.e., blue, and the _underhead_ sensor was put at the upper part of the screen. As the user stands up, the value of the blue/overhead sensor decreases from infinity and records a drastic change. The interface was designed to follow the user's motion-when standing up, the blue shape would move up proportionally, and when sitting down, the _blue_ shape would go down. The underhead sensor and corresponding red shape, on the other hand, remain relatively static in value and position. This is considered the most intuitive for users who can match their movements with the on-screen visual cues. Both shapes move vertically only, and the movement is proportional to the distance recorded at the respective sensors. The recorded values are then normalized before being used to determine the vertical position of their corresponding shapes in real time. Based on this, the software can detect whether the user is standing or sitting. For calibration, there were four steps:

1. Step 1 is connecting the device to the computer and software. 2. Step 2 is calibrating the _red_ zone sensor on a screen \(y_{0}\), i.e., the _underhead_ sensor, which points just over the edge of the desk towards the user's torso. As this sensor points to either the chest (when seated) or the lower torso (when standing), it is expected to be

Figure 6: Components making up the kit given to participants. the least variable with respect to Algorithm 1. The user may twist the sensor direction until the final location of the red shape is satisfactory. 3. Step 3 is calibrating the _blue_ zone sensor on the next screen, \(y_{1}\), which is the _overhead_ sensor pointing just over the user's head (when seated) or the user's chest (when standing). The user may twist this sensor while keeping the red one static. 4. Step 4 validates the two tasks being tracked--sitting and standing--based on the differential of the two sensor values. This involves repeated standing and seating and making sure the shapes move correctly as per the instructions. Due to the nature of the sensor device, the _underhead_ red sensor is less erratic; therefore, it is calibrated first to ensure it remains within the red zone (as shown in Algorithm 1). Following this, there is another step where the overhead blue sensor is calibrated by moving it between the blue and red zones, depending on the action being tracked:

1. Both boxes overlap in the red zone, indicating a standing position. 2. The red box remains in the red zone, and the blue rectangle remains in the blue zone, indicating a sitting position.