# Adafruit MCP3421 18-Bit ADC

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/126/794/medium800thumb/adafruit_products_5870-06.jpg?1703176510)

The **Adafruit MCP3421 18-Bit ADC** is a simple, inexpensive, and easy to use 18-bit, 240 SPS, single-channel ADC with an I2C interface that can run up to 3.4MHz clock rate. A perfect component whenever you need an ADC that has differential inputs, adjustable gain, and a built-in precision/low-drift reference voltage.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/796/medium800/adafruit_products_5870-05.jpg?1703176577)

One of the trade-offs with getting 18-bit precision is that the ADC is not going to be very fast: you can configure the chip to do a faster 12-bit conversion at 240 SPS, but at 18-bits it slows down to 3.5 SPS. That's because the way a [sigma-delta ADC](https://en.wikipedia.org/wiki/Delta-sigma_modulation) works, it 'guesses' the analog voltage and uses a comparator to determine whether the input is higher or lower. Each 'guess' takes an extra step, and thus halves the throughput, so 12-bit is 240 SPS, and 14-bit is 1/4 (2-bit) slower, 60 SPS. Ditto 16-bit is 1/4 slower, 15 SPS, and finally 18-bit is 3.75 SPS.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/797/medium800/adafruit_products_5870-04.jpg?1703176669)

The MCP3421 is already set up for differential inputs, which means that you can read positive or negative differences between the two inputs, **as long as both signals are between 0 and 2.048V**. This means its not going to be great for reading stuff like potentiometers, where you have a single-end reading referenced to ground, and you want to read the full range from 0 to Vcc. It is great, however, for reading sensors like strain gauges, pressure sensors, or thermocouples.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/798/medium800/adafruit_products_5870-02.jpg?1703176679)

