sensor-experiments

Objective

This experiment uses the APDS9960 sensor to detect gestures, such as up, down, left, and right.

Required Components

No Ads Available.

Working Principle

The APDS9960 sensor uses infrared light to detect gestures by measuring the reflected light from the user's hand movements.

Arduino Code


/*
 * Gesture Detection with APDS9960
 * This code detects basic gestures using the APDS9960 sensor.
 */

#include 
#include 

APDS9960 apds;

void setup() {
  Serial.begin(9600);
  if (!apds.begin()) {
    Serial.println("Failed to initialize APDS9960 sensor");
    while (1);
  }
  apds.enableGestureSensor(true);
}

void loop() {
  if (apds.isGestureAvailable()) {
    int gesture = apds.readGesture();
    switch (gesture) {
      case APDS9960_UP:
        Serial.println("Gesture: Up");
        break;
      case APDS9960_DOWN:
        Serial.println("Gesture: Down");
        break;
      case APDS9960_LEFT:
        Serial.println("Gesture: Left");
        break;
      case APDS9960_RIGHT:
        Serial.println("Gesture: Right");
        break;
      default:
        Serial.println("No Gesture");
        break;
    }
  }
}
            

Results

The serial monitor will display the detected gesture based on the hand movement.

Applications

  • Gesture-based control systems
  • Home automation
  • Interactive displays

Conclusion

The APDS9960 sensor is a useful tool for detecting hand gestures, enabling applications in motion control, automation, and user interaction systems.

Contact Us

If you have any questions or inquiries, feel free to reach out to us at Microautomation.no@icloud.com .

Follow our Socials for the newest updates!