user13545: I'm trying to find a way I can toggle the 5V pin to turn on/off. I want the voltage to pass to another wire at a certain point. It should be off and then when something happens, the 5V should turn on. 
How can I do this?

user313: You don't really want to do that. The 5V pin is on the power bus of your Arduino board. If it were possible to turn it off, the entire Arduino would shut down.

user6628: There isn't programmatic control of the 5V pin, it is hard wired to the USB or the output of the Vin Voltage regulator.
You might try something from How can higher current devices (motors, solenoids, lights, etc.) be controlled by an Arduino? to control the low side of the external device.  If you need high-side control, maybe an opto-isolator would be a good solution.   

user10907: If I'm understanding you correctly, you want a 5 V output that is under programatic control. Do you know how much power you want to pull from the pin?
If the demand is fairly low, you could use one of the digital pins directly – they will supply about 40 mA on an "official" Arduino.
If you need more power, then you could use the pin to switch an external device such as a transistor or a relay.

user15303: For energy-efficient switching (along with relatively high-current capability), I recommend using a Darlington transistor connected to one of the output pins (digital for on/off, analogue for variable). Then you would just call  pinMode(A0, OUTPUT); followed by digitalWrite(A0, HIGH); Here is a sketch I made demonstrating what I mean:

Note that a normal transistor would draw more current from the Arduino's pin, which could be bad for the Arduino, and which would waste energy.

13545: <p>I'm trying to find a way I can toggle the 5V pin to turn on/off. I want the voltage to pass to another wire at a certain point. It should be off and then when something happens, the 5V should turn on. </p>

<p>How can I do this?</p>
 313: <p>You don't really want to do that. The 5V pin is on the power bus of your Arduino board. If it <em>were</em> possible to turn it off, the entire Arduino would shut down.</p>
 6628: <p>There isn't programmatic control of the 5V pin, it is hard wired to the USB or the output of the Vin Voltage regulator.</p>

<p>You might try something from <a href="https://arduino.stackexchange.com/questions/403/how-can-higher-current-devices-motors-solenoids-lights-etc-be-controlled-b">How can higher current devices (motors, solenoids, lights, etc.) be controlled by an Arduino?</a> to control the low side of the external device.  If you need high-side control, maybe an opto-isolator would be a good solution.   </p>
 10907: <p>If I'm understanding you correctly, you want a 5 V output that is under programatic control. Do you know how much power you want to pull from the pin?</p>

<p>If the demand is fairly low, you could use one of the digital pins directly – they will supply about 40 mA on an "official" Arduino.</p>

<p>If you need more power, then you could use the pin to switch an external device such as a transistor or a relay.</p>
 15303: <p>For energy-efficient switching (along with relatively high-current capability), I recommend using a <em>Darlington</em> transistor connected to one of the output pins (digital for on/off, analogue for variable). Then you would just call  pinMode(A0, OUTPUT); followed by digitalWrite(A0, HIGH); Here is a sketch I made demonstrating what I mean:
<a href="https://i.stack.imgur.com/XcJlh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XcJlh.png" alt="enter image description here"></a></p>

<p>Note that a normal transistor would draw more current from the Arduino's pin, which could be bad for the Arduino, and which would waste energy.</p>
