Codey Online › Arduino & ESP32 component library › 5V DC
5V DC
Power supply

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

DC-DC High Power Adjustable Step-up Module 3.0~35V to 3.5~35V 100W with Digital Display Voltmeter

DC-DC High Power Adjustable Step-up Module 3.0~35V to 3.5~35V 100W with Digital Display Voltmeter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

18650 Battery Shield with USB-C Charger and 5V Boost Converter

MT3608 2A Max DC-DC Step Up Power Module Booster Power Module

MT3608 2A Max DC-DC Step Up Power Module Booster Power 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