This is a 5V direct-current power source used to power electronic circuits. It has two terminals, + and -, for connecting the positive and negative supply lines.
| Pin | Signal | Description |
|---|---|---|
5V - |
power | 5V DC Negative wire |
5V + |
power | 5V DC Positive wire |
| From | To | Wire |
|---|---|---|
x1:+ |
board:5V |
red |
x1:- |
board:GND |
black |
This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.
// Canonical beginner example for a 5V DC power source
// This example shows how to wire a 5V source to power the Arduino Uno.
// Note: Do not connect two power supplies to the Uno at the same time unless you know what you are doing.
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
Serial.println("5V DC source connected to Arduino UNO 5V and GND.");
Serial.println("The board is powered externally through the 5V pin.");
}
void loop() {
// No runtime control is needed for a power source example.
}
Describe what you want to build. Codey Online writes the code, draws the wiring diagram, compiles it and flashes your board straight from the browser.
Start for free