Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. APDS9960 - Gesture Sensor and MySensors Sleep

APDS9960 - Gesture Sensor and MySensors Sleep

Scheduled Pinned Locked Moved Hardware
2 Posts 1 Posters 49 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Westie
    wrote on last edited by
    #1

    I'm trying to build a gesture sensor switch using adps9960 module that runs on battery and also accommodates temp/humidity via dht11.

    Setup works with examples provided with Sparkfun library - so electronics ok. I see the gesture sensor activate interrupt 0 from pro-mini 3.3v. Device works fine in non-sleep mode as MySensors to Webthings.io

    Sleep mode using the interrupt and FALLING only wakes after ms sleep, not from interrupt activity.
    The difference between example code and MySensor example code https://www.mysensors.org/download/sensor_api_20#sleeping is

    1. No allocation of INPUT pin for interrupt pin - assume its done in MySensors
    2. No specification of attach interrupt - assume its done in MySensors
    3. No definition of an ISR - again assume its done in MySensors

    Anyone had success with this - the adps 9960 sets off the interrupt - tested by the Sparkfun example code ... device tech specs says it pulls low after an action detected on the proximity sensor engine..

    1 Reply Last reply
    0
    • W Offline
      W Offline
      Westie
      wrote on last edited by
      #2

      I did more investigation played around with sleep outside of mysensors and found a bit of code in a proximity sensor example:

          // Reset flag and clear APDS-9960 interrupt (IMPORTANT!)
        isr_flag = 0;
        if ( !apds.clearProximityInt() ) {
            Serial.println("Error clearing interrupt");
        }
      

      I then needed to play around with delays to allow the sensor to catchup..

      void loop() {
      delay(1000);
      

      Recoding back to MySensors

      if ( !apds.clearProximityInt() ) {
            Serial.println("Error clearing interrupt");
        }
        wakeupReason = sleep(digitalPinToInterrupt(INT_PIN), FALLING, sleepTime);
      

      setting up the interrupt pin with a pullup forced the FALLING when pin dragged down by the sensor.

      void setup() {
          pinMode(INT_PIN, INPUT_PULLUP);
      

      All this is on caveat it makes it through some more testing.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      23

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular