Arduino Forum

Using Arduino => General Electronics => Topic started by: MarioYellow on Jan 17, 2019, 09:05 pm

Title: Little help needed with wiring up a circuit
Post by: MarioYellow on Jan 17, 2019, 09:05 pm
I've laid down 10 pushbuttons onto the breadboard, but i'm unsure about something

Do i need to add resistors even if theres only buttons or is it unneccesary?

I plan to wire the buttons to ground and to one of the digital pins, to read input from them. Nothing else
Although, i have a feeling that not using resistors would short the Arduino, from directing back the same amount of voltage into ground (5v to gnd)

But i don't really know wether or not this is true or something else. So this is why i wanted to ask for (a bit more professional) help here  :)
Title: Re: Little help needed with wiring up a circuit
Post by: alesam on Jan 17, 2019, 09:33 pm
The recommended way is to connect buttons like showed here -

(http://www.retinatronics.com/wp-content/uploads/2014/03/pull_high.png)

You can omit resistors and Vcc connection and use internal pull-ups instead. But original solution is more reliable.
Title: Re: Little help needed with wiring up a circuit
Post by: Paul_KD7HB on Jan 17, 2019, 09:33 pm
I've laid down 10 pushbuttons onto the breadboard, but i'm unsure about something

Do i need to add resistors even if theres only buttons or is it unneccesary?

I plan to wire the buttons to ground and to one of the digital pins, to read input from them. Nothing else
Although, i have a feeling that not using resistors would short the Arduino, from directing back the same amount of voltage into ground (5v to gnd)

But i don't really know wether or not this is true or something else. So this is why i wanted to ask for (a bit more professional) help here  :)
No resistors needed if you set each input pin to input-pullup. But your statement "I plan to wire the buttons to ground and to one of the digital pins" concerns me. You need EACH button switch to a separate input pin.

Paul
Title: Re: Little help needed with wiring up a circuit
Post by: larryd on Jan 17, 2019, 10:35 pm
FYI (3 ways to wire a switch)
(https://i.imgur.com/6vbduK2_d.jpg?maxwidth=640&shape=thumb&fidelity=high)



Title: Re: Little help needed with wiring up a circuit
Post by: jackthom41 on Jan 18, 2019, 02:25 am
I've laid down 10 pushbuttons onto the breadboard, but i'm unsure about something

Do i need to add resistors even if theres only buttons or is it unneccesary?

I plan to wire the buttons to ground and to one of the digital pins, to read input from them. Nothing else
Although, i have a feeling that not using resistors would short the Arduino, from directing back the same amount of voltage into ground (5v to gnd)

But i don't really know wether or not this is true or something else. So this is why i wanted to ask for (a bit more professional) help here  :)
There's no need to add the resistor. Simply connect GND to one side of all your buttons and the other side of each button will be connected to digital pins of Arduino. Now in your code use pinMode Arduino (https://www.theengineeringprojects.com/2018/09/how-to-use-pinmode-arduino-command.html) Command: pinMode(Pin#, INPUT_PULLUP); and it will work perfectly fine.

When you press the button, the respective pin of Arduino will get LOW, and when you release it, the pin will get HIGH.
Title: Re: Little help needed with wiring up a circuit
Post by: MarioYellow on Jan 18, 2019, 04:32 am
Quote
But your statement "I plan to wire the buttons to ground and to one of the digital pins" concerns me. You need EACH button switch to a separate input pin.

Paul
Yeah, i meant that, just said it wrong
My bad  :smiley-sweat: