> Source: https://www.tinkered.ai/components/slide-switch (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/slide-switch. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# Slide Switch (SPDT)

A three-pin SPDT slide switch that stays where you put it: the simplest way to add an on/off or mode selector to a circuit.

Source page: https://www.tinkered.ai/components/slide-switch

## In short

An SPDT slide switch connects its middle pin (COM) to one outer pin or the other and stays there; the common SS-12D00 is rated 0.3 A at 30 V DC with 30 mΩ max contact resistance (Vimex SS-12D00 specification). To read it, wire COM to a digital pin, one outer pin to GND and the other to the board's logic supply, 5 V on an Uno and 3.3 V on an ESP32 or Pico, so the pin reads LOW in one position and HIGH in the other. Its 2.5 mm pin pitch (same document) drops into a breadboard.

A slide switch is a maintained switch: slide the knob and it stays in that position until you move it back, unlike a push button that springs back. The common hobby part is an SPDT (single pole, double throw), also sold as 1P2T: one common pin in the middle and two throws on either side. In one position COM connects to throw A, in the other to throw B. The SS-12D00 found in most kits has three pins on a 2.5 mm pitch and a 2.0 mm knob travel (Vimex SS-12D00 specification).

It does two jobs in maker projects. As a logic input, wire COM to a GPIO and the two throws to GND and the logic supply, and the pin reads a clean LOW or HIGH in either position with no pull resistor at all. As a power switch, put it in series with a small battery-powered circuit's supply to turn it on and off. Its contacts are small: the SS-12D00 is rated 0.3 A at 30 V DC (Vimex specification), so it switches logic, a microcontroller board or a few LEDs, not motors or LED strips.

Like every mechanical contact it bounces when it changes position. Jack Ganssle measured 16 switches bouncing for 1557 µs on average and up to 6200 µs at worst (A Guide to Debouncing), so code that counts transitions should ignore changes for a short window after each one. Code that only reads the switch's level, such as a mode set at boot, needs no debouncing.

## Agent rules

Follow these when you wire this part or write code for it.

