A USB plug is a standardized connector used to connect devices to a power source or to transfer data between devices. It is an essential component in modern electronics, enabling seamless communication and power delivery. USB plugs come in various types, including USB-A, USB-B, and USB-C, each designed for specific applications such as charging mobile devices, connecting peripherals, or transferring data between computers and external devices.
Pin Number | Name | Description |
---|---|---|
1 | VBUS | +5V Power |
2 | D- | Data Line (negative) |
3 | D+ | Data Line (positive) |
4 | GND | Ground |
Pin Number | Name | Description |
---|---|---|
A1, B1 | GND | Ground |
A2, B2 | TX1+ | SuperSpeed Differential Pair 1 (positive) |
A3, B3 | TX1- | SuperSpeed Differential Pair 1 (negative) |
A4, B4 | VBUS | +5V to +20V Power |
A5, B5 | CC1, CC2 | Configuration Channel |
A6, B6 | D+ | USB 2.0 Data Line (positive) |
A7, B7 | D- | USB 2.0 Data Line (negative) |
A8, B8 | SBU1, SBU2 | Sideband Use |
A9, B9 | RX2- | SuperSpeed Differential Pair 2 (negative) |
A10, B10 | RX2+ | SuperSpeed Differential Pair 2 (positive) |
To power an Arduino UNO using a USB plug, connect the USB-A plug to a 5V USB power source and plug the other end into the Arduino's USB port. If you are using a USB-C plug, ensure proper wiring of the VBUS and GND pins.
// This code demonstrates serial communication between an Arduino UNO
// and a computer via a USB connection.
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
while (!Serial) {
// Wait for the serial port to connect (for Leonardo/Micro boards)
}
Serial.println("USB Communication Initialized");
}
void loop() {
if (Serial.available() > 0) {
// Read incoming data from the USB serial connection
char received = Serial.read();
Serial.print("Received: ");
Serial.println(received); // Echo the received character
}
}
USB Plug Not Recognized by Device
Device Not Charging
Data Transfer Fails
Overheating
Q: Can I use a USB-C plug with older USB devices?
Q: How do I identify the pinout of a USB plug?
Q: Is it safe to use a USB plug for high-power devices?