

A toggle switch is a mechanical switch operated by a lever or handle, allowing the user to open or close a circuit. It is a versatile and reliable component commonly used to control power to devices. Toggle switches are available in various configurations, such as single-pole single-throw (SPST), single-pole double-throw (SPDT), double-pole single-throw (DPST), and double-pole double-throw (DPDT). These configurations make them suitable for a wide range of applications, including household appliances, automotive systems, industrial machinery, and DIY electronics projects.








Below are the general technical specifications for a standard toggle switch. Note that specific values may vary depending on the manufacturer and model.
The pin configuration of a toggle switch depends on its type. Below are the common configurations:
| Pin Number | Description |
|---|---|
| 1 | Input (connect to power source) |
| 2 | Output (connect to load) |
| Pin Number | Description |
|---|---|
| 1 | Common (connect to power source) |
| 2 | Normally Closed (NC) |
| 3 | Normally Open (NO) |
| Pin Number | Description |
|---|---|
| 1 | Common for Pole 1 |
| 2 | Normally Closed (NC) for Pole 1 |
| 3 | Normally Open (NO) for Pole 1 |
| 4 | Common for Pole 2 |
| 5 | Normally Closed (NC) for Pole 2 |
| 6 | Normally Open (NO) for Pole 2 |
Below is an example of how to use an SPST toggle switch to control an LED with an Arduino UNO.
// Define pin connections
const int toggleSwitchPin = 2; // Pin connected to the toggle switch
const int ledPin = 13; // Pin connected to the LED
void setup() {
pinMode(toggleSwitchPin, INPUT_PULLUP); // Set toggle switch pin as input with pull-up
pinMode(ledPin, OUTPUT); // Set LED pin as output
}
void loop() {
int switchState = digitalRead(toggleSwitchPin); // Read the state of the toggle switch
if (switchState == LOW) { // If the switch is toggled ON (connected to GND)
digitalWrite(ledPin, HIGH); // Turn the LED ON
} else {
digitalWrite(ledPin, LOW); // Turn the LED OFF
}
}
Note: The
INPUT_PULLUPmode is used to avoid the need for an external pull-up resistor. When the switch is ON, it connects the pin to GND, resulting in a LOW signal.
Switch Not Working:
Overheating:
Switch Bouncing:
LED Not Responding in Arduino Circuit:
Can I use a toggle switch for AC circuits?
What is the difference between SPST and SPDT?
How do I prevent accidental toggling?
Can I use a toggle switch to control multiple devices?
By following this documentation, you can effectively integrate a toggle switch into your projects and troubleshoot common issues with ease.