









| Pin Number | Name | Description | 
|---|---|---|
| 1 | Terminal 1 | Connects to one side of the circuit | 
| 2 | Terminal 2 | Connects to the other side of the circuit | 
Connecting the SPST Switch in a Circuit:
Important Considerations:
Using an SPST Switch with an Arduino UNO:
// Example code for using an SPST switch with Arduino UNO
const int switchPin = 2;  // Pin connected to the SPST switch
const int ledPin = 13;    // Pin connected to the onboard LED
void setup() {
  pinMode(switchPin, INPUT_PULLUP); // Enable internal 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) { // Switch is pressed (connected to ground)
    digitalWrite(ledPin, HIGH); // Turn on the LED
  } else { // Switch is not pressed
    digitalWrite(ledPin, LOW);  // Turn off the LED
  }
}
Switch does not work or fails to control the circuit:
Switch generates sparks or arcs when toggled:
Arduino does not detect the switch state correctly:
Can I use an SPST switch for AC circuits?
What is the difference between SPST and SPDT switches?
How do I test if an SPST switch is working?