Is a resistor required in a circuit with Piezo as an input

HI, I'm making a simple project using Arduino pro micro, expecting a piezo sensor send out a keypress to the computer. I've directly connected the positive of piezo to digital pin 3, and negative to ground. The code works perfectly in this case. However, in all the examples of piezo circuits I've seen, they used a 10K pulldown resistor. But when I use a resistor in my circuit, the arduino ignores any input and simply keeps the letter pressed so I get a constant "aaaaaaaaaaaaa" on my notepad.
Without the resistor, the circuit works just as expected. So, do I really need the resistor to "protect" the piezo sensor or my device, or as a pulldown or anything? Can I finalize my project with just the piezo soldered directly to pro micro?

Welcome to the forum

You started a topic in the Uncategorised category of the forum whose description is

:warning: DO NOT CREATE TOPICS IN THIS CATEGORY :warning:

Your topic has been moved to a more relevant category

Show us a link?

That isnt a "pull down".
The output from the piezoelectric element is a charge proportional to pressure.
Applying that to a high impedance input - like an arduino pin - will produce an excessive voltage.
The resistor is connected across the sensor to convert the current to a suitable voltage.
Show us your code please

#include <Keyboard.h>

int pinZo = 3;

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

}

void loop() {
  
    if(digitalRead(pinZo) == LOW)
    {
      Keyboard.press('a');
      delay(90);
      Keyboard.releaseAll();
    }
}

@ansh4real
In the video you show, they use a 1 Megohm resistor, NOT 10K and yes you need the resistor

Hey guys, thanks for your support. I used the 1 Megaohm and it is working now. Thanks a lot @johnerrington and @jim-p .

you may need to adjust this value to get the response you want

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.