Codey OnlineArduino & ESP32 component library › 5V DC
5V DC
Input & buttons

5V DC

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.

Width: 56.4 mm

Pinout — 5V DC

Pin Signal Description
5V - power 5V DC Negative wire
5V + power 5V DC Positive wire

Example wiring diagram — 5V DC

From To Wire
x1:+ board:5V red
x1:- board:GND black

Example Arduino code — 5V DC

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

Related components

12V DC power supply

12V DC power supply

Drukknop

Drukknop

HX711 Load Cell Amplifier

HX711 Load Cell Amplifier

Joystick module

Joystick module

Build your Arduino or ESP32 project with AI

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