Pin Number | Description | Notes |
---|---|---|
1 | Signal or Power Connection | Connects to the signal or VCC |
2 | Ground (GND) Connection | Connects to the circuit ground |
The 2 pin Dupont connector is commonly used to connect sensors or modules to an Arduino UNO. Below is an example of connecting a simple push-button to an Arduino using a 2 pin Dupont connector.
// Example code for using a push-button with a 2 pin Dupont connector
// connected to an Arduino UNO. The button state is read and printed
// to the Serial Monitor.
const int buttonPin = 2; // Pin connected to the button's signal pin
int buttonState = 0; // Variable to store the button state
void setup() {
pinMode(buttonPin, INPUT); // Set the button pin as an input
Serial.begin(9600); // Initialize serial communication
}
void loop() {
buttonState = digitalRead(buttonPin); // Read the button state
// Print the button state to the Serial Monitor
if (buttonState == HIGH) {
Serial.println("Button Pressed");
} else {
Serial.println("Button Released");
}
delay(100); // Small delay to debounce the button
}
Loose Connections:
Intermittent Signal:
Connector Does Not Fit:
Q: Can I use the 2 pin Dupont connector for high-current applications?
A: The connector is rated for up to 3A, but this depends on the wire gauge and crimp quality. For higher currents, consider using connectors specifically designed for high-power applications.
Q: How do I remove a pin from the housing?
A: Use a small flathead screwdriver or a Dupont pin removal tool to gently press the locking tab inside the housing and pull the pin out.
Q: Can I reuse the plastic housing and pins?
A: The housing can be reused if undamaged. However, crimped pins are typically not reusable as they may lose their integrity when removed.