5v Rail Output

Hi, I have a question about the 5v rail on the Arduino Uno R3.
I just finished my first project, a simple rainbow RGB LED strip cycle, which looks fantastic. I have a 12v 2A power supply plugged into the DC power jack on the Arduino, and the LEDs are powered via the VIN pin. I have MOSFETs connected to 3 of the PWM pins on the board to control the colours.

So when I finished my project, I wanted to be able to control the LED cycle using a push-button (to be able to switch the cycle from rainbow, to all-white, to all blue, or just all off). After doing some research online, I’m pretty sure inputting 12v into a digital pin will pretty much fry it instantly. And all of the tutorials I saw online that showed me how to utilize push buttons used a 5v power supply. So my question about the 5v rail is this:
If I have a 12v power supply powering the Arduino, would the 5v rail still be able to output 5v? Or am I wrong about the 12v instantly frying the digital pins?

Thanks in advance

"12 volt digital pin"..... Do mean the D0 - D13 pins? If so, yes, 12 volt will destroy the board.
You can feed the UNO by 12 volt to the barrel jack but do not use the 5 volt pin for more than a few milli amps.

Vin goes through a 5V voltage regulator regulator so the processor, etc. is operating on 5V. The easiest way to use a pushbutton is to enable the internal pull-up resistor and wire the switch so pressing the button pulls the input to ground (low). And of course, write your code so it responds to an input-low.

I have a 12v 2A power supply plugged into the DC power jack on the Arduino, and the LEDs are powered via the VIN pin

Depending on how many LEDs you have an how many amps you are "pulling" it might be better to wire the LEDs directly to the power supply so the current doesn't have to go through the barrel jack and through the traces on the board. (I don't think that barrel jack is rated for 2A).

If I have a 12v power supply powering the Arduino, would the 5v rail still be able to output 5v?

Yes, but not much current because the on board regulator only has a tiny heatsink and will over heat if you draw much current.

Or am I wrong about the 12v instantly frying the digital pins?

It will try the whole chip most likely.

If you want to connect buttons to inputs wire between the pin and 0V. Use INPUT_PULLUP

Do not apply 12 volt to the Barrel Jack, the round connector, and pull current out of the Vin pin. The tiny copper leads are not made for LED currents more than some milli Amps.
Connect the 12 volt supply to the Barrel Jack and to the LED.

...assuming you consistently use 12V LED strips.

PerryBebbington:
If you want to connect buttons to inputs wire between the pin and 0V. Use INPUT_PULLUP

I never thought of connecting a push-button like this, thank you so much! Previously I thought using a pin as an input was the only way to connect a push-button. I think this way of doing it will work perfectly (I'll use a button-counter system to cycle through the different colour modes in the coding).

Previously I thought using a pin as an input was the only way to connect a push-button.

Either I have misunderstood you or you have misunderstood me. This is using a pin as an input to connect a button...

In the IDE under file > examples > 02 digital > DigitalInputPullup

Well, we are presuming what he originally thought was that you needed to have the pin to Vcc and a resistor to ground using pinMode of INPUT. The Arduino tutorials and many others tend to show this quite misleading approach by default presuming everyone is stupid rather than taking the trouble to start people with proper practice. :roll_eyes:

And the reason for attempting to use "Vin" would be that the power supply came with a 2.1 mm connector. :grinning:

I agree Paul, and I would like to change some of the tutorials. Problem is I've been told it's very difficult to get them changed. There is lots of bad practice and bad advice in them and we get to clear up the resulting mess.

Something else that drives me nuts is the examples are always in loop(), then we get huge bits of code with everything in loop() and no functions. I always put examples in functions, however simple, with a call from loop() to illustrate using functions.

If I could make a suggestion, any future tutorial or instruction section might take the form of a ‘tree’, that links related concepts by their dependencies.

e.g. That means you learn about what millis() and interleaving code is before attempting multiple things at the same time.

Topics could be cross-linked to bring relevant topics from different trees into view, as you traverse the topics you’re looking for.

(I actually wrote a very capable multi-dimensional database to do things like this around 1990, but couldn’t get anyone interested !.. it has ‘literally’ no exposed record structure, but you can link, embed or alias any element any other, along with their context & metadata values etc. infinitely within the available storage… all with a click & drag interface. Supports BLOBs, proxies, recursion… all the buzzwords !)

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled “How to use this Forum”.
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks… Tom… :slight_smile: