

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 and is characterized by its simple on/off functionality. Rocker switches are commonly found in household appliances, power tools, automotive systems, and industrial equipment due to their durability and ease of use.








The pin configuration of a rocker switch depends on its type. Below are examples for SPST and DPDT configurations:
| Pin Number | Description |
|---|---|
| 1 | Input terminal (connect to power source) |
| 2 | Output terminal (connect to load) |
| Pin Number | Description |
|---|---|
| 1 | Input terminal 1 (connect to power source) |
| 2 | Output terminal 1 (connect to load) |
| 3 | Input terminal 2 (connect to power source) |
| 4 | Output terminal 2 (connect to load) |
| 5 | Common terminal 1 (optional, for switching) |
| 6 | Common terminal 2 (optional, for switching) |
Below is an example of using a rocker switch to control an LED with an Arduino UNO:
// Define pin connections
const int switchPin = 2; // Rocker switch connected to digital pin 2
const int ledPin = 13; // LED connected to digital pin 13
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
}
}
Switch Does Not Toggle Power:
Switch Feels Loose or Does Not Stay in Position:
Intermittent Operation:
Switch Overheats:
Q: Can I use a rocker switch for DC circuits?
A: Yes, rocker switches can be used for both AC and DC circuits, but ensure the voltage and current ratings are suitable for your application.
Q: How do I know if my rocker switch is SPST or DPDT?
A: Check the number of terminals and the datasheet or labeling on the switch. SPST switches typically have two terminals, while DPDT switches have six.
Q: Do rocker switches require external resistors?
A: For basic on/off functionality, resistors are not required. However, for digital circuits, pull-up or pull-down resistors may be needed to stabilize the signal.
Q: Can I use a rocker switch to control high-power devices?
A: Yes, but ensure the switch's current and voltage ratings are sufficient for the device. For very high-power applications, consider using a relay in conjunction with the switch.