Welcome to LuphiTouch®!
Today is 2026.11.09 , Monday
Leave Your Message
News Categories
    Featured News

    Is it better for the COM terminal of the membrane switch to be connected to VCC or GND?

    2026-06-24

    Whether the COM terminal (common terminal) of the membrane switch is connected to VCC or GND essentially depends on the I/O port structure of the MCU and the overall design of the system. Both connection methods can work properly, but in actual engineering, there is a clear preference for one over the other. 
    Comparison of Two Wiring Methods 
    COM connected to GND (low level valid, recommended) 
    This is the most popular and recommended method.

    productive process (7).jpg

    Circuit structure: The COM terminal is grounded. The row/column pins are connected to VCC through the internal pull-up resistor of the MCU.
    Key logic: When not pressed, the pin is at a high level. When pressed, the corresponding pin is pulled low to GND.
    Working principle: Pressing the key → The row/column pins are connected to COM (GND) → The pin level changes from high to low → The MCU detects the low level and determines that the key is pressed.

    COM connects to VCC (with high level as the valid state) 
    Circuit structure: The COM terminal is connected to VCC, and the row/column pins are connected to GND through pull-down resistors.
    Key logic: When not pressed, the pin is at a low level; when pressed, the corresponding pin is pulled high to VCC.
    Working principle: When the key is pressed → The row/column pins are connected to COM (VCC) → The pin level changes from low to high → The MCU detects the high level and determines that the key is pressed.

    Why is it recommended to connect COM to GND? 
    Better compatibility with MCU 
    The vast majority of MCUs (such as 51, STM32, AVR, PIC, etc.) have built-in pull-up resistors in their GPIOs, which can be enabled directly through registers without the need for external components. However, MCUs with built-in pull-down resistors are relatively rare. When COM is connected to VCC, an external pull-down resistor is often required, increasing the BOM cost and PCB area.

    Static power consumption is lower. 
    COM connected to GND: When the button is not pressed, the pull-up resistor maintains a high level and consumes almost no current; current flows through the resistor only when the button is pressed.
    COM connected to VCC: If an external pull-down resistor is used, current will always flow through the resistor regardless of whether the button is pressed or not, resulting in continuous power consumption.

    Stronger anti-interference capability 
    In digital circuits, the noise tolerance for low-level triggering is usually greater. According to the TTL/CMOS level standards, the low-level determination threshold (typically ≤ 0.8V) is farther from the middle range than the high-level determination threshold (typically ≥ 2.0V), and has a higher tolerance for noise. Additionally, GND serves as a more stable reference potential compared to VCC, as power ripples and switching noise tend to accumulate on VCC.

    Fault Safety 
    COM connected to GND: If the circuit is open or has poor contact, the pin remains in the pulled-up high level state, and the MCU determines it as "not pressed" - this is the safe default state.
    COM connected to VCC: If the circuit is open, the pin is pulled down to the low level, and the MCU also determines it as "not pressed". However, if the pull-down resistor is faulty and open-circuited, the pin may float and cause false triggering.

    Consistent with the NPN/PNP sensor system 
    In industrial control, NPN type sensors (with low-level output) are more commonly used than PNP type (with high-level output). The design concept of COM connected to GND is naturally compatible with the NPN system, facilitating the uniformity of the system.

    Typical circuit example (COM connected to GND) 
    MCU GPIO (built-in pull-up)
    │
    ┌──────┼──────┐
    R1     R2     R3    (Internal pull-up resistor, approximately 20-50 kΩ)
    │      │      │
    Row 1   Row 2  Row 3
    │      │      │
    ├─Key ─┼─Key─┼─Key─┐
    │      │      │     │

    COM ────┴──────┴─────┴─── GND
    (Connected to the public ground)

    When the button is pressed, the corresponding row pin is pulled down to GND. The MCU detects the low level and determines that the button is valid. 
    Under what circumstances should a COM connection be used for VCC? 
    Although not recommended, the following scenarios can consider using COM to connect to VCC: 
    The MCU only has a pull-down input function and no pull-up resistor (for a few low-end MCUs).
    The system already has a stable VCC reference, and the GND wiring resources are tight.
    The logic levels with the upstream circuit need to be consistent (for example, the output of the preceding stage is high-level valid).
    Special safety requirement: It is required that when the circuit is disconnected, the output should be high-level as a fault alarm signal.

    Design Considerations 
    Disable jitter: Regardless of the connection method, software or hardware is required for jitter elimination. Usually, a software delay of 10 to 20 ms is sufficient.
    Current limiting protection: A small resistance (e.g., 100Ω) can be connected in series at the COM terminal to prevent excessive current during a short circuit.
    ESD protection: Since the membrane switch is exposed to the outside, it is recommended to add a TVS diode or ESD protection device to the row/column pins.
    Scanning method: For matrix-type membrane switches, the row scanning method is used. Only one row is enabled to output a low level (COM is connected to GND), and the remaining rows are set as high-impedance inputs to read the column status.

    💡 Summary: The COM terminal of the membrane switch should be connected to GND (with low-level as the effective state). The reason is that it is compatible with the built-in pull-up function of most MCUs, has lower static power consumption, stronger anti-interference ability, and better fault safety characteristics. Only when the MCU has only a pull-down input or there are special system requirements, should the COM terminal be connected to VCC.