A rocker switch is a type of on/off switch that toggles between two positions, functioning as a binary device to open or close an electrical circuit. It is named for its rocking mechanism, which pivots around a central point to change the state of the switch. Rocker switches are widely used in various applications, including household appliances, automotive controls, industrial machinery, and electronic devices.
Specification | Detail |
---|---|
Voltage Rating | Typically 120-250V AC |
Current Rating | Commonly up to 15A |
Contact Configuration | SPST, SPDT, DPST, DPDT |
Terminal Type | Solder, Quick Connect |
Mounting Style | Panel Mount |
Actuator | Rocker |
Body Material | Plastic or Metal |
Illumination | Optional (LED, Neon) |
Pin | Description |
---|---|
1 | Input (Power) |
2 | Output (Load) |
Pin | Description |
---|---|
1 | Common |
2 | Normally Open (NO) |
3 | Normally Closed (NC) |
Pin | Description |
---|---|
1 | Input 1 (Power) |
2 | Output 1 (Load) |
3 | Input 2 (Power) |
4 | Output 2 (Load) |
Pin | Description |
---|---|
1 | Common 1 |
2 | NO 1 |
3 | NC 1 |
4 | Common 2 |
5 | NO 2 |
6 | NC 2 |
Q: Can I use a rocker switch with a DC circuit? A: Yes, rocker switches can be used with both AC and DC circuits, but ensure the DC voltage and current do not exceed the switch's ratings.
Q: How do I know if my rocker switch is illuminated? A: Illuminated rocker switches typically have additional terminals for the light source and may have a clear or translucent actuator.
Q: What does SPST, SPDT, DPST, and DPDT mean? A: These acronyms refer to the internal configuration of the switch: Single Pole Single Throw, Single Pole Double Throw, Double Pole Single Throw, and Double Pole Double Throw, respectively.
// Define the pin connected to the rocker switch
const int rockerSwitchPin = 2;
void setup() {
// Set the rocker switch pin as input
pinMode(rockerSwitchPin, INPUT);
// Initialize serial communication at 9600 bits per second
Serial.begin(9600);
}
void loop() {
// Read the state of the rocker switch
int switchState = digitalRead(rockerSwitchPin);
// Print the state of the switch to the Serial Monitor
Serial.print("Switch State: ");
if (switchState == HIGH) {
Serial.println("ON");
} else {
Serial.println("OFF");
}
// Delay for a bit to avoid bouncing issues
delay(50);
}
Note: The above code assumes the rocker switch is wired to provide a HIGH signal when in the ON position. If the switch is wired to provide a LOW signal when ON, the logic in the code should be inverted accordingly.