Stufin
Home Quick Cart Profile

Rocker Switch Mini On Off SPST 2 Pin

Buy Now on Stufin

Component Name

Rocker Switch Mini On/Off SPST 2 Pin

Description

The Rocker Switch Mini On/Off SPST 2 Pin is a compact, single-pole single-throw (SPST) rocker switch designed for use in a variety of IoT applications. This component is a fundamental building block for controlling electronic circuits, allowing users to switch devices on or off with a simple, intuitive interface.

Functionality

The Rocker Switch Mini On/Off SPST 2 Pin serves as a binary switch, providing a simple on/off function. When the rocker switch is in the "on" position, the circuit is closed, allowing electrical current to flow through the device. When the switch is in the "off" position, the circuit is opened, interrupting the flow of electrical current.

Key Features

  • Compact Design: The Rocker Switch Mini On/Off SPST 2 Pin features a compact, space-saving design, making it ideal for use in IoT projects with limited real estate.
  • Single-Pole Single-Throw (SPST): The switch has two terminals, allowing it to control a single circuit or device.
  • On/Off Functionality: The switch provides a simple on/off function, making it suitable for a wide range of IoT applications.
  • 2-Pin Interface: The switch has a 2-pin interface, with one pin serving as the input and the other pin serving as the output.
  • Rocker Switch Mechanism: The switch features a rocker mechanism, allowing users to toggle the switch on and off with a gentle press of the rocker arm.
  • Durable Construction: The switch is built with durable materials, ensuring reliable performance over an extended period of time.
  • Easy Installation: The Rocker Switch Mini On/Off SPST 2 Pin is easy to install, with a simple mounting process that requires minimal technical expertise.
  • Low Power Consumption: The switch consumes minimal power, making it suitable for battery-powered IoT devices.

Operating Voltage

12V DC

Current Rating

5A

Contact Resistance

20m

Insulation Resistance

100M

Operating Temperature

-20C to 70C

Storage Temperature

-40C to 80C

Dimensions

12mm x 9mm x 5mm (L x W x H)

Applications

The Rocker Switch Mini On/Off SPST 2 Pin is suitable for a wide range of IoT applications, including

Home automation systems

Industrial control systems

Consumer electronics

Robotics and drone projects

DIY IoT projects

Wearable devices

Wiring Diagram

The wiring diagram for the Rocker Switch Mini On/Off SPST 2 Pin is as follows
Pin 1Input (device connection)
Pin 2Output (power connection)

When the switch is in the "on" position, the circuit is closed, connecting Pin 1 to Pin 2. When the switch is in the "off" position, the circuit is opened, disconnecting Pin 1 from Pin 2.

By following the wiring diagram and specifications, users can easily integrate the Rocker Switch Mini On/Off SPST 2 Pin into their IoT projects, providing a reliable and intuitive on/off function.

Pin Configuration

  • Rocker Switch Mini On Off SPST 2 Pin Documentation
  • Overview
  • The Rocker Switch Mini On Off SPST 2 Pin is a compact, single-pole single-throw (SPST) switch designed for ON/OFF applications. It features a rugged and durable construction, making it suitable for various IoT and electronics projects.
  • Pinout
  • The Rocker Switch Mini has two pins, labeled as follows:
  • Pin 1: COM (Common) Pin
  • Function: This pin is the common terminal of the switch, which connects to the power source or load.
  • Description: The COM pin is the central connection point for the switch, providing a path for the electrical current to flow when the switch is in the ON position.
  • Connection: Connect the COM pin to the positive terminal of the power source (VCC) or the load (e.g., an LED, relay, or sensor).
  • Pin 2: NC (Normally Closed) Pin
  • Function: This pin is the normally closed terminal of the switch, which connects to the load or circuit when the switch is in the OFF position.
  • Description: The NC pin is the second connection point for the switch, which completes the circuit when the switch is in the OFF position. When the switch is turned ON, the connection between COM and NC is broken, disconnecting the load or circuit.
  • Connection: Connect the NC pin to the negative terminal of the load (e.g., an LED, relay, or sensor). When the switch is in the OFF position, the NC pin will connect to the COM pin, completing the circuit.
  • Connection Structure
  • To connect the Rocker Switch Mini, follow these steps:
  • 1. Connect the COM pin to the positive terminal of the power source (VCC) or the load (e.g., an LED, relay, or sensor).
  • 2. Connect the NC pin to the negative terminal of the load (e.g., an LED, relay, or sensor).
  • Example Connection Diagram
  • Here's an example connection diagram for an LED circuit:
  • COM pin VCC (Positive Terminal)
  • NC pin LED Cathode (Negative Terminal)
  • LED Anode (Positive Terminal) Resistor GND (Ground)
  • When the switch is in the OFF position, the COM pin and NC pin are connected, completing the circuit and turning on the LED. When the switch is turned ON, the connection between COM and NC is broken, disconnecting the LED and turning it off.
  • Remember to always follow proper safety precautions and consider the voltage and current ratings of the switch and connected components when designing your project.

