

A rocker switch is a type of electrical switch that operates by rocking a lever back and forth. It is widely used to control the flow of electrical power to devices, offering a simple on/off functionality. Rocker switches are commonly found in household appliances, power tools, automotive dashboards, and industrial equipment due to their durability and ease of use.








Below is a typical pin configuration for a SPST rocker switch:
| Pin Number | Label | Description |
|---|---|---|
| 1 | Input | Connects to the power source (e.g., +12V) |
| 2 | Output | Connects to the load (e.g., device input) |
| 3 (optional) | Ground | Used for illumination (if LED is present) |
For a DPDT rocker switch, the pin configuration may look like this:
| Pin Number | Label | Description |
|---|---|---|
| 1 | Input 1 | First input terminal |
| 2 | Output 1 | First output terminal |
| 3 | Input 2 | Second input terminal |
| 4 | Output 2 | Second output terminal |
| 5 (optional) | LED+ | Positive terminal for LED illumination |
| 6 (optional) | LED- | Negative terminal for LED illumination |
Below is an example of using a SPST rocker switch to control an LED with an Arduino UNO:
// Define pin connections
const int switchPin = 2; // Pin connected to the rocker switch
const int ledPin = 13; // Pin connected to the onboard LED
void setup() {
pinMode(switchPin, INPUT_PULLUP); // Set switch pin as input with pull-up resistor
pinMode(ledPin, OUTPUT); // Set LED pin as output
}
void loop() {
int switchState = digitalRead(switchPin); // Read the state of the switch
if (switchState == LOW) { // If switch is pressed (LOW due to pull-up)
digitalWrite(ledPin, HIGH); // Turn on the LED
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
}
}
INPUT_PULLUP mode is used to simplify wiring by enabling the internal pull-up resistor.LOW signal.Switch Not Working:
LED Indicator Not Lighting Up:
Switch Feels Loose in the Panel:
Switch Overheating:
Q: Can I use a rocker switch to control DC circuits?
Q: How do I know if my rocker switch is SPST or DPDT?
Q: Can I use a rocker switch without an LED?
Q: What is the difference between maintained and momentary rocker switches?