MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-Swipe - Hand gestures

    Scheduled Pinned Locked Moved Utilities
    modulemotionswipehand-gestures
    5 Posts 4 Posters 10.6k Views 9 Watching
    Loading More Posts
    • 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.
    • mochmanM Offline
      mochman Module Developer
      last edited by yawns

      Description

      I was tinkering around with the HC-SR04 Ultrasonic Rangers and I figured I’d use them to try and detect hand motion in the form of “swipe” gestures. In the module’s current form it allows you to detect swiping left or right along with a “press” (when both sensors are covered). The module then sends a notification & payload to other modules for their usage.

      It has a calibration mode which allows you to see the raw distance data from each sensor so you can determine what a good “detection” distance is. I use 20cm for mine. There is also a “verbose” mode which will show you the “swipes” on the screen so you can see if it works for you. The normal mode is invisible, since it is used to send data to other modules for their use.

      The issue I ran into was permissions. I couldn’t figure out a way to use the GPIO portion of the pi without running MagicMirror using sudo npm start

      Screenshots

      Calibrate Mode
      This will constantly update with both sensor’s distances. You can see that I put my hand in front of the right sensor. This is used to tweak the initial trigger distance (how far out from the sensors you want to have your hand to register a movement).

      Verbose Mode
      This will show you when you perform a swipe or press movement. The program waits for a trigger by you putting your hand in front of a sensor, then it looks to see if you move it away and put it in front of the other sensor. This will give you a swipe. If you put your hand in front of both sensors at the same time, it give you a press.

      0_1465068627925_Swipe.jpg

      Here’s the testbed so you can see the wiring.
      0_1465070259612_Board.jpg

      Download

      [card:mochman/MMM-Swipe]

      paviroP 1 Reply Last reply Reply Quote 2
      • mochmanM Offline
        mochman Module Developer
        last edited by

        I updated the module to also let you use it as a physical button. Besides sending notification, you can also have it activate another GPIO pin as a momentary press. I’m thinking about integrating it with either Alexa (which looks for a button press) or @EoF’s Hide All Module.

        1 Reply Last reply Reply Quote 1
        • S Offline
          Shampooman
          last edited by

          Thats great. Didn’t try it, but it looks amazing. Thank you for sharing… :)

          1 Reply Last reply Reply Quote 0
          • KirAsh4K Offline
            KirAsh4 Moderator
            last edited by

            For troubleshooting or HOWTO questions, please post in the Troubleshooting thread:
            https://forum.magicmirror.builders/topic/205/mmm-swipe-hand-gestures/1

            A Life? Cool! Where can I download one of those from?

            1 Reply Last reply Reply Quote 0
            • C Offline
              c.keen
              last edited by

              Good evening,
              I was quite excited when I read about this module. And since there is the MMM-Profileswitcher, I would really like to know if someone has tried to connect the swipe-module to the profileswitcher? Unfortunately I am a programming NOOB, is there anybody out there who wants to develop this module any further?
              There is the module from thobach at https://github.com/thobach/MMM-Gestures. But I wanted to use the HCSR-04 ultrasonic range instead an arduino …

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy