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

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

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

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

5V DC

5V DC

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

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