Wiring 4-pin push button in Kicad - Page 1
Forum section: electronics / beginners

author: newtekuser
author_rank: Frequent Contributor
timestamp: September 05, 2023, 12:01:34 am
content: Do I have the wrong footprint for my 4 pin push button? The wiring looks wrong to me, but the rats nest wants me to connect it this way, per the screenshot attached.This is the push button style I'm usinghttps://www.amazon.com/GZFY-6x6x4-5mm-Momentary-Tactile-Button/dp/B01N6GU7TA

author: ataradov
author_rank: Super Contributor
timestamp: September 05, 2023, 12:28:57 am
content: Looks correct to me. What specifically looks wrong to you?

author: tooki
author_rank: Super Contributor
timestamp: September 05, 2023, 01:04:40 am
content: Quote from: newtekuser on September 05, 2023, 12:01:34 amJust use a continuity tester to verify which pins of your switch are bridged when the switch isn’t pressed. It should match the pins shorted in the rats nest.

author: golden_labels
author_rank: Super Contributor
timestamp: September 05, 2023, 03:45:34 am
content: Short answer: it is ok, but check as indicated by ataradov.Longer answer:Bad news:each manufacturer’s may make their switches as they wish. That is for both wiring and their operation. One should consult the documentation, which in the case of NoName brands is impossible and may differ from batch to batch. This seller did not even mention, what kind of switch this is.Good news:NoName brands sold by random vendors on eBay/Amazon/… are normally SPST-NO switches between two pairs of pins. They are copied from popular series from other manufacturers and virtually all manufacturers use (1,2) - (3,4) configuration, pin counting nort-west, north-east, south-west, south-east looking from the wider side. See the attachment for a few examples.Conclusion:ifyour tact switches follow the universally found layout, you are good. Two top pins are shorted, two bottom pins are shorted, and the switch connects these two pairs. While not ordering specific models from known brands with datasheets, check each batch before use. I never encountered a different layout myself, but this possibility can’t be exluded.Myguessregarding the layout is the ease of manufacturing. It seems easier to make and assemble a switch from two strips of metal than having to deal with separate elements for each pins pair or two weirdly shaped strips on each side.

author: newtekuser
author_rank: Frequent Contributor
timestamp: September 05, 2023, 05:03:22 am
content: I used the DM in continuity mode to find which pins cause the circuit to close when the switch is pressed. Unfortunately this means that the footprint is not correct because the pins will no longer fit my board unless bent. Where can I find decent SPST-NO switches for sale? For the life of mine I can't find them on mouser or digikey, all I find are industrial size switches which is why I purchased mine off Amazon.Even with this adjustment the switch doesn't work in my circuit though.

author: Zoli
author_rank: Frequent Contributor
timestamp: September 05, 2023, 05:17:28 am
content: Quote from: newtekuser on September 05, 2023, 05:03:22 amDigikey call them "tactile switches":https://www.digikey.com/en/products/filter/tactile-switches/197

author: Shonky
author_rank: Frequent Contributor
timestamp: September 05, 2023, 05:27:12 am
content: Your switch will only produce a very short low going pulse when pressed. Once the cap charges the IO line will be high again. The time constant is only 100us. Unless you edge trigger the input you really have no chance of detecting the pulse.I suspect you want the switch in parallel with the cap.Also every tact switch I've seen has the pins commoned on the long side as per your PCB layout. Are you sure you've buzzed it out right?

author: ataradov
author_rank: Super Contributor
timestamp: September 05, 2023, 05:34:32 am
content: I think you are missing something. This is the most common button type and the most common pinout. What is not correct about it?And yes, your schematic looks incorrect.

author: newtekuser
author_rank: Frequent Contributor
timestamp: September 05, 2023, 05:41:28 am
content: Quote from: Shonky on September 05, 2023, 05:27:12 amI'm 100% positive on the pins after checking them with the DM, the short side are commoned on these ones and won't fit into the holes of my boardAlso, on my breadboard I have the 10nF caps in series with the 10K resistor which are connected to +5V (circuit works fine on the breadboard which makes me think I may have screed something in kicad which later translated to a bad non-functioning board).

author: ataradov
author_rank: Super Contributor
timestamp: September 05, 2023, 05:48:41 am
content: What is "the short side" and what is "commoned"? You are 100% wrong, and it is hard to tell what you are measuring wrong. Nobody is going to make buttons not like the others, all buttons of this type have the same pinout.

author: golden_labels
author_rank: Super Contributor
timestamp: September 05, 2023, 06:40:41 am
content: Please take a picture and mark, where you connected the multimeter. Or use the picture from Amazon. Just mark, where exactly did you connect the multimeter.Also, to clarify: you did the measurement on the element itself, not while it was in circuit? Right?

author: Shonky
author_rank: Frequent Contributor
timestamp: September 05, 2023, 07:10:20 am
content: I have introduced the short and long side terminology (just how I remember these switches). The main body is square. The short sides are the sides with pins ie the pins are closer together.Your schematic matches the PCB for the circuit. However the design as is, is not a good design for debouncing IMO. I doubt your breadboard is the same. Like the switch, take a photo.It's much easier for those with experience to tell from pictures, particularly as your terminology is a bit off.

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 05, 2023, 08:27:05 am
content: The resistor and the cap are placed wrong!Also, better to not short a cap directly with the switch, even 10nF can discharge several amps for microseconds, this will wear/damage the switch contacts over time.It's a great way of adding obsolescence to your product, though. New button board every few months/years depending on usage.And the footprint is OK:

author: wasedadoc
author_rank: Super Contributor
timestamp: September 05, 2023, 01:24:24 pm
content: I find that using either pair of diagonally opposite pins of those switches always succeeds.