[We have a ready to go Arduino library that makes usage simple](https://github.com/adafruit/Adafruit_MCP3421): select the sample rate / precision you want and one-shot or continuous mode. Then read values over I2C! This sensor has a fixed address, so [you may want to use a multiplexor](https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout) if you want to connect multiple MCP3421's on a single I2C bus.

![](https://cdn-learn.adafruit.com/assets/assets/000/126/799/medium800/adafruit_products_5870-03.jpg?1703176716)

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 MCP 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).

[**QT Cable is not included** , but we have a variety in the shop](https://www.adafruit.com/?q=stemma+qt+cable&sort=BestMatch).

The board comes with a bit of 0.1" standard header in case you want to use it with a breadboard or perfboard. There are four mounting holes for easy attachment.

# Adafruit MCP3421 18-Bit ADC

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/126/916/medium800/adafruit_products_double.jpg?1704725453)

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

## Power Pins

- **VIN** - this is the power pin. Since the ADC chip uses 3-5 VDC to power the board, give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V.
- **GND** - common ground for power and logic.

## I2C Logic Pins

- **SCL** - I2C clock pin, connect to your microcontroller 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 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** connectors or to other things with [various associated accessories](https://www.adafruit.com/?q=JST%20SH%204)

## ADC Inputs

The MCP3421 has two inputs: **V+** and **V-**. **V+** is the positive input and **V-** is the negative input. The inputs are available via the terminal block at the top of the board or the two pins labeled **V+** and **V-** at the bottom of the board.

The MCP3421 is set up for differential inputs, which means that you can read positive or negative differences between the two inputs, **as long as both signals are between 0 and 2.048V**.

## Power LED

- **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 the green LED.

# Adafruit MCP3421 18-Bit ADC

## CircuitPython and Python

It's easy to use the **MCP3421** with Python or CircuitPython, and the [Adafruit\_CircuitPython\_MCP3421](https://github.com/adafruit/Adafruit_CircuitPython_MCP3421) module. This module allows you to easily write Python code to read input on the ADC.

You can use this driver with any CircuitPython microcontroller board or with a computer that has GPIO and Python [thanks to Adafruit\_Blinka, our CircuitPython-for-Python compatibility library](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

## CircuitPython Microcontroller Wiring

First wire up the breakout to your board exactly as follows. The following is the breakout wired to a Feather RP2040 (shown using a STEMMA QT cable):

- **Board STEMMA 3V** to **breakout** **VIN (red wire)**  
- **Board STEMMA GND** to **breakout** **GND (black wire)**  
- **Board STEMMA SCL** to **breakout** **SCL (yellow wire)**  
- **Board STEMMA SDA** to **breakout** **SDA (blue wire)**

![adafruit_products_featherStemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/988/medium640/adafruit_products_featherStemma_bb.jpg?1705080040)

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

- **Board 3V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** **GND (black wire)**  
- **Board SCL** to **breakout** **SCL (yellow wire)**  
- **Board SDA** to **breakout** **SDA (blue wire)**

![adafruit_products_featherBB_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/989/medium640/adafruit_products_featherBB_bb.jpg?1705080048)

## Python Computer Wiring

Since there are _dozens_ of Linux computers/boards you can use, we will show wiring for Raspberry Pi. For other platforms, [please visit the guide for CircuitPython on Linux to see whether your platform is supported](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux).

Here's the Raspberry Pi wired with I2C using a STEMMA QT connector:

- **Pi 3V** to **breakout** **VIN (red wire)**  
- **Pi GND** to **breakout** **GND (black wire)**  
- **Pi SCL** to **breakout** **SCL (yellow wire)**  
- **Pi SDA** to **breakout** **SDA (blue wire)**

![adafruit_products_piStemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/990/medium640/adafruit_products_piStemma_bb.jpg?1705080062)

Here's the Raspberry Pi wired with I2C using a solderless breadboard:

- **Pi 3V** to **breakout** **VIN (red wire)**  
- **Pi GND** to **breakout** **GND (black wire)**  
- **Pi SCL** to **breakout** **SCL (yellow wire)**  
- **Pi SDA** to **breakout** **SDA (blue wire)**

![adafruit_products_piBreadboard_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/991/medium640/adafruit_products_piBreadboard_bb.jpg?1705080076)

## Python Installation of MCP3421 Library

You'll need to install the **Adafruit\_Blinka** library that provides the CircuitPython support in Python. This may also require enabling I2C on your platform and verifying you are running Python 3. [Since each platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get your computer ready](https://learn.adafruit.com/circuitpython-on-raspberrypi-linux)!

Once that's done, from your command line run the following command:

- `pip3 install adafruit-circuitpython-mcp3421`

If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to use CircuitPython on Python 2.x, it isn't supported!

## CircuitPython Usage

To use with CircuitPython, you need to first install the **Adafruit\_CircuitPython\_MCP3421** 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 folders:

- **adafruit\_bus\_device/**
- **adafruit\_mcp3421/**

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/mcp3421_mcp3421_simpletest.py.png )

## Python Usage

Once you have the library `pip3` installed on your computer, copy or download the following example to your computer, and run the following, replacing **code.py** with whatever you named the file:

`python3 code.py`

## 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!

**If running Python:** The console output will appear wherever you are running Python.

https://github.com/adafruit/Adafruit_CircuitPython_MCP3421/blob/main/examples/mcp3421_simpletest.py

The MCP3421 is initialized over I2C. Then in the loop, the analog input is read and printed to the serial monitor, along with the current gain, resolution and mode settings.

This ADC is great for reading sensors like strain gauges, pressure sensors, or thermocouples. It's not going to be great for reading stuff like potentiometers, where you have a single-end reading referenced to ground, and you want to read the full range from 0 to Vcc.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/051/medium800/adafruit_products_cp_repl.png?1705338522)

# Adafruit MCP3421 18-Bit ADC

## Python Docs

# Adafruit MCP3421 18-Bit ADC

## Arduino

Using the MCP3421 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the [Adafruit\_MCP3421](https://github.com/adafruit/Adafruit_MCP3421) 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 breakout VIN.

Here is an Adafruit Metro wired up to the breakout using the STEMMA QT connector:

- **Board 5V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** **GND (black wire)**  
- **Board SCL** to **breakout** **SCL (yellow wire)**  
- **Board SDA** to **breakout** **SDA (blue wire)**

![adafruit_products_metro_stemma_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/927/medium640/adafruit_products_metro_stemma_bb.jpg?1704729923)

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

- **Board 5V** to **breakout** **VIN (red wire)**  
- **Board GND** to **breakout** **GND (black wire)**  
- **Board SCL** to **breakout** **SCL (yellow wire)**  
- **Board SDA** to **breakout** **SDA (blue wire)**

![adafruit_products_metro_bb_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/928/medium640/adafruit_products_metro_bb_bb.jpg?1704729939)

## Library Installation

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

![](https://cdn-learn.adafruit.com/assets/assets/000/126/923/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1704729081)

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

![](https://cdn-learn.adafruit.com/assets/assets/000/126/924/medium800/adafruit_products_arduino_lib.png?1704729116)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/126/925/medium800/adafruit_products_arduino_depends.png?1704729136)

If the "Dependencies" window does not come up, then you already have the dependencies installed.

Warning: 

## Example Code
https://github.com/adafruit/Adafruit_MCP3421/blob/main/examples/MCP3421_example/MCP3421_example.ino

![](https://cdn-learn.adafruit.com/assets/assets/000/126/929/medium800/adafruit_products_arduino_serial.png?1704732446)

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the MCP3421 recognized over I2C. The example sets the gain to 1X, resolution to 14-bit and the mode to continuous. The reading from the ADC will print to the Serial Monitor.

This ADC is great for reading sensors like strain gauges, pressure sensors, or thermocouples. It's not going to be great for reading stuff like potentiometers, where you have a single-end reading referenced to ground, and you want to read the full range from 0 to Vcc.

# Adafruit MCP3421 18-Bit ADC

## Arduino Docs

# Adafruit MCP3421 18-Bit ADC

## WipperSnapper

![](https://cdn-learn.adafruit.com/assets/assets/000/130/213/medium800/adafruit_products_Screenshot_2024-03-22_133716.png?1716489784)

## What is WipperSnapper

WipperSnapper is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device without programming a single line of code. WipperSnapper connects to [Adafruit IO](https://io.adafruit.com/), a web&nbsp;platform designed ([by Adafruit!](https://www.adafruit.com/about)) to&nbsp;_display_,&nbsp;_respond_, and&nbsp;_interact_&nbsp;with your project's data.

Simply load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.

From there, you can add&nbsp;_components_&nbsp;to your board such as buttons, switches, potentiometers, sensors, and more! Components are&nbsp;_dynamically&nbsp;_added to hardware, so you can&nbsp;immediately start interacting, logging, and streaming the data your projects produce without writing code.

If you've never used WipperSnapper, click below to read through the quick start guide before continuing.

[Quickstart: Adafruit IO WipperSnapper](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper)
## Wiring
First, wire up an MCP3421 to your board exactly as follows. Here is an example of the MCP3421 wired to an&nbsp;[Adafruit ESP32 Feather V2](https://www.adafruit.com/product/5400)&nbsp;using I2C&nbsp;[with a STEMMA QT cable (no soldering required)](https://www.adafruit.com/product/4210)

- **Board 3V** &nbsp;to&nbsp;**sensor VIN (red wire on STEMMA QT)**  
- **Board GND** &nbsp;to&nbsp;**sensor GND (black wire on STEMMA QT)**  
- **Board SCL** &nbsp;to&nbsp;**sensor SCL (yellow wire on STEMMA QT)**  
- **Board SDA** &nbsp;to&nbsp;**sensor SDA (blue wire on STEMMA QT)**

![adafruit_products_featherV2_MCP3421_STEMMAQT_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/130/214/medium640/adafruit_products_featherV2_MCP3421_STEMMAQT_bb.png?1716489874)

![adafruit_products_featherV2_MCP3421_Breadboard_bb.png](https://cdn-learn.adafruit.com/assets/assets/000/130/215/medium640/adafruit_products_featherV2_MCP3421_Breadboard_bb.png?1716489908)

## Usage

Connect your board to Adafruit IO Wippersnapper and **[navigate to the WipperSnapper board list](https://io.adafruit.com/wippersnapper).**

On this page, **select the WipperSnapper board you're using** to be brought to the board's interface page.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/216/medium800/adafruit_products_KmZMr0egOk.png?1716489947)

If you do not see your board listed here - you need [to connect your board to Adafruit IO](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper) first.

On the device page, quickly&nbsp; **check that you're running the latest version of the WipperSnapper firmware**.

The device tile on the left indicates the version number of the firmware running on the connected board.

- **If the firmware version is green with a checkmark -** &nbsp;continue with this guide.
- **If the firmware version is red with an exclamation mark "!" -** &nbsp;[update to the latest WipperSnapper firmware](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper)&nbsp;on your board before continuing.

![adafruit_products_04_LatestVersion.png](https://cdn-learn.adafruit.com/assets/assets/000/130/217/medium640/adafruit_products_04_LatestVersion.png?1716489989)

![adafruit_products_04_UpdateRequired.png](https://cdn-learn.adafruit.com/assets/assets/000/130/218/medium640/adafruit_products_04_UpdateRequired.png?1716490008)

Next, make sure the sensor is plugged into your board and click the **&nbsp;I2C Scan&nbsp;** button.

![](https://cdn-learn.adafruit.com/assets/assets/000/113/177/medium800/sensor_page_crop_scan.png?1657724520)

You should see the MCP3421's default I2C address of&nbsp;`0x68`&nbsp;pop-up in the I2C scan list.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/240/medium800/adafruit_products_Screenshot_2024-05-24_161654.png?1716563859)

###  I don't see the sensor's I2C address listed! 


First, double-check the connection and/or wiring between the sensor and the board.

Then, reset the board and let it re-connect to Adafruit IO WipperSnapper.

With the sensor detected in an I2C scan, you're ready to add the sensor to your board.

**Click the New Component button or the + button** to bring up the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/127/931/medium800/sensor_page_temperature___humidity_06_AddComponent.png?1708631009)

Adafruit IO supports a large amount of components. To quickly find your sensor, type&nbsp;`MCP3421`&nbsp;into the search bar, then select the&nbsp; **MCP3421** &nbsp;component.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/220/medium800/adafruit_products_MCP3421.png?1716492233)

On the component configuration page, the MCP3421's sensor address should be listed along with the sensor's settings.

The&nbsp; **Send Every** &nbsp;option is specific to each sensor's measurements. This option will tell the Feather how often it should read from the MCP3421 sensor and send the data to Adafruit IO. Measurements can range from every 30 seconds to every 24 hours.

For this example, set the&nbsp; **Send Every&nbsp;** interval to every 30 seconds.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/228/medium800/adafruit_products_MsfSEI8U0A.png?1716500288)

Your device interface should now show the sensor components you created. After the interval you configured elapses, WipperSnapper will automatically read values from the sensor(s) and send them to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/231/medium800/adafruit_products_Screenshot_2024-05-23_223548.png?1716500404)

To view the data that has been logged from the sensor, click on the graph next to the sensor name.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/230/medium800/adafruit_products_N8pSbmZdF3.png?1716500369)

Here you can see the feed history and edit things about the feed such as the name, privacy, webhooks associated with the feed and more. If you want to learn more about how feeds work, [check out this page](https://learn.adafruit.com/all-the-internet-of-things-episode-four-adafruit-io/advanced-feeds).

![](https://cdn-learn.adafruit.com/assets/assets/000/130/222/medium800/adafruit_products_MCP3421_FEED.png?1716496360)

# Adafruit MCP3421 18-Bit ADC

## Downloads

## Files

- [MCP3421 datasheet](https://cdn-learn.adafruit.com/assets/assets/000/126/800/original/22003e.pdf?1703176798)
- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-MCP3421-18-Bit-ADC-PCB)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20MCP3421%2018-Bit%20ADC.fzpz)

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

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


## Primary Products

### Adafruit MCP3421 18-Bit ADC - STEMMA QT / Qwiic

[Adafruit MCP3421 18-Bit ADC - STEMMA QT / Qwiic](https://www.adafruit.com/product/5870)
The&nbsp; **Adafruit MCP3421 18-Bit ADC** &nbsp;is a simple, inexpensive, and easy to use 18-bit, 240 SPS, single-channel ADC with an I2C interface that can run up to 3.4MHz clock rate. A perfect&nbsp;component whenever you need an ADC that has differential inputs, adjustable gain,...

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

## Related Guides

- [Adafruit ItsyBitsy ESP32](https://learn.adafruit.com/adafruit-itsybitsy-esp32.md)
- [Adafruit VEML6075 UVA / UVB / UV Index Sensor](https://learn.adafruit.com/adafruit-veml6075-uva-uvb-uv-index-sensor.md)
- [Adafruit INA3221 Breakout](https://learn.adafruit.com/adafruit-ina3221-breakout.md)
- [No-Code WipperSnapper Action Counter](https://learn.adafruit.com/no-code-wippersnapper-action-counter.md)
- [Adafruit PiCowbell DVI Output](https://learn.adafruit.com/adafruit-picowbell-dvi-output.md)
- [32x32 Square Pixel Art Animation Display](https://learn.adafruit.com/32x32-square-pixel-display.md)
- [Adafruit Wiz5500 Ethernet Co-Processor Breakout Board](https://learn.adafruit.com/adafruit-wiz5500-ethernet-co-processor-breakout-board.md)
- [Raspberry Pi Video Synth with Blinka and Processing](https://learn.adafruit.com/raspberry-pi-video-synth-with-blinka-and-processing.md)
- [ItsyBitsy ESP32 wFL case](https://learn.adafruit.com/itsybitsy-esp32-wfl-case.md)
- [ TensorFlow Lite for EdgeBadge Quickstart](https://learn.adafruit.com/tensorflow-lite-for-edgebadge-kit-quickstart.md)
- [Adafruit Hallowing M0](https://learn.adafruit.com/adafruit-hallowing.md)
- [Multi-Sensor IoT Environmental Sensor Box With CircuitPython](https://learn.adafruit.com/remote-iot-environmental-sensor.md)
- [Adafruit NeoSlider](https://learn.adafruit.com/adafruit-neoslider.md)
- [Adafruit Pixel Shifter](https://learn.adafruit.com/adafruit-pixel-shifter.md)
- [Milk Jug Glow Skull](https://learn.adafruit.com/milk-jug-glow-skull.md)