Code Examples

Rocker Switch Mini On Off SPST 2 Pin Documentation
Overview
The Rocker Switch Mini On Off SPST 2 Pin is a compact, single-pole single-throw (SPST) switch designed for use in a variety of IoT projects. This mini switch features a rugged construction, long lifespan, and high reliability, making it an ideal choice for applications requiring a simple on/off control.
Pinout
The Rocker Switch Mini has two pins:
Pin 1: Normally Open (NO)
 Pin 2: Common (COM)
Technical Specifications
Operating Voltage: 12VDC
 Current Rating: 2A
 Contact Resistance: 10m
 Insulation Resistance: 100M
 Operating Temperature: -20C to 85C
 Storage Temperature: -40C to 125C
Example 1: Basic On/Off Control with Arduino
In this example, we will use the Rocker Switch Mini to control an LED connected to an Arduino board.
Circuit Diagram
Connect the Rocker Switch Mini as follows:
Pin 1 (NO) to Digital Pin 2 on the Arduino board
 Pin 2 (COM) to GND on the Arduino board
 Connect an LED to Digital Pin 13 on the Arduino board
 Connect a 220 resistor in series with the LED to limit the current
Code
```c++
const int switchPin = 2;  // Rocker Switch Mini pin connected to digital pin 2
const int ledPin = 13;  // LED connected to digital pin 13
void setup() {
  pinMode(switchPin, INPUT);
  pinMode(ledPin, OUTPUT);
}
void loop() {
  int switchState = digitalRead(switchPin);
  if (switchState == HIGH) {
    digitalWrite(ledPin, HIGH);  // Turn on the LED
  } else {
    digitalWrite(ledPin, LOW);  // Turn off the LED
  }
  delay(50);
}
```
Example 2: Home Automation with ESP32 and MicroPython
In this example, we will use the Rocker Switch Mini to control a relay module connected to an ESP32 board running MicroPython.
Circuit Diagram
Connect the Rocker Switch Mini as follows:
Pin 1 (NO) to GPIO18 on the ESP32 board
 Pin 2 (COM) to GND on the ESP32 board
 Connect a relay module to GPIO23 on the ESP32 board
 Connect a load (e.g., a lamp) to the relay module
Code
```python
import machine
import utime
switch_pin = machine.Pin(18, machine.Pin.IN)  # Rocker Switch Mini pin connected to GPIO18
relay_pin = machine.Pin(23, machine.Pin.OUT)  # Relay module connected to GPIO23
while True:
    if switch_pin.value() == 1:
        relay_pin.value(1)  # Turn on the relay
    else:
        relay_pin.value(0)  # Turn off the relay
    utime.sleep(0.05)
```
These examples demonstrate the basic usage of the Rocker Switch Mini On Off SPST 2 Pin in various IoT projects. By connecting the switch to a microcontroller or a single-board computer, you can create a simple on/off control for any load.