Pullup/Pulldown guidance on pushbutton

buttons

Hi! sorry if i'm on the wrong place, this is my first time posting.

So i have a problem with my pushbutton, my push button (as seen above) is keep getting noises every now and then, sometimes it's really stable but sometimes it will just freak out with the output. Now the manufacturer said that it's already have a pulldown resistor on the button so I do not need to add any more resistor, but it's still sometimes catches noise.

My question is, is there any other way to eliminate noises? Is adding more external like 10k resistor would help with the problem? And if so, where I suppose to connect the resistor because I'm confused with my button which use 3 pin of VCC, OUT, and GND.

Any help and clue will be very much appreciated! Thanks.

do you able to pull off the cap? show where is that resistor

No actually I can't open it to see the resistor because the top part is soldered on to the pcb, what I can only ASSUME with my limited knowledge is the inner 4 circles might be the resistors? sorry I don't really know :slight_smile:

Now, I have also tried with the built in arduino PULL_UP code but still no luck. Hence why I want to try using additional external resistor...

if that resistor exist, it may be checked with ohmmeter.
do you have link where you get this strange button?

Ah I don't have an Ohmmeter, will try to check if I could find one.

and yes, here's a link to a similar button Tactile Button Breakout Boards - 5 Pack — PMD Way

I bought mine from other place, the link above is just for reference.

that pcb have resistor, your - not

show how did you tried intern resistor

Ah... I think you're right. I don't know why mine's don't have that resistor when the page says it will have one, just unlucky I guess.

If that so, isn't it suppose to work fine with arduino input_pullup?

and I haven't tried the internal resistor one, I'm confused which of the 3 pins I need to connect with the 10k resistor.

I don't think that is the case.
I would imagine they are there to fit a different sized switch.

exactly
grafik

Yeah I think you're right, thanks for the insight!

refund them

use

pinMode(pin, INPUT_PULLUP);

I wish I could, but my project is already on the deadline now I just have to work with whatever I have at the moment :slight_smile:

Alright! will try it again in a minute

This note may be helpful:
3pinSW
Figure-1:

Test Code:
Connect VCC at 5V, GND at GND, and OUT at DPin-5 of Arduino.

void setup()
{
    Serial.begin(9600);
    piMode(5, INPUT);
    pinMode(13, OUTPUT);   //onoard LED of Arduino
    while(digitalRead(5) != HIGH)
    {
          ;  //wait and check switch closure
    }
    delay(100);   //deboncing time of SW
    digitalWrite(13, HIGH);  //SW is pressed; onBoard LED of Arduino is ON
}

void loop(){}

I have tried using input pullup, but I'm having no correct output. It's always on HIGH when the button is pressed or depressed.

the only way I found it to behave the best is using regular input, and set to HIGH on pressed. It is working but just the noise issues I'm getting so it's inconsistent.

additional info: VCC on 5V via breadboard, GND on Uno R3's GND, Out on digital 12.

Thanks for the note! Does it means that if I want to add an external resistor, I need to connect it with the GND pin? or am I reading it wrong? :slight_smile:

Connect VCC to GND
Connect OUT to the input pin
Set mode to INPUT_PULLUP

Input goes LOW when button is pushed.

You don't need to connect any other resistor. The indicated pull-down resistor is already on the tiny PCB on which the SW is mounted.

Upload the following sketch and check that onBoard LED of Arduino (UNO) in ON when you gently press the switch.

void setup()
{
    Serial.begin(9600);
    piMode(5, INPUT);
    pinMode(13, OUTPUT);   //onoard LED of Arduino
    digitalWrite(13, LOW);     //to ensure that onBoard LED is OFF

    while(digitalRead(5) != HIGH)
    {
          ;  //wait and check switch closure
    }
    delay(100);   //deboncing time of SW
    digitalWrite(13, HIGH);  //SW is pressed; onBoard LED of Arduino is ON
}

void loop(){}

This is wrong! There is already a pull-down resistor associated with the Switch (Fig-1) of post #16