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.
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
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...
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.
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(){}