Need Help With Button in Schematic

Hi everyone,

Could someone verify if I’ve drawn this schematic incorrectly? I’m also sharing an image taken from the Arduino.cc site that shows how my button is wired (and working) on my breadboard. The button is wired to an Arduino, just as it is in the photo except for the pin on the Arduino (my schematic has it going to pin F1).

I’m seeing some strange behavior in the boards I had fabricated, and I suspect it has to do with the button circuit due to the behavior I am seeing. I thought this was simple enough, but I suspect I messed up with the pins…

Thank you in advance for taking a look and for any feedback!

The pull-down resistor should be on pin 2 of the switch, such that when the switch is open it creates the default switch state. The way it’s connected here the arduino pin is left floating, the resistor-to-ground is permanently connected to the positive supply, therefore not acting as a pull-down. Additionally it would slowly drain the battery this way.

1 Like

@stryker thanks for the reply!

I jsut had an idea to use Fritzing to have it generate a schematic from a breadboard and I see it looks different than mine…

The first thing I notice is that the symbol looks different…Do you know if Kicad has the same symbol? I’ll try to match the circuit that way…

Thanks again!

@stryker Does this look correct now?

Thanks again!

That kind of tactile switch is normally drawn as a SPST switch symbol on the schematic, no need to show the 4 pins, but when it comes to selecting a footprint for it, you pick one that has pin 1 stacked with pin 2, and pin 3 stacked with pin 4, and the right thing will happen. Somebody else encountered the same issue before:

Thanks @kenyapcomau,

Does this look correct then?

Again, this is what my breadboard is setup like (except pin on Arduino is different):

You’re sure you couldn’t redesign the software to expect the pin to be normally high, and wire the switch to ground, so that you can use INPUT_PULLUP mode on that pin, and save yourself a resistor?

1 Like

I have multiple buttons to deal with, I don’t mind the resistor.

Does the circuit look correct now? If so, I’ll reuse that block to fix the other buttons in my design.

Thanks again!

This is right now. In this symbol for the switch, pin 1 & 2 are common, connected in the switch symbol. On the Fritzing version, both commoned legs are called pin 1 and the others (3&4 here in KiCad) are pin 2.

On the question of the different resistor symbol, ANSI style resistor symbols are available for KiCad but all the default ones are IEC standard. On this github submission to add the zigzag ANSI one as default it explains the justification why - IEC is the international convention.

As per another post, in Arduino the cleaner way to do this is to change the pin type to use INPUT_PULLUP (check this reference page for what this means) and reverse the logic in your code to expect a 0/false when the switch is pressed. That would mean you can do without the resistor entirely, as you’ll use one that’s built-in.

All the best, Geoff

2 Likes

Thanks for the reply and confirmation on the circuit!! I’ll look at the pullup as well.

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