A Single Pole Single Throw (SPST) toggle switch is a simple yet essential component in electronics. It operates as a binary device, with two positions: ON and OFF. This type of switch controls a single circuit, making or breaking the connection with a single action. SPST toggle switches are widely used in household appliances, industrial equipment, and hobby electronics for controlling power or as a user interface component.
Pin Number | Description |
---|---|
1 | Common terminal (C) |
2 | Normally Open (NO) |
Q: Can I use this switch with a DC power supply? A: Yes, but ensure the DC voltage and current do not exceed the switch's ratings.
Q: What does SPST mean? A: SPST stands for Single Pole Single Throw, indicating the switch controls one circuit and has two positions.
Q: Is it possible to use the switch with an Arduino? A: Absolutely. The switch can serve as a simple digital input for an Arduino.
// Define the pin connected to the toggle switch
const int toggleSwitchPin = 2;
void setup() {
// Set the toggle switch pin as an input
pinMode(toggleSwitchPin, INPUT);
// Initialize serial communication at 9600 bits per second
Serial.begin(9600);
}
void loop() {
// Read the state of the toggle switch
int switchState = digitalRead(toggleSwitchPin);
// Print the state of the switch to the Serial Monitor
Serial.println(switchState);
delay(500); // Delay for half a second
}
Note: In this example, the common terminal of the switch should be connected to the GND pin on the Arduino, and the normally open terminal to digital pin 2. When the switch is in the ON position, the digital pin reads LOW due to the pull-up resistor enabled by default on the input pins.