# Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/129/308/medium800/adafruit_products_5932-03.jpg?1712763869)

Analog switches are a solid state alternative to relays, when you want a smaller, lower-power technology that won't wear out mechanically. And, as the name implies, you can use the **Adafruit ADG729 Dual 1-to-4 Analog Matrix Switches** to connect between two sets of four analog signals, much like 8 mechanical switches. These chips tend to be tiny surface mount parts, so this breakout will let anyone use the ADG729 switch for signals up to 5V, without fiddly soldering.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/309/medium800/adafruit_products_5932-01.jpg?1712763938)

The ADG729 uses I2C to select which of the 8 channels switches to turn on or off. Four channels connect to the DA analog pin, and the other four channels connect to the DB analog pin. Note that unlike digital switches and multiplexers, these are not 'input' and 'output' because the signal is bidirectional. You could have the DA or DB signal be an input to 4 outputs, or the 4 inputs to one output.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/310/medium800/adafruit_products_5932-02.jpg?1712763987)

Also, the ADG729 isn't really a 'selecting multiplexer', **it's a matrix switch with 8 independent switches**. That means that yes, you could treat it like an DP4T where you select which signal is routed to the D pin, you can also turn on multiple switches to 'merge' the signals together. [If you want all 8 signals to be able to route to a single pin, check out the ADG728](https://www.adafruit.com/product/5899).

Unlike a relay or mechanical switch, analog switches don't wear out, and the switch time is near instant, about 100nS. The ADG729 chip also guarantees break-before-make so the deselected switches will open before selected switches close.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/311/medium800/adafruit_products_5932-00.jpg?1712764036)

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

- **The VIN power pin** (the red wire if using a STEMMA QT cable) **must as high as the highest analog voltages you want to switch**. That means if the analog signals are no more than 5VDC, the V+ pin must be higher than 5V. You cannot power this pin with 3.3V and switch 5V signals.
- **It cannot switch signals below ground**. No negative voltages can be applied to the Switch or DA/DB 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.

In addition to the 8 switch S pins and the two D pins that can be switched to, there are also two I2C address pins so you can change the default address from 0x44 up to 0x47.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/312/medium800/adafruit_products_5932-00.jpeg?1712764090)

