Stufin
Home Quick Cart Profile

4 Way Slide Switch 2.54mm Pitch (Pack of 2)

Buy Now

Component Name

4 Way Slide Switch 2.54mm Pitch (Pack of 2)

Overview

The 4 Way Slide Switch 2.54mm Pitch is a type of electronic switch component designed for use in various IoT projects and applications. This component consists of two identical switches, each featuring a 4-way slide mechanism that allows for simple and intuitive control over digital circuits. With a compact design and 2.54mm pitch, this switch is ideal for use in breadboards, perfboards, and PCBs.

Functionality

The primary function of the 4 Way Slide Switch 2.54mm Pitch is to provide a means of controlling the flow of electrical signals in a circuit. The switch features four positions, allowing the user to select one of four possible states or configurations. This makes it ideal for applications that require multiple settings or options, such as mode selection, signal routing, or configuration choices.

Key Features

  • 4-Way Slide Mechanism: The switch features a smooth, reliable slide mechanism that allows the user to select one of four positions.
  • 2.54mm Pitch: The switch has a standard 2.54mm pitch, making it compatible with breadboards, perfboards, and PCBs.
  • Compact Design: The switch is designed to be compact, allowing for easy integration into a wide range of projects and applications.
  • Pack of 2: This component comes in a pack of two identical switches, providing flexibility and convenience for designers and engineers.
  • Easy to Use: The slide switch is easy to operate, with a clear and intuitive mechanism that makes it simple to select the desired position.
  • Reliable Operation: The switch is designed for reliable operation, with a durable construction that can withstand repeated use and switching cycles.
  • Low Profile: The switch has a low profile, making it ideal for use in compact or space-constrained designs.

Operating Voltage

50V DC

Current Rating

0.5A per pole

Contact Resistance

50m

Insulation Resistance

100M

Operating Temperature

-20C to 70C

Storage Temperature

-30C to 80C

Humidity

40C, 90% RH

Applications

The 4 Way Slide Switch 2.54mm Pitch is suitable for a wide range of IoT applications, including

Mode selection in electronic devices

Signal routing and configuration in digital circuits

Configuration choices in IoT devices

Prototype development and testing

Educational projects and DIY electronics

Package Contents

The package includes two 4-way slide switches, each with a 2.54mm pitch. The switches are identical and can be used in a variety of applications.

Pin Configuration

  • 4 Way Slide Switch 2.54mm Pitch (Pack of 2) Documentation
  • Overview
  • The 4 Way Slide Switch is a type of electromechanical switch that allows the user to select one of four possible positions. It features a compact design with a 2.54mm pitch and is available in a pack of 2. This documentation provides a detailed explanation of the switch's pins and their connections.
  • Pinout Explanation
  • The 4 Way Slide Switch has 6 pins, numbered from 1 to 6, as shown below:
  • Pin 1: COM (Common)
  • Function: This pin is the common terminal that connects to all four output pins.
  • Connection: Connect to a power source, ground, or a signal line, depending on the application.
  • Pin 2: NC1 (Normally Closed 1)
  • Function: This pin is normally connected to the COM pin when the switch is in the first position.
  • Connection: Connect to a load, sensor, or another circuit component that needs to be controlled by the switch.
  • Pin 3: NC2 (Normally Closed 2)
  • Function: This pin is normally connected to the COM pin when the switch is in the second position.
  • Connection: Connect to a load, sensor, or another circuit component that needs to be controlled by the switch.
  • Pin 4: NC3 (Normally Closed 3)
  • Function: This pin is normally connected to the COM pin when the switch is in the third position.
  • Connection: Connect to a load, sensor, or another circuit component that needs to be controlled by the switch.
  • Pin 5: NC4 (Normally Closed 4)
  • Function: This pin is normally connected to the COM pin when the switch is in the fourth position.
  • Connection: Connect to a load, sensor, or another circuit component that needs to be controlled by the switch.
  • Pin 6: No Connection
  • Function: This pin has no internal connection and is not used.
  • Connection Structure
  • Here's a general connection structure for the 4 Way Slide Switch:
  • Connect Pin 1 (COM) to a power source, ground, or a signal line.
  • Connect Pins 2-5 (NC1-NC4) to individual loads, sensors, or other circuit components that need to be controlled by the switch.
  • Move the slider to select the desired position, connecting the COM pin to one of the NC pins.
  • The switch can be used to control multiple circuits or loads by connecting each NC pin to a separate circuit.
  • Example Applications
  • Use the 4 Way Slide Switch to select between four different sensors or inputs in a IoT project.
  • Control four separate LED lights or relays in a home automation system.
  • Implement a simple rotary encoder functionality using the 4 Way Slide Switch and a microcontroller.
  • Remember to handle the switch with care, as it is a mechanical component that can be damaged by excessive force or misuse.

