

A 4-pin rocker switch is a type of electrical switch that toggles between two positions, typically ON and OFF, to control the flow of power in a circuit. It is designed with four pins, which allow for versatile wiring configurations, such as single-pole double-throw (SPDT) or double-pole single-throw (DPST) setups. This switch is widely used in household appliances, automotive systems, and electronic devices due to its durability and ease of use.








The 4-pin rocker switch typically has the following pin layout:
| Pin Number | Label | Description |
|---|---|---|
| 1 | Input (L1) | Connects to the live (hot) wire of the power source. |
| 2 | Output (L2) | Connects to the load (e.g., device or appliance). |
| 3 | Input (L3) | Optional second live input for dual-pole configurations. |
| 4 | Output (L4) | Optional second output for dual-pole configurations or additional circuitry. |
Note: The exact pin labeling may vary depending on the manufacturer. Always refer to the datasheet for your specific model.
A 4-pin rocker switch can be used as an input to an Arduino UNO to control an LED. Below is an example circuit and code:
// Define pin numbers
const int switchPin = 2; // Pin connected to the rocker switch
const int ledPin = 13; // Pin connected to the LED
void setup() {
pinMode(switchPin, INPUT); // Set the switch pin as input
pinMode(ledPin, OUTPUT); // Set the LED pin as output
digitalWrite(ledPin, LOW); // Ensure LED is off initially
}
void loop() {
int switchState = digitalRead(switchPin); // Read the state of the switch
if (switchState == HIGH) {
// If the switch is ON, turn the LED on
digitalWrite(ledPin, HIGH);
} else {
// If the switch is OFF, turn the LED off
digitalWrite(ledPin, LOW);
}
}
Note: The pull-down resistor ensures the input pin reads LOW when the switch is open.
Switch Not Working:
Overheating:
Erratic Behavior in Digital Circuits:
LED Not Turning On in Arduino Circuit:
Q: Can I use a 4-pin rocker switch for DC circuits?
Q: What is the difference between SPDT and DPST configurations?
Q: How do I know which pin is which?
By following this documentation, you can effectively use the RockerSwitch4Pin in your projects and troubleshoot common issues with ease.