To get you going fast, we spun up a custom-made PCB in the [**STEMMA QT** form factor](https://www.adafruit.com/?q=stemma%20qt%20sensor "STEMMA QT form factor"), making it easy to interface with. The [STEMMA QT connectors](https://learn.adafruit.com/introducing-adafruit-stemma-qt/what-is-stemma-qt) on either side are compatible with the [SparkFun Qwiic](https://www.sparkfun.com/qwiic) I2C connectors. This allows you to make solderless connections between your development board and the ADG or to chain it with a wide range of other sensors and accessories using a [**compatible cable**](https://www.adafruit.com/?q=stemma%20qt%20cable).

# Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/129/361/medium800/adafruit_products_double.jpg?1713198529)

The default I2C address is **0x44**.

## Power Pins

- **VIN** - this is the power pin. To power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V microcontroller like Arduino, use 5V. It also needs to have the same voltage as the highest signal you are switching. That means if the analog signals are no more than 5VDC, the **VIN** pin must be higher than 5V. You cannot power this pin with 3.3V and switch 5V signals.
- **GND** - common ground for power and logic.

## I2C Logic Pins

- **SCL** - I2C clock pin, connect to your microcontroller's I2C clock line. This pin can use 3-5V logic, and there's a **10K pullup** on this pin.
- **SDA** - I2C data pin, connect to your microcontroller's I2C data line. This pin can use 3-5V logic, and there's a **10K pullup** on this pin.
- **[STEMMA QT](https://learn.adafruit.com/introducing-adafruit-stemma-qt) -** These connectors allow you to connectors to dev boards with **STEMMA QT** (qwiic) connectors or to other things with [various associated accessories](https://www.adafruit.com/?q=JST%20SH%204)

## Analog Switch Pins

- **1A/B - 4A/B** - The two sets of four analog switch channels. Unlike digital switches and multiplexers, these channels are not strictly 'inputs' or 'outputs' because the signal is bidirectional.
- **DA and DB** - The analog pins for the switch. **DA** is connected to channels **1A** - **4A** and **DB** is connected to channels **1B** - **4B**. These pins can act as input or an output.

This breakout isn't really a 'selecting multiplexer', a matrix switch with 8 independent switches. You could treat it like an DP4T where you select which of the 4 channels are routed to the **DA** or **DB** pin. You can also turn on multiple channels to 'merge' the signals together.

There are a few things to keep in mind when using these pins:

- **The switch signals cannot be below ground**. No negative voltages can be applied to the Switch or D 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.

## Address Pins

On the back of the board are **two address jumpers** , labeled **A0** and **A1**. These jumpers allow you to chain up to 4 of these boards on the same pair of I2C clock and data pins. To do so, you solder the jumpers "closed" by connecting the two pads.

On the front of the board are two address pins, labeled **A0** and **A1**. Just like the jumpers, these pins allow you to change the I2C address to connect multiple boards by connecting them to **VIN**.

The default I2C address is **0x44**. The other address options can be calculated by "adding" the **A0/A1** to the base of **0x44**.

**A0** sets the lowest bit with a value of **1** and **A**** 1 **sets the next bit with a value of** 2 ****.** The final address is **0x44 + A1 + A0** which would be **0x47**.

If only **A0** is soldered closed, the address is **0x44 + 1 = 0x45**

If only **A1** is soldered closed, the address is **0x44 + 2 = 0x46**

The table below shows all possible addresses, and whether the pin(s) should be high (closed) or low (open).

![](https://cdn-learn.adafruit.com/assets/assets/000/129/363/medium800/adafruit_products_i2c.png?1713202946)

## Power LED and LED Jumper

- **Power LED -** In the upper left corner, above the STEMMA connector, on the front of the board, is the power LED, labeled **on**. It is a green LED.
- **LED jumper&nbsp;** - This jumper is located on the back of the board, in the upper right corner. It's labeled **LED** on the board silk. Cut the trace on this jumper to cut power to the "on" LED.

# Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

## CircuitPython

It's easy to use the **ADG729** &nbsp;with CircuitPython and and the [Adafruit\_CircuitPython\_ADG72x](https://github.com/adafruit/Adafruit_CircuitPython_ADG72x) module. This module allows you to easily write Python code to control the matrix switch.

## CircuitPython Microcontroller Wiring

First wire up the switch to your board exactly as follows. The following is the switch wired to a Feather RP2040 using the STEMMA QT connector. You'll connect your external analog input to **1A** and **1B**.

- **Board STEMMA 3V** to **switch** **VIN (red wire)**  
- **Board STEMMA GND** to **switch** &nbsp;**GND (black wire)**  
- **Board STEMMA SCL** to **switch** &nbsp;**SCL (yellow wire)**  
- **Board STEMMA SDA** to **switch** &nbsp;**SDA (blue wire)**
- **Board A0** to **switch DA (purple wire)**
- **Board A1** &nbsp;to **switch DB (pink wire)**
- **Analog signal** &nbsp;to **switch 1A (orange wire)** and **switch 1B (green wire)**

**Make sure to share all grounds between the incoming analog signals and the circuit.**

![adafruit_products_featherStemma.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/368/medium640/adafruit_products_featherStemma.jpg?1713212791)

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** &nbsp;**GND (black wire)**  
- **Board SCL** to **switch** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **switch** &nbsp;**SDA (blue wire)**
- **Board A0** to **switch DA (purple wire)**
- **Board A1** &nbsp;to **switch DB (pink wire)**
- **Analog signal** &nbsp;to **switch 1A (orange wire)** and **switch 1B (green wire)**

**Make sure to share all grounds between the incoming analog signals and the circuit.**

![adafruit_products_featherBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/369/medium640/adafruit_products_featherBB_bb.jpg?1713212805)

## CircuitPython Usage

To use with CircuitPython, you need to first install the **Adafruit\_CircuitPython\_ADG72x** library, and its dependencies, into the **lib** folder on your **CIRCUITPY** drive. Then you need to update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, and copy the **entire**  **lib**  **folder** and the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder should contain the following folder and file:

- **adafruit\_bus\_device/**
- **adafruit\_adg72x.mpy**

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

## Example Code

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/ADG72x_Examples/CircuitPython_ADG729/code.py

Every two seconds, the ADG729 switches channels being sent to pins&nbsp; **DA** and **DB**. In the **.GIF** below, you'll see analog signals on channel 1 ( **1A and 1B** )&nbsp;being read from pin **DA** &nbsp;to board pin&nbsp; **A0** and pin **DB** to board pin **A1** as their channels are turned on.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/376/medium800thumb/adafruit_products_cp_adg729.jpg?1713217226)

# Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

## Python Docs

# Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

## Arduino

Using the ADG729 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the [Adafruit\_ADG72x](https://github.com/adafruit/Adafruit_ADG72x) library, 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 board's VIN.

Here is an Adafruit Metro wired up to the breakout using the STEMMA QT connector. You'll connect your external analog input to **1A** and **1B** :

- **Board 5V** to **switch** **VIN (red wire)**  
- **Board GND** to **switch** &nbsp;**GND (black wire)**  
- **Board SCL** to **switch** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **switch** &nbsp;**SDA (blue wire)**
- **Board A0** to **switch DA (purple wire)**
- **Board A1** &nbsp;to **switch DB (pink wire)**
- **Analog signal** &nbsp;to **switch 1A (orange wire)** and **switch 1B (green wire)**

**Make sure to share all grounds between the incoming analog signals and the circuit.**

![adafruit_products_metroStemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/370/medium640/adafruit_products_metroStemma_bb.jpg?1713212832)

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

- **Board 5V** to **switch** **VIN (red wire)**  
- **Board GND** to **switch** &nbsp;**GND (black wire)**  
- **Board SCL** to **switch** &nbsp;**SCL (yellow wire)**  
- **Board SDA** to **switch** &nbsp;**SDA (blue wire)**
- **Board A0** to **switch DA (purple wire)**
- **Board A1** &nbsp;to **switch DB (pink wire)**
- **Analog signal** &nbsp;to **switch 1A (orange wire)** and **switch 1B (green wire)**

**Make sure to share all grounds between the incoming analog signals and the circuit.**

![adafruit_products_metroBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/129/371/medium640/adafruit_products_metroBB_bb.jpg?1713212846)

## Library Installation

You can install the **Adafruit\_ADG72x** library for Arduino using the Library Manager in the Arduino IDE.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/364/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1713203149)

Click the **Manage Libraries ...** menu item, search for **Adafruit\_ADG72x** , and select the **Adafruit ADG72x** library:

![](https://cdn-learn.adafruit.com/assets/assets/000/129/365/medium800/adafruit_products_lib.png?1713203159)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/129/366/medium800/adafruit_products_depends.png?1713203166)

Warning: If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!

## Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/ADG72x_Examples/Arduino_ADG729_Plotter/Arduino_ADG729_Plotter.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 two seconds, the ADG729 switches channels being sent to pins **DA** and **DB**. In the **.GIF** below, you'll see analog signals on channel 1 ( **1A and 1B** )&nbsp;being read from pin **DA** &nbsp;to board pin&nbsp; **A0** and pin **DB** to board pin **A1** as their channels are turned on.

![](https://cdn-learn.adafruit.com/assets/assets/000/129/377/medium800thumb/adafruit_products_arduino_adg729.jpg?1713217240)

# Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

## Arduino Docs

# Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

## Downloads

## Files

- [ADG729 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/129/305/original/ADG728_729.pdf?1712760443)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-ADG729-Dual-1-to-4-Analog-Matrix-Switch-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20ADG729%20Dual%201-to-4%20Analog%20Switch.fzpz)

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

![](https://cdn-learn.adafruit.com/assets/assets/000/129/314/medium800/adafruit_products_fab.png?1712764572 dimensions are in inches)


## Primary Products

### Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch

[Adafruit ADG729 Dual 1-to-4 Analog Matrix Switch](https://www.adafruit.com/product/5932)
Analog switches are a solid state alternative to relays, when you want a smaller, lower-power technology that won't wear out mechanically. And, as the name implies, you can use the&nbsp; **Adafruit ADG729 Dual 1-to-4 Analog Matrix Switches** to connect between two sets...

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

## Related Guides

- [Adafruit RS-232 Full Pinout Level-Shifter Breakout](https://learn.adafruit.com/adafruit-rs-232-full-pinout-level-shifter-breakout.md)
- [OpenAI Image Descriptors with MEMENTO](https://learn.adafruit.com/openai-image-descriptors-with-memento.md)
- [CircuitPython USB VID/PID Reporter](https://learn.adafruit.com/circuitpython-usb-vid-pid-reporter.md)
- [Introducing Bluefruit EZ-Link Breakout](https://learn.adafruit.com/introducing-bluefruit-ez-link.md)
- [Infinite Text Adventure](https://learn.adafruit.com/infinite-text-adventure.md)
- [Adafruit FunHouse](https://learn.adafruit.com/adafruit-funhouse.md)
- [Adafruit 2.4" PiTFT HAT with Resistive Touchscreen Mini Kit](https://learn.adafruit.com/adafruit-2-4-pitft-hat-with-resistive-touchscreen-mini-kit.md)
- [Guitar Hero MIDI Controller](https://learn.adafruit.com/guitar-hero-midi-controller.md)
- [Adafruit Pi Stemma QT Breakout](https://learn.adafruit.com/adafruit-pi-stemma-qt-breakout.md)
- [Introducing Bluefruit LE Micro](https://learn.adafruit.com/bluefruit-le-micro-atmega32u4-microcontroller-usb-bluetooth-le-in-one.md)
- [Adafruit Feather M0 WiFi with ATWINC1500](https://learn.adafruit.com/adafruit-feather-m0-wifi-atwinc1500.md)
- [Adafruit Sparkle Motion Stick](https://learn.adafruit.com/adafruit-sparkle-motion-stick.md)
- [PyBadge Conference Badge With Unicode Fonts](https://learn.adafruit.com/pybadge-conference-badge-multi-language-unicode-fonts.md)
- [Adafruit ESP32-S2 Reverse TFT Feather](https://learn.adafruit.com/esp32-s2-reverse-tft-feather.md)
- [HalloWing Light Paintstick](https://learn.adafruit.com/hallowing-light-paintstick.md)