Code Examples

4 Way Slide Switch 2.54mm Pitch (Pack of 2) Component Documentation
Overview
The 4 Way Slide Switch 2.54mm Pitch is a compact, SP4T (Single Pole Four Throw) slide switch designed for electronic projects that require multiple circuit connections. This component is ideal for IoT applications, robotics, and other projects that require reliable switching mechanisms.
Pinout and Technical Parameters
Pinout:
	+ 4 ways (COM, NC1, NC2, NO1, and NO2)
	+ 2.54mm pitch
 Operating Voltage: 30V DC
 Operating Current: 0.5A per contact
 Insulation Resistance: 100M min. at 500V DC
 ContactResistance: 20m max.
 Operating Temperature: -40C to 85C
 Storage Temperature: -40C to 125C
Code Examples
The following code examples demonstrate how to use the 4 Way Slide Switch in various contexts:
Example 1: Arduino Uno - Simple Switching
In this example, we'll use the 4 Way Slide Switch to control four LEDs connected to digital pins 2-5 on an Arduino Uno board.
```c
const int ledPins[] = {2, 3, 4, 5};  // LED pins
const int switchPin = A0;  // Analog input pin for switch
void setup() {
  for (int i = 0; i < 4; i++) {
    pinMode(ledPins[i], OUTPUT);
  }
  pinMode(switchPin, INPUT);
}
void loop() {
  int switchState = analogRead(switchPin);
  switch (switchState) {
    case 0:  // Switch position 1
      digitalWrite(ledPins[0], HIGH);
      digitalWrite(ledPins[1], LOW);
      digitalWrite(ledPins[2], LOW);
      digitalWrite(ledPins[3], LOW);
      break;
    case 1023:  // Switch position 2
      digitalWrite(ledPins[0], LOW);
      digitalWrite(ledPins[1], HIGH);
      digitalWrite(ledPins[2], LOW);
      digitalWrite(ledPins[3], LOW);
      break;
    case 512:  // Switch position 3
      digitalWrite(ledPins[0], LOW);
      digitalWrite(ledPins[1], LOW);
      digitalWrite(ledPins[2], HIGH);
      digitalWrite(ledPins[3], LOW);
      break;
    case 255:  // Switch position 4
      digitalWrite(ledPins[0], LOW);
      digitalWrite(ledPins[1], LOW);
      digitalWrite(ledPins[2], LOW);
      digitalWrite(ledPins[3], HIGH);
      break;
  }
  delay(50);
}
```
Example 2: Raspberry Pi - Python Script
In this example, we'll use the 4 Way Slide Switch to control four relays connected to a Raspberry Pi's GPIO pins.
```python
import RPi.GPIO as GPIO
import time
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define relay pins
relay_pins = [17, 23, 24, 25]
# Define switch pin
switch_pin = 18
# Set up relay pins as outputs
for pin in relay_pins:
    GPIO.setup(pin, GPIO.OUT)
# Set up switch pin as input
GPIO.setup(switch_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
try:
    while True:
        switch_state = GPIO.input(switch_pin)
        if switch_state == GPIO.HIGH:
            # Switch position 1
            GPIO.output(relay_pins[0], GPIO.HIGH)
            GPIO.output(relay_pins[1], GPIO.LOW)
            GPIO.output(relay_pins[2], GPIO.LOW)
            GPIO.output(relay_pins[3], GPIO.LOW)
        else:
            # Switch position 2, 3, or 4
            if switch_state == 0:
                # Switch position 2
                GPIO.output(relay_pins[0], GPIO.LOW)
                GPIO.output(relay_pins[1], GPIO.HIGH)
                GPIO.output(relay_pins[2], GPIO.LOW)
                GPIO.output(relay_pins[3], GPIO.LOW)
            elif switch_state == 1:
                # Switch position 3
                GPIO.output(relay_pins[0], GPIO.LOW)
                GPIO.output(relay_pins[1], GPIO.LOW)
                GPIO.output(relay_pins[2], GPIO.HIGH)
                GPIO.output(relay_pins[3], GPIO.LOW)
            else:
                # Switch position 4
                GPIO.output(relay_pins[0], GPIO.LOW)
                GPIO.output(relay_pins[1], GPIO.LOW)
                GPIO.output(relay_pins[2], GPIO.LOW)
                GPIO.output(relay_pins[3], GPIO.HIGH)
        time.sleep(0.1)
except KeyboardInterrupt:
    # Clean up GPIO on exit
    GPIO.cleanup()
```
Note: These code examples are for illustration purposes only and may require modifications to work with your specific project requirements.