Go Down

Topic: Resistor needed? (Read 234 times) previous topic - next topic

TheAliw1

Sep 01, 2019, 10:40 pm Last Edit: Sep 01, 2019, 10:42 pm by TheAliw1
Hi everyone,

I am new to electronics and just wanted to make sure that I use resistors for the buttons properly in the following schematic. It raised a couple questions for me:



  • Do I need resistors for the buttons in this arduino project? I have heard that the arduino microcontrollers has internal resistors to prevent short circuiting? Is it still good practice to include resistors to improve longevity of the microcontrollers or are the internal ones satisfactory? In case I do need resistors what would a good resistance value be for the resistor in series with the button?
  • If my buttons need a resistor in series, do the potentiometers in the same project need resistors as well? Logically speaking I would say yes, I use 10k linear potentiometers, if i turn the potentiometer all the way to the end where it does gives maximal resistance I would short the analogue pins A2 and A3 to 5V. My arduino hasn't blown up yet but am I risking potential damage in the long term here? If I need a resistor where would I place it best? In series with the negative wire of the potentiometer or in series with the analogue sensing wire or both?


I did not notice any weird behaviour in this circuit and it has been working really well but I wanted to make sure I use the components in my project properly  :) 

larryd

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

TheAliw1

Thanks for the quick reply larryd! :)

jremington

#3
Sep 01, 2019, 11:01 pm Last Edit: Sep 01, 2019, 11:01 pm by jremington
Quote
Do I need resistors for the buttons in this arduino project?
Yes, but you can use the resistors that are built in to the Arduino, using pinMode(pin, INPUT_PULLUP).

In that case you just wire the switch from the pin to GND.

SteveMann

#4
Sep 01, 2019, 11:08 pm Last Edit: Sep 01, 2019, 11:09 pm by SteveMann
Do I need resistors for the buttons in this arduino project?

Yes.  The resistors bias the pin to be normally low, and the button pulls the pin high.  10K is fine.  Without thr resistor there is no guarantee what the pin level would be when the button is not pressed.

If my buttons need a resistor in series, do the potentiometers in the same project need resistors as well?

No.  The pot is connected across Vcc and Ground, and the wiper goes to the Analog input.  You can safely put any voltage from ground to Vcc on the analog input.

------
As Jremington says above, it would simplify the circuit if you use the internal pullup resistors and wire the switch from the GPIO pin to ground.
I am usually so far out of the box that most people don't know what I am talking about.

Please do not ask for help by PM. I will not respond.
If you need help, post a question on the appropriate forum.

larryd

3 different switch connections:





No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

gilshultz

Just a few comments, the circuit looks great.  I have learned that unless the switch contacts are gold plated they will oxidize over time and eventually fail. Many years ago several switch manufacturers determined that switches not designed for electronic use must have at least 1mA through them to keep the contacts clean. I would suggest using 4.7K resistors for this reason.  If the switches are going to be on wires larger then bread board consider using 10K resistors at the input pin to the junction of the switch and its appropriate pull resistor.  Wires become antennas and can introduce some nasty transients depending on the environment.  This will keep 200V transients from exceeding the input diode protection of the arduino. For this reason I would suggest putting the current limiting resistors for the LEDs on the port pin side. There are a lot of ways of providing protection this is fast and cheep.
Good Luck, Have Fun!
Gil
This response is to help you get started in solving your problem, not solve it for you.
Good Luck & Have Fun!
Gil

Go Up