2 Pin SPST Switch (10pcs)
2 Pin SPST Switch (10pcs)
The 2 Pin SPST Switch is a type of electromechanical switch that is widely used in various electronic circuits and devices. This component is a single-pole single-throw (SPST) switch, meaning it has two terminals and can be in one of two states: open (off) or closed (on). This switch is a basic component used to control the flow of electrical current in a circuit.
The primary function of the 2 Pin SPST Switch is to connect or disconnect the circuit, allowing or blocking the flow of electrical current. When the switch is in the "on" position, the two terminals are connected, allowing current to flow through the circuit. When the switch is in the "off" position, the terminals are disconnected, breaking the circuit and stopping the flow of current.
The 2 Pin SPST Switch is suitable for a wide range of applications, including:
2
SPST (Single-Pole Single-Throw)
Depends on the specific application (consult datasheet or manufacturer's instructions)
Depends on the specific application (consult datasheet or manufacturer's instructions)
Compact size, approximately [insert dimensions]
Lightweight, approximately [insert weight]
-20C to 80C (consult datasheet or manufacturer's instructions)
-40C to 125C (consult datasheet or manufacturer's instructions)
Consult the datasheet or manufacturer's instructions for specific operating voltage, current, and temperature ratings.
Handle the switch with care to avoid damage or electrical shock.
Ensure proper installation and wiring to avoid electrical shock or fire hazards.
2 Pin SPST Switch (10pcs) DocumentationOverviewThe 2 Pin SPST (Single Pole Single Throw) switch is a simple, versatile, and widely used component in electronics and IoT projects. This component is a manual switch that allows a user to connect or disconnect a circuit. This documentation provides an overview of the component, its pinout, and examples of how to use it in various contexts.PinoutThe 2 Pin SPST switch has two terminals:Pin 1 ( Normally Open (NO) ): This pin is connected to the load or the circuit that needs to be controlled.
Pin 2 ( Common (COM) ):: This pin is connected to the power source or the circuit that provides power to the load.How it WorksWhen the switch is in the OFF position, Pin 1 (NO) and Pin 2 (COM) are disconnected, and the circuit is broken. When the switch is in the ON position, Pin 1 (NO) and Pin 2 (COM) are connected, and the circuit is complete.Code ExamplesHere are a few examples that demonstrate how to use the 2 Pin SPST switch in various contexts:Example 1: Simple LED CircuitIn this example, we will use the 2 Pin SPST switch to control an LED circuit.Hardware Requirements:1 x 2 Pin SPST switch
1 x LED
1 x 1k Resistor
1 x Breadboard
1 x Power Source (e.g., 9V Battery)connections:Pin 1 (NO) of the switch to the positive leg of the LED
Pin 2 (COM) of the switch to the power source (e.g., 9V Battery)
Negative leg of the LED to the 1k Resistor
The other end of the 1k Resistor to the negative terminal of the power source (e.g., 9V Battery)Code:Not applicable, as this is a simple manual switch circuit.Example 2: Arduino Controlled RelayIn this example, we will use the 2 Pin SPST switch to control a relay module using an Arduino board.Hardware Requirements:1 x 2 Pin SPST switch
1 x Arduino Board (e.g., Arduino Uno)
1 x Relay Module (e.g., SRD-05VDC-SL-C)
1 x Breadboard
Jumper Wiresconnections:Pin 1 (NO) of the switch to Digital Pin 2 of the Arduino Board
Pin 2 (COM) of the switch to the VCC pin of the Arduino Board
Relay Module:
+ VCC to the VCC pin of the Arduino Board
+ GND to the GND pin of the Arduino Board
+ IN to Digital Pin 3 of the Arduino BoardCode:
```c
const int switchPin = 2; // Pin connected to the switch
const int relayPin = 3; // Pin connected to the relay modulevoid setup() {
pinMode(switchPin, INPUT);
pinMode(relayPin, OUTPUT);
}void loop() {
if (digitalRead(switchPin) == HIGH) {
digitalWrite(relayPin, HIGH); // Turn on the relay
} else {
digitalWrite(relayPin, LOW); // Turn off the relay
}
delay(50);
}
```
This code reads the state of the switch and controls the relay module accordingly.Note: The colour of the switch may vary, but the functionality remains the same.