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



  • 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



  • @wwhite

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

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



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



  • @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.



  • @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