Male to Male Jumper Wires (20cm) (20pcs)
The Male to Male Jumper Wires (20cm) (20pcs) is a set of 20 jumper wires with male connectors on both ends, each measuring 20cm in length. These wires are commonly used to connect microcontrollers, sensors, and other components in IoT projects. They are ideal for prototyping, testing, and debugging electronic circuits.
Length: 20cm
Wire gauge: 20 AWG (0.8 mm)
Insulation material: PVC
Connector type: Male-to-Male
Quantity: 20 pieces
Color: Multicolored (10 colors, 2 wires per color)
### Example 1: Connecting an Arduino Board to a Breadboard
In this example, we will use the Male to Male Jumper Wires to connect an Arduino Uno board to a breadboard.
Arduino Uno board
Breadboard
Male to Male Jumper Wires (20cm) (20pcs)
Code
```c++
void setup() {
// Initialize digital pin 13 as an output
pinMode(13, OUTPUT);
}
void loop() {
// Blink the built-in LED on digital pin 13
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}
```
Connections
Connect the Male to Male Jumper Wire to digital pin 13 on the Arduino Uno board.
Connect the other end of the jumper wire to a row on the breadboard.
Connect a LED to the same row on the breadboard.
### Example 2: Connecting a Sensor to a Raspberry Pi
In this example, we will use the Male to Male Jumper Wires to connect a temperature sensor to a Raspberry Pi.
Raspberry Pi
Temperature sensor (e.g., DS18B20)
Male to Male Jumper Wires (20cm) (20pcs)
Code
```python
import os
import time
# Set up the temperature sensor
os.system('modprobe w1-gpio')
os.system('modprobe w1-therm')
# Read the temperature from the sensor
while True:
temp_sensor = '/sys/bus/w1/devices/28-000008a6b3e3/w1_slave'
temp_data = open(temp_sensor, 'r').read()
temp = float(temp_data.split('=')[1]) / 1000
print('Temperature: {:.2f}C'.format(temp))
time.sleep(1)
```
Connections
Connect the Male to Male Jumper Wire to the VCC pin on the temperature sensor.
Connect the other end of the jumper wire to a 3.3V pin on the Raspberry Pi.
Connect the Male to Male Jumper Wire to the GND pin on the temperature sensor.
Connect the other end of the jumper wire to a GND pin on the Raspberry Pi.
Connect the Male to Male Jumper Wire to the DATA pin on the temperature sensor.
Connect the other end of the jumper wire to a GPIO pin on the Raspberry Pi (e.g., GPIO 4).