Codey OnlineArduino & ESP32 component library › 12V DC power supply
12V DC power supply
Input & buttons

12V DC power supply

A 12V DC source or supply connection for powering compatible circuits with direct current. It uses two terminals, + and -, and must be connected with correct polarity. It is typically used as an external power input rather than a signal component.

Width: 66.3 mm

Pinout — 12V DC power supply

Pin Signal Description
12V - power 12V DC negative wire
12V + power 12V DC positive wire

Example wiring diagram — 12V DC power supply

From To Wire
board:GND x1:- black

Example Arduino code — 12V DC power supply

This example was written and compile-checked for the arduino-uno. Codey Online adapts it to any other supported board for you.

// Canonical example for a 12V DC source component
// Note: This is a passive power source. It is not controlled by the Arduino,
// so the example focuses on the safety connection of the negative terminal to GND.

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  Serial.println("12V DC source example");
  Serial.println("Connect the negative terminal of the 12V supply to Arduino GND.");
  Serial.println("The positive terminal is intentionally left unconnected in this canonical example.");
}

void loop() {
  // No runtime action: this component is a DC power source.
}

Related components

5V DC

5V DC

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