A Rocker Switch is a type of on/off switch that toggles between two positions, functioning as a binary device in electrical circuits. The 4-Pin Rocker Switch is a common variant that features two sets of terminals, which allows it to control a single device or circuit. It is widely used in household appliances, automotive applications, industrial machinery, and electronic devices due to its ease of operation and reliability.
Pin Number | Description | Notes |
---|---|---|
1 | Input/Output Terminal 1 | Connect to power supply or load |
2 | Input/Output Terminal 1 | Connect to power supply or load |
3 | Switch Contact Terminal 1 | Connect to load or power supply |
4 | Switch Contact Terminal 2 | Connect to load or power supply |
Note: Pins 1 and 2 are electrically connected when the switch is in the "on" position, as are pins 3 and 4.
Q: Can I use the Rocker Switch with a DC circuit? A: Yes, but ensure that the DC voltage and current do not exceed the switch's AC ratings.
Q: How do I know if the switch is in the "on" position? A: Typically, the side of the switch that is pressed down indicates the "on" position, but this can vary with design.
Q: Is it possible to control two separate circuits with a 4-pin Rocker Switch? A: No, a 4-pin Rocker Switch is designed to control one circuit. For controlling two circuits, a switch with more pins and a different configuration would be required.
The following is an example of how to use a 4-Pin Rocker Switch with an Arduino UNO to control an LED.
// Define the pin connected to the Rocker Switch
const int rockerSwitchPin = 2;
// Define the pin connected to the LED
const int ledPin = 13;
void setup() {
// Set the LED pin as an output
pinMode(ledPin, OUTPUT);
// Set the Rocker Switch pin as an input
pinMode(rockerSwitchPin, INPUT);
}
void loop() {
// Read the state of the Rocker Switch
int switchState = digitalRead(rockerSwitchPin);
// If the switch is in the "on" position, turn on the LED
if (switchState == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
// If the switch is in the "off" position, turn off the LED
digitalWrite(ledPin, LOW);
}
}
Note: In this example, the Rocker Switch is assumed to be connected to the Arduino such that it closes the circuit between the rockerSwitchPin
and ground when in the "on" position.