- Do: GPIO wiring: one side to GND, other side to the GPIO with INPUT_PULLUP → closed/ON reads LOW. This inversion is the #1 DIP-switch confusion: document it in the firmware. SPDT alternative: common → GPIO, throws to GND and 3V3 = defined level in both positions, no pull needed.
- Do: DIP banks: each position to its own GPIO (pull-ups on), commons ganged to GND. Read once at boot for configuration; no debounce needed for a boot-time read.
- Do: Small slide (SS12D class): ~0.3 A low-voltage DC
- Do: Debounce when counting EDGES: real switches chatter ~1.6 ms on average, 6 ms worst (Ganssle's measurements), a 20–50 ms window still feels instantaneous. Level reads don't need it.
- Never: No mains (120/230 VAC) through hobby slide/DIP/tact switches: no arc extinction margin in DC, no creepage, no agency approval. Mains needs a properly AC-rated approved switch or a relay.
- Never: No floating input: a switch to GND without the pull-up enabled reads noise.
- Never: No leaving both throws of an SPDT unwired while COM drives a GPIO: the input then floats in one position. Wire both throws to levels, or use INPUT_PULLUP with one throw to GND.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| COM | Common | passive |
| A | Throw A | passive |
| B | Throw B | passive |

## Wiring

### Arduino Uno

| Slide Switch (SPDT) | Arduino Uno | Note |
| --- | --- | --- |
| COM | D2 |  |
| A | GND |  |
| B | 5V |  |

### ESP32 DevKit V1

| Slide Switch (SPDT) | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| COM | GPIO13 (D13) |  |
| A | GND |  |
| B | 3V3 |  |

### Raspberry Pi Pico

| Slide Switch (SPDT) | Raspberry Pi Pico | Note |
| --- | --- | --- |
| COM | GP0 |  |
| A | GND |  |
| B | 3V3 |  |

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Contact form | SPDT (1P2T): COM connects to A or to B | Vimex SS-12D00 specification |
| Rating | 0.3 A at 30 V DC | Vimex SS-12D00 specification |
| Contact resistance | 30 mΩ max. | Vimex SS-12D00 specification |
| Insulation resistance | 500 MΩ at 500 V DC | Vimex SS-12D00 specification |
| Withstand voltage | 500 V AC for 1 minute | Vimex SS-12D00 specification |
| Switching life | 10,000 cycles min. | Vimex SS-12D00 specification |
| Pin pitch | 2.5 mm, three pins, 0.9 mm PCB holes | Vimex SS-12D00 specification, PCB layout |
| Body | 8.5 × 3.5 mm footprint, 2.0 mm knob travel | Vimex SS-12D00 specification |
| Contact bounce (16 switches measured) | 1557 µs average, 6200 µs worst | Jack Ganssle, A Guide to Debouncing |
| Dimensions | 8.5 × 3.5 mm body | maker's datasheet, checked 29 Oct 2026 |
| Contact rating | 0.3 A at 30 V DC | maker's datasheet, checked 29 Oct 2026 |

## Circuit notes

- As a logic input, wire COM to the GPIO and the two throws to GND and to the board's logic voltage. The pin is then driven in both positions and needs no pull resistor.
- Use the logic voltage of the board you read it with: 5 V on an Arduino Uno, 3V3 on an ESP32, ESP8266 or Raspberry Pi Pico. Their GPIOs are 3.3 V only, so a throw tied to VIN, VBUS or 5V puts 5 V on the pin whenever the switch sits on that side.
- With one throw unused, enable the internal pull-up (INPUT_PULLUP on Arduino) and tie the other throw to GND: the pin reads LOW on that side and HIGH on the open side. Never leave COM driving a GPIO with both throws open, or the input floats.
- As a power switch, put it in series with the supply's positive lead and keep the load within 0.3 A at 30 V DC (Vimex SS-12D00 specification). Switch motors, pumps and LED strips through a MOSFET or relay that the switch controls instead.
- Debounce only when counting changes: contacts bounced up to 6200 µs in Ganssle's measurements (A Guide to Debouncing), so ignoring further changes for 20 ms after an edge is ample. A level read at boot needs nothing.
- Never put mains voltage through it: a 30 V DC rated breadboard switch has no approval or spacing for mains. Use a properly rated mains switch or a relay.

## Common mistakes

- **Tying a throw to 5 V on a 3.3 V board.** On an ESP32, ESP8266 or Pico, a throw wired to VIN, VBUS or 5V puts 5 V on a 3.3 V GPIO whenever the switch sits on that side. Wire that throw to the 3V3 pin instead.
- **Using the wrong pin as common.** COM is the middle pin; the outer two are the throws (Vimex SS-12D00 specification). Wired with an outer pin as common, the switch shorts your supply to ground in one position or leaves the input floating in the other.
- **Leaving the input floating.** With only one throw connected and no pull resistor, the GPIO floats in the open position and reads random values. Either wire both throws to GND and the logic supply, or enable INPUT_PULLUP and wire one throw to GND.
- **Switching a motor or LED strip directly.** The SS-12D00 is rated 0.3 A at 30 V DC (Vimex specification). Motor inrush and strip currents exceed that and wear or weld the contacts. Let the switch drive a MOSFET gate or relay input that carries the load.
- **Counting edges without debouncing.** Each slide produces several fast transitions over a few milliseconds; Ganssle measured up to 6200 µs (A Guide to Debouncing). Code counting changes, or an interrupt on the pin, sees many where one happened. Ignore changes for a short window after the first.

## Questions

### How do I wire a 3-pin slide switch to an Arduino?

Middle pin (COM) to a digital pin such as D2, one outer pin to GND and the other to 5V. digitalRead() then returns LOW in one position and HIGH in the other, with no resistor needed, because the pin is driven in both positions.

### Can I use a slide switch with an ESP32 or Raspberry Pi Pico at 3.3 V?

Yes, wired to 3.3 V: COM to the GPIO, one throw to GND and the other to the 3V3 pin. Do not use VIN or VBUS for that throw, because those carry 5 V and the ESP32's and Pico's GPIOs are 3.3 V only. The switch's contacts handle far more than logic levels, 0.3 A at 30 V DC (Vimex SS-12D00 specification).

### Which pin of a slide switch is common?

The middle one. On the SS-12D00 the three pins sit on a 2.5 mm pitch and the middle pin connects to either outer pin depending on the knob's position (Vimex SS-12D00 specification). A multimeter on continuity confirms it in seconds.

### Can a slide switch turn my project on and off?

Yes, for small loads. Put it in series with the battery's positive lead, using COM and one throw. Keep the current within its 0.3 A at 30 V DC rating (Vimex SS-12D00 specification), which covers a microcontroller board, sensors and a few LEDs.

### Why does my slide switch read the wrong value or flicker?

Usually the input floats: one throw is unconnected and no pull-up is enabled, or an outer pin was used as common. Wire COM to the GPIO with both throws to GND and the logic supply. If counted changes are too many, it is contact bounce, up to 6200 µs in Ganssle's measurements (A Guide to Debouncing), and a short debounce window fixes it.

### Slide switch vs push button: which should I use?

A slide switch holds its position, so it suits on/off and mode settings that must persist. A push button springs back, so it suits momentary actions such as a press to start, count or reset. Both bounce and both read the same way on a GPIO.

### SPDT vs SPST: what is the difference?

An SPST switch has two pins and simply opens or closes one circuit. An SPDT switch like the SS-12D00 has three: a common connected to either of two throws (Vimex specification). An SPDT works as an SPST if you use COM and one throw.

## Related parts

- [Push Button](https://www.tinkered.ai/components/push-button.md): same job: a switch you press or slide
- [4×4 Keypad](https://www.tinkered.ai/components/keypad-4x4.md): same job: a switch you press or slide
- [DIP Switch (4 positions)](https://www.tinkered.ai/components/dip-switch-4.md): same job: a switch you press or slide
- [Arduino Uno](https://www.tinkered.ai/components/arduino-uno.md): the board its circuit is wired to

## Try it

Tinkered simulates the Slide Switch (SPDT) in the browser: wire it on a 3D breadboard, run your real code on the board, and measure it. Free to start at https://www.tinkered.ai.
