Dupont male and female connectors
Dupont male and female connectors
2.54mm
Various lengths available (e.g., 10cm, 20cm, 30cm)
Single-row and double-row pin headers
Copper wire with PVC insulation
-20C to 80C
250V AC/DC
Conclusion
The Dupont Connector 2.54mm Pitch Dupont Cable Jumper Wire Pin Header Housing Assorted Kit is a comprehensive and versatile solution for connecting and disconnecting devices, sensors, and modules in a wide range of applications. With its reliable connections, easy assembly and disassembly, and compact design, this kit is an essential tool for any electronic or IoT project.
Dupont Connector 2.54mm Pitch Dupont Cable Jumper Wire Pin Header Housing Assorted Kit Documentation
Overview
The Dupont Connector 2.54mm Pitch Dupont Cable Jumper Wire Pin Header Housing Assorted Kit is a comprehensive set of connectors and wires used to establish connections between various IoT devices, microcontrollers, and breadboards. This kit includes a variety of Dupont connectors, jumper wires, and pin header housings with a 2.54mm pitch, making it an ideal solution for prototyping and development of IoT projects.
Components Included
Dupont connectors (male and female)
Jumper wires (assorted lengths and colors)
Pin header housings (single-row and dual-row)
Features
2.54mm pitch for compatibility with standard breadboards and PCBs
High-quality, durable construction for reliable connections
Assorted lengths and colors of jumper wires for ease of use
Pin header housings for secure connections to microcontrollers and other devices
Code Examples
### Example 1: Connecting an Arduino to a Breadboard using Dupont Connectors
In this example, we will demonstrate how to connect an Arduino Uno to a breadboard using the Dupont connectors and jumper wires.
Hardware Requirements
Arduino Uno
Breadboard
Dupont connectors (male and female)
Jumper wires (assorted lengths and colors)
Code
```c
const int ledPin = 13; // LED connected to digital pin 13
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
```
Connection
1. Connect the female Dupont connector to the breadboard.
2. Connect the male Dupont connector to the Arduino Uno's digital pin 13.
3. Connect the LED to the breadboard, ensuring it is connected to digital pin 13.
4. Power on the Arduino and observe the LED blinking.
### Example 2: Connecting a Sensor to a Raspberry Pi using Pin Header Housing
In this example, we will demonstrate how to connect a temperature sensor (DS18B20) to a Raspberry Pi using the pin header housing and jumper wires.
Hardware Requirements
Raspberry Pi
DS18B20 temperature sensor
Pin header housing (single-row)
Jumper wires (assorted lengths and colors)
Code
```python
import datetime
import os
# Import the necessary libraries
import glob
import time
# Set up the temperature sensor
os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
# Set the temperature sensor file
base_dir = '/sys/bus/w1/devices/'
device_folder = glob.glob(base_dir + '28')[0]
device_file = device_folder + '/w1_slave'
# Read the temperature data
def read_temp_raw():
f = open(device_file, 'r')
lines = f.readlines()
f.close()
return lines
def read_temp():
lines = read_temp_raw()
while lines[0].strip()[-3:] != 'YES':
time.sleep(0.2)
lines = read_temp_raw()
temp_output = lines[1].find('t=')
if temp_output != -1:
temp_string = lines[1].strip()[temp_output+2:]
temp_c = float(temp_string) / 1000.0
return temp_c
while True:
print("Temperature: {:.2f}C".format(read_temp()))
time.sleep(1)
```
Connection
1. Connect the pin header housing to the Raspberry Pi's GPIO pins.
2. Connect the DS18B20 temperature sensor to the pin header housing, ensuring it is connected to the correct GPIO pins.
3. Connect the jumper wires to the pin header housing and the temperature sensor.
4. Power on the Raspberry Pi and run the Python script to read the temperature data.
Note: This documentation is a general guide and may require modifications based on specific use cases and project requirements. Ensure you follow proper safety protocols and refer to the datasheets of individual components for detailed specifications.