🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    (SOLVED) Help Needed: Keys KY-031 Knock Sensor Module connection to M5Stack Core

    PROJECTS
    2
    5
    7.1k
    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.
    • W
      wwhite
      last edited by wwhite

      I'm trying to connect this module to my M5Stack Core.

      Description
      KY-031 knock sensor module. A vibration sensor that sends a signal when a knock/tap is detected.

      Compatible with Arduino, ESP8266, ESP32, Teensy, Raspberry Pi, and other popular platforms.

      KY-031 Knock Sensor Module
      KY-031 Specifications
      This module consists of a 10 kΩ resistor and a spring-based sensor that sends a high signal when a vibration is detected.

      Operating Voltage 3.3V to 5V
      Output Type Digital
      KY-031 Connection Diagram
      Connect the module's Power line (middle) and the ground (-) to +5 and GND respectively. Connect signal (S) to pin 3 on the Arduino.

      KY-031 Arduino
      S Pin 3
      middle +5V
      -GND

      On the Arduino it uses Pin 3. What Pin should I use on the M5Stack?

      Thanks in advance,

      WW

      0_1616438642207_6919f579-2ad8-43bd-b018-dbc56d9a0eb3-image.png

      world101W 1 Reply Last reply Reply Quote 0
      • world101W
        world101 @wwhite
        last edited by

        @wwhite

        Assuming you have the Core Black or Grey, did you try pin 3?

        https://arduinomodules.info/ky-031-knock-sensor-module/

        W 1 Reply Last reply Reply Quote 0
        • W
          wwhite @world101
          last edited by

          @world101 I just tried pin 3 and didn't have any luck. I'm using a Core Black.

          world101W 1 Reply Last reply Reply Quote 0
          • world101W
            world101 @wwhite
            last edited by

            @wwhite

            Since it's not an M5Stack product, did you verify it on an Arduino (Uno or other device) to see it working? Also, you might want to post your code to get more assistance.

            That sensor looks like a basic digital low/high sensor. I have never used it, but I have been successful using pin 5 with a different digital sensor. Try pin 5 or pin 2.

            W 1 Reply Last reply Reply Quote 0
            • W
              wwhite @world101
              last edited by

              @world101 So I figured it out:

              On that particular module I connected it as follows:

              Left pin on module labeled 'S' to 5v on the righthand side of M5Stack (red wire)
              Center pin on module (not labeled) to GND on the righthand side of M5Stack (yellow wire)
              Right pin on module labeled '--' to pin 2 on the righthand side of the M5Stack (orange wire)
              After you compile and upload the app tap the module to see the "Tap" message.

              0_1616464971817_c969263d-aea7-40dc-8845-895ffbeb7a4f-image.png

              0_1616465037306_a4780b78-a6db-44a4-8d72-6b3eccdfd416-image.png

              1 Reply Last reply Reply Quote 0
              • First post
                Last post