# Adafruit STEMMA Analog SPDT Switch

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/128/526/medium800/adafruit_products_5892-03.jpg?1709571882)

Analog switches are a solid state alternative to relays, when you want a smaller, lower-power technology that won't wear out mechanically. As the name implies, you can use an analog switch chip to select between two analog signals, much like a mechanical switch. These chips tend to be tiny surface mount parts, so the **Adafruit STEMMA Analog SPDT Switch** lets anyone use the MAX4544 SPDT analog switch for signals up to 12V, without fiddly soldering.

![](https://cdn-learn.adafruit.com/assets/assets/000/128/527/medium800/adafruit_products_5892-01.jpg?1709571921)

When the selection signal is low, the Common pin is connected to the Normally Closed (NC) pin and disconnected from the Normally Open (NO) pin. When the selection signal is high, the Common pin is connected to NO and disconnected from NC.

Unlike a relay or mechanical switch, analog switches don't wear out, and the switch time is near instant, about 30nS. The MAX4544&nbsp;chip also guarantees break-before-make so the NC and NO pins will never accidentally cross-connect.

However, there's a few things to watch out for:

- **The V+ power pin** (also the red wire if using a STEMMA cable) **must be as high as the highest analog voltages you want to switch**. That means if the analog signals are no more than 6VDC, the V+ pin must be higher than 6V. You cannot power this pin with 3.3V and switch 12V signals.
- **The MAX4544 cannot switch signals below ground**. No negative voltages can be applied to the COM/NO/NC pins!
- **Analog switches are for signals, not power!** Since this is not a mechanical switch, the signals pass through circuitry that is not designed to source or sink current. This is great for analog signal voltages, and is not good for providing more than a few mA of current.

![](https://cdn-learn.adafruit.com/assets/assets/000/128/528/medium800/adafruit_products_5892-02.jpg?1709571970)

This board has a simple plug-and-play JST PH (2mm pitch) input connector for solderless use. Provide V+ power (from 3V up to 12V) and signal of at least 2.5VDC logic level. On the output is a terminal block with the common, Normally Open and Normally Closed signals. You can also get to all the signal and power pins on a 0.1" breakout header if desired.

# Adafruit STEMMA Analog SPDT Switch

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/128/529/medium800/adafruit_products_double.jpg?1709573903)

## Power Pins

- **V+** -&nbsp;power input for the MAX4544. It is the red wire on the JST PH cable. You can use 3-12VDC. The voltage **must as high as the highest analog voltages you want to switch**. That means if the analog signals are no more than 6VDC, the V+ pin must be higher than 6V. You cannot power this pin with 3.3V and switch 12V signals.
- **-** - common ground for power and logic.

## Selection Signal Input

- **SIG** - this is the selection signal input for the MAX4544. It expects a digital (high or low) signal from your microcontroller with a minimum logic level of 2.5VDC. When it is low, the **Common** pin is connected to the Normally Closed ( **NC** ) pin and disconnected from the Normally Open ( **NO** ) pin. When it is high, the **Common** pin is connected to **NO** and disconnected from **NC**.

## STEMMA JST PH

- [**STEMMA JST PH**](https://learn.adafruit.com/introducing-adafruit-stemma-qt) - 2mm pitch STEMMA JST port for use with [3-pin STEMMA JST PH cables](https://www.adafruit.com/category/619). It has connections for:
  - **GND/-** - common ground for power and data. It is the black wire on the JST PH cable.
  - **V+** - power input for the MAX4544. It is the red wire on the JST PH cable.&nbsp;
  - **SIG** - signal from your microcontroller. It needs to be have a minimum 2.5VDC logic level. It is the white wire on the JST PH cable.

## Analog Switch Inputs and Output

You'll connect your analog signals to **NO** and **NC**. The state of the **SIG** pin will determine which analog signal is output to **com** mon.

These pins expect an analog signal voltage, not a power voltage. Since this is not a mechanical switch, the signals pass through circuitry that is not designed to source or sink current. Additionally, the MAX4544 **cannot switch signals below ground**. No negative voltages can be applied to these pins.

- **NO** - this is the **N** ormally **O** pen pin. It is connected to the **com** mon pin when the **SIG** pin is high.
- **NC** - this is the **N** ormally **C** losed pin. It is connected to the **com** mon pin when the **SIG** pin is low.
- **COM** - this is the **com** mon output from the MAX4544 switch. The selected analog signal from **NO** or **NC** will be output to this pin.

These pins are available along the side edge of the board or via the 3-pin terminal block.

## Signal LED and Jumper

- **Signal LED** - to the left of the JST PH connector is the signal LED, labeled **Sig**. It is the red LED. It will light up when **SIG** is high and turn off when **SIG** is low.
- **LED jumper** - in the upper right corner on the back of the board is a jumper for the signal LED. It is labeled **SIG** on the board silk. If you want to disable the signal LED, cut the trace on this jumper.

## Power LED and Jumper

- **Power LED** - to the right of the JST PH connector is the power LED, labeled **ON**. It is the green LED.
- **LED jumper** - in the upper left corner on the back of the board is a jumper for the power LED. It is labeled **ON** on the board silk. If you want to disable the power LED, cut the trace on this jumper.

# Adafruit STEMMA Analog SPDT Switch

## CircuitPython

It's easy to use the **STEMMA Analog SPDT Switch** with CircuitPython and the [digitalio](https://docs.circuitpython.org/en/latest/shared-bindings/digitalio/index.html) and [analogio](https://docs.circuitpython.org/en/latest/shared-bindings/analogio/index.html) core modules. These modules allow you to easily write Python code for accessing basic digital or analog inputs and outputs.

## CircuitPython Microcontroller Wiring

First wire up the switch to your board exactly as follows. The following is the switch wired to a Feather RP2040 (shown using a JST PH cable). You'll connect your two external analog inputs to **NO** and **NC**.

- **Board 3V** to **switch JST PH** **VIN (red wire)**  
- **Board GND** to **switch JST PH GND (black wire)**  
- **Board pin 5** &nbsp;to **switch**  **JST PH** **SIG (white wire)**  
- **Board pin A1** to **switch terminal block common (yellow wire)**
- **Analog input 1** to **switch terminal block NO (blue wire)**
- **Analog input 2** to **switch terminal block NC (green wire)**

![adafruit_products_feather_analog_stemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/128/586/medium640/adafruit_products_feather_analog_stemma_bb.jpg?1709654248)

The following is the switch wired to a Feather RP2040 using a solderless breadboard:

- **Board 3V** to **switch** **VIN (red wire)**  
- **Board GND** to **switch GND (black wire)**  
- **Board pin 5** &nbsp;to **switch** **SIG (white wire)**  
- **Board pin A1** to **switch common (yellow wire)**
- **Analog input 1** to **switch NO (blue wire)**
- **Analog input 2** to **switch NC (green wire)**

![adafruit_products_feather_analog_bb_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/128/587/medium640/adafruit_products_feather_analog_bb_bb.jpg?1709654262)

## CircuitPython Usage

To use with CircuitPython, you need to update **code.py** with the example script.

In the example below, click the **Download Project Bundle** button below to download the **code.py** file in a zip file. Extract the contents of the zip file, and copy&nbsp;the **code.py** file to your **CIRCUITPY** drive.

![CIRCUITPY](https://adafruit.github.io/Adafruit_Learning_System_Guides/Introducing_CircuitPlaygroundExpress_CircuitPlaygroundExpress_DigitalIO.png )

Info: No additional libraries are needed in the /lib folder for this example.

## Example Code

**If running CircuitPython:** Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/STEMMA_Analog_Switch_Examples/CircuitPython/code.py

Every 2 seconds, the analog output from the **common** pin will be switched by pin 5 toggling high or low. You can see this in action with Mu, by opening the [Plotter window](https://learn.adafruit.com/sensor-plotting-with-mu-and-circuitpython) in the REPL.

![](https://cdn-learn.adafruit.com/assets/assets/000/128/596/medium800thumb/adafruit_products_circuitpythonAnalog_2.jpg?1709663133)

# Adafruit STEMMA Analog SPDT Switch

## Arduino

Using the STEMMA Analog SPDT Switch with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller and running the provided example code.

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the breakout VIN.

Here is an Adafruit Metro wired up to the breakout using the JST PH connector. You'll connect your two external analog inputs to **NO** and **NC**.

- **Board 5V** to **switch JST PH** **VIN (red wire)**  
- **Board GND** to **switch JST PH GND (black wire)**  
- **Board pin 5** &nbsp;to **switch**  **JST PH** **SCL (white wire)**  
- **Board pin A1** to **switch terminal block common (yellow wire)**
- **Analog input 1** to **switch terminal block NO (blue wire)**
- **Analog input 2** to **switch terminal block NC (green wire)**

![adafruit_products_metro_analog_stemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/128/588/medium640/adafruit_products_metro_analog_stemma_bb.jpg?1709654280)

Here is an Adafruit Metro wired up using a solderless breadboard:

- **Board 5V** to **switch** **VIN (red wire)**  
- **Board GND** to **switch GND (black wire)**  
- **Board pin 5** &nbsp;to **switch** **SIG (white wire)**  
- **Board pin A1** to **switch common (yellow wire)**
- **Analog input 1** to **switch NO (blue wire)**
- **Analog input 2** to **switch NC (green wire)**

![adafruit_products_metro_bb_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/128/589/medium640/adafruit_products_metro_bb_bb.jpg?1709654294)

## Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/STEMMA_Analog_Switch_Examples/Arduino_Analog_Switch_Example/Arduino_Analog_Switch_Example.ino

Upload the sketch to your board and open up the Serial Plotter ( **Tools -\> Serial Plotter** ) at 115200 baud. You'll see the analog data printed to the plotter. Every 2 seconds, the analog output from the **common** pin will be switched by toggling pin 5 high or low.

![](https://cdn-learn.adafruit.com/assets/assets/000/128/581/medium800thumb/adafruit_products_arduinoAnalog.jpg?1709652265)

# Adafruit STEMMA Analog SPDT Switch

## Downloads

## Files

- [MAX4544 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/128/507/original/MAX4541-MAX4544.pdf?1709566502)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-STEMMA-Analog-SPDT-Switch-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20STEMMA%20Analog%20SPDT%20Switch.fzpz)

## Schematic and Fab Print
![](https://cdn-learn.adafruit.com/assets/assets/000/128/524/medium800/adafruit_products_schem.png?1709571804)

![](https://cdn-learn.adafruit.com/assets/assets/000/128/525/medium800/adafruit_products_fab.png?1709571830)


## Primary Products

### Adafruit STEMMA Analog SPDT Switch -  MAX4544 12V - JST PH 2mm

[Adafruit STEMMA Analog SPDT Switch -  MAX4544 12V - JST PH 2mm](https://www.adafruit.com/product/5892)
Analog switches are a solid state alternative to relays, when you want a smaller, lower-power technology that won't wear out mechanically. As the name implies, you can use an analog switch chip to select between two analog signals, much like a mechanical switch. These chips tend to be tiny...

In Stock
[Buy Now](https://www.adafruit.com/product/5892)
[Related Guides to the Product](https://learn.adafruit.com/products/5892/guides)

## Featured Products

### JST PH 2mm 3-pin Plug-Plug Cable - 100mm long

[JST PH 2mm 3-pin Plug-Plug Cable - 100mm long](https://www.adafruit.com/product/4336)
This cable is a little over 100mm / 4" long&nbsp;and fitted with JST-PH 3-pin connectors on either end.&nbsp;

We dig the solid and compact nature of these connectors and the latch that keeps the cable from coming apart easily. We're carrying these to <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4336)
[Related Guides to the Product](https://learn.adafruit.com/products/4336/guides)
### STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm](https://www.adafruit.com/product/3893)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" male header plugs on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3893)
[Related Guides to the Product](https://learn.adafruit.com/products/3893/guides)
### STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Female Socket Cable - 200mm](https://www.adafruit.com/product/3894)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" female header sockets on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3894)
[Related Guides to the Product](https://learn.adafruit.com/products/3894/guides)
### JST PH 2mm 3-pin Plug to Color Coded Alligator Clips Cable

[JST PH 2mm 3-pin Plug to Color Coded Alligator Clips Cable](https://www.adafruit.com/product/4030)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with grippy mini alligator clips. We're carrying these to match up with any of our boards or breakouts with 3-pin 'STEMMA' connectors on them such as the&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4030)
[Related Guides to the Product](https://learn.adafruit.com/products/4030/guides)

## Related Guides

- [Adafruit Feather M0 Express](https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-circuitpython.md)
- [Super Nintendo USB Controller](https://learn.adafruit.com/super-nintendo-usb-controller.md)
- [Circuit Playground Password Vault](https://learn.adafruit.com/circuit-playground-password-vault.md)
- [DeviceScript, TypeScript for Microcontrollers](https://learn.adafruit.com/devicescript.md)
- [Adafruit MCP3421 18-Bit ADC](https://learn.adafruit.com/adafruit-mcp3421-18-bit-adc.md)
- [Adafruit NeoPot](https://learn.adafruit.com/adafruit-neopot.md)
- [LIS3MDL Triple-axis Magnetometer](https://learn.adafruit.com/lis3mdl-triple-axis-magnetometer.md)
- [Arcade Coin-Op](https://learn.adafruit.com/arcade-coin-op.md)
- [Adafruit Feather RP2350 with HSTX](https://learn.adafruit.com/adafruit-feather-rp2350.md)
- [MIDI Breath Controller](https://learn.adafruit.com/midi-breath-controller.md)
- [NeoPixel Aquarium with Submersible Lights](https://learn.adafruit.com/neopixel-aquarium-with-submersible-lights.md)
- [Network Interface Failover using FONA](https://learn.adafruit.com/network-interface-failover-using-fona.md)
- [Adafruit I2C to 8 Channel Solenoid Driver](https://learn.adafruit.com/adafruit-i2c-to-8-channel-solenoid-driver.md)
- [Adafruit EYESPI Breakout Board](https://learn.adafruit.com/adafruit-eyespi-breakout-board.md)
- [Adafruit PyBadge and PyBadge LC](https://learn.adafruit.com/adafruit-pybadge.md)
