I always asumed it was a different option to power the board, but it seems to act more like a 5V supply. What then is the difference between this pin and the 5V pin?
-
6This is a classic example of an X-Y problem. You asked about what the Vin pin was for, and got some good answers, but what you really wanted to do (it turned out) was to trigger your camera shutter without using external components. You would get a faster (and better) answer if you state your real goal, rather than omit your goal, and mention what a possible solution might be (read the link for more info). You could always mention, as part of your question, that you wondered if using the Vin pin would help solve your goal. Just for future reference. :)– Nick Gammon ♦Aug 3, 2015 at 21:53
3 Answers
The Vin pin serves the same purpose as the barrel jack. The only difference is (usually) that it doesn't go through the schottky protection diode that causes a small voltage drop.
Normally its voltage is at around 0.3-0.4V below whatever you feed into the barrel jack.
If you power from USB then the USB voltage (~5V) is "back-fed" through the 5V regulator to appear on the Vin pin. It's not safe to use that power for anything since you could damage the 5V regulator if you do.
The pin is designed to either be used to power external higher voltage devices with power (almost) direct from the barrel jack (motors, etc), or to feed power in from an external source without using the barrel jack (great for a shield that can provide its own power source).
-
Thanks for your answer. Can I ask, what is the barrel jack and what is its purpose?– Blue7Aug 3, 2015 at 17:27
-
1The barrel jack is the big round power connector that you plug your power adapter or battery into.– Majenko ♦Aug 3, 2015 at 17:41
-
So is it possible to power the Arduino solely from the Vin pin without the usb or barrel jack?– Blue7Aug 3, 2015 at 17:45
-
1
-
Thanks. At the moment I am using it as a sort of 5V "virtual ground". Is this an okay use without damaging it? I have a camera which triggers when two wires coming from it are connected, so it triggers on a short. I have connected the 5V wire from the camera to the Vin pin, and the return wire to a digital out pin. This triggers when the digital out pin goes high. Is this an okay way to trigger the camera, or might I damage something?– Blue7Aug 3, 2015 at 18:33
To answer this added question:
At the moment I am using it as a sort of 5V "virtual ground". Is this an okay use without damaging it? I have a camera which triggers when two wires coming from it are connected, so it triggers on a short
I certainly would not be using it as a 5V "virtual ground" - whatever that means. The Vin pin could easily be up around the 10V mark, depending on what you plug into the barrel jack.
I had a project a while ago where I wanted to trigger a camera flash. In the same way as you describe, two pins had to be shorted.
I wasn't sure what voltages would be on them, or if there would be a spike, so I used an opto-coupler like this:
You need to identify by measuring with a meter which pin has the positive voltage on it. That would go to the collector of the transistor in the opto-coupler (pin 5 in this particular case).
(edited to add)
I'm just not sure about connecting 5V directly to ground though. Do you think this will be safe?
We can probably assume that the current will be low, after all they wouldn't short out the camera's battery through that pin. Put your meter in current mode across the camera's pin and measure the current when the pin is shorted (ie. the meter will short it).
If it is 20 mA or less then the Arduino digital pin can handle that. I imagine it will be a steady flow of current. I just measured my flash shoe with that method, and it seems to use a tiny fraction of current (0.1 mA).
So that should be safe, safer than your method with Vin anyway.
Then, when I want to trigger it I need to change the digital in pin to a digital out pin and enable the internal pull down resistor on this pin, effectively connecting this pin to ground, and shorting the two wires.
Sounds complex. Just make the pin LOW, and make it output to fire it. eg.
In setup:
digitalWrite (cameraPin, LOW); // default will be INPUT mode
To activate camera:
pinMode (cameraPin, OUTPUT); // drive low
delay (500); // or whatever
pinMode (cameraPin, INPUT); // make high impedance
Make sure you measure the pin and get the correct polarity. You want the positive side to go to the Arduino pin, and the negative side to Ground.
And make sure it isn't higher than 5V. (Use voltage mode on the meter to check that).
-
Thanks for your suggestion. Unfortunately I cannot add any external components, otherwise an optocoupler would have been perfect. I have been given a suggestion on Electronics stack exchange to connect the camera 5V wire to a digital in pin, and the other camera wire to ground. Then, when I want to trigger it I need to change the digital in pin to a digital out pin and enable the internal pull down resistor on this pin, effectively connecting this pin to ground, and shorting the two wires. I'm just not sure about connecting 5V directly to ground though. Do you think this will be safe?– Blue7Aug 3, 2015 at 21:04
-
-
I like the way someone explained Vin to me. "Whatever power source you connect to the DC Jack is supplied there, be it 12v or lesser"