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
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.
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