# Adafruit HUSB238 USB Type C Power Delivery Breakout

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/124/705/medium800thumb/adafruit_products_5807-07.jpg?1695650253)

The HUSB238 USB PD sink chip is neat in that you can either use jumpers (really, resistor selection) to set the desired power delivery voltage and current _or_ you can use I2C for dynamic querying and setting.

We've built a nice **Adafruit USB Type C Power Delivery Dummy Breakout** board around the HUSB238 to make it very easy to configure and integrate without having to solder any tiny resistors.

![](https://cdn-learn.adafruit.com/assets/assets/000/124/706/medium800/adafruit_products_5807-04.jpg?1695650315)

It's perfect for use with USB Type C wall adapters that can provide multiple voltages, the standard offerings are 5V, 9V, 12V, 15V, 18V and 20V. This HUSB238 breakout plugs into the USB C cable and then over the CC lines will negotiate the PD request and commands. For example we can ask what voltages are available and then pick the highest one. Or if you need a specific voltage it will specifically select that one.

![](https://cdn-learn.adafruit.com/assets/assets/000/124/707/medium800/adafruit_products_5807-03.jpg?1695650354)

This breakout will be handy for projects where you need a lot more than 5V @ 2A power: this adapter can give up to 20V at 5A - yes you can get 100W over USB C! - and you could buck that down to get a ton of current at 5V or 12V if that's needed. Or use it to convert a DC or battery-powered device into a USB C powered one!

![](https://cdn-learn.adafruit.com/assets/assets/000/124/709/medium800/adafruit_products_5807-02.jpg?1695650457)

 **Jumper-configured usage is simple** : by default its hard-wired for 5V 1A output since that's what USB C will always provide at first. Cut the 5V jumper and solder closed the 9V, 12V, 15V, 18V or 20V jumper to select the resistor that sets the voltage. You can also select the desired current from 2A to 3A, although we have found that this isn't as essential, you could always just pull as much as the adapter will provide. No microcontroller or microcomputer is required!

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/124/708/medium800/adafruit_products_5807-01.jpg?1695650388)

 **I2C-configured usage** is a little more challenging. Since the Vout can be as high as 20V, we don't have an onboard voltage regulator or pullup resistors. Connect to a microcontroller or microcomputer board that has a separate power supply (or that can regulate from up-to-20V if you plan on selecting that high) and I2C pull-up resistors to your desired logic level. Then use the [Arduino library and example code](https://github.com/adafruit/Adafruit_HUSB238) to query the USB Type C PD source for available voltages and currents and select the desired voltage dynamically. When configuring over I2C, the jumper settings are used on startup until the I2C commands come over.

Comes with a small bit of header and a terminal block so you can decide whether you want to use it in a breadboard, or free-wired.

# Adafruit HUSB238 USB Type C Power Delivery Breakout

## Pinouts

![](https://cdn-learn.adafruit.com/assets/assets/000/124/710/medium800/adafruit_products_double.jpg?1695650778)

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

## Power Pins

- **V+** - This is the voltage output ( **Vout** ) pin. This pin will output the voltage selected from the HUSB238. It is also available from the **+** pin from the terminal block.
- **GND** - Common ground for power and logic. It is also available from the **-** pin from the terminal block.

## I2C

Since the Vout can be as high as 20V, we don't have an onboard voltage regulator or pull-up resistors on the I2C lines. Connect these pins to a microcontroller or microcomputer board that has a separate power supply (or that can regulate from up-to-20V if you plan on selecting that high) and I2C pull-up resistors to your desired logic level. When configuring over I2C, the jumper settings are used on startup until the I2C commands come over.

- **SCL** - I2C clock pin, connect to your microcontroller's I2C clock line.
- **SDA** - I2C data pin, connect to your microcontroller's I2C data line.

Warning: 

## USB Type C Port and Data Pins

At the top of the board is the USB type C port. You'll use this port to plug into a USB C PD wall adapter with a USB C cable. The USB data pins are broken out on the board: Data Plus (labeled **D+** on the board silk) and Data Minus (labeled **D-** on the board silk).

## Jumpers

A series of jumpers are used to determine the voltage and current requested from the PD adapter. By default, the **5V** and **1A** jumpers are closed. You can cut these jumpers to change voltages and/or amps.

### Amp Jumpers

- **1A** - The one amp jumper. Closed by default. Cut the jumper to change amperage.
- **2A** - The two amps jumper. Open by default. Solder it closed to select.

To select **3A** , leave both the **1A** and **2A** jumpers open.

### Voltage Jumpers

- **5V** - The 5V jumper. Closed by default. Cut the jumper to change voltages.
- **9V** - The 9V jumper. Open by default. Solder it closed to select.
- **12V** - The 12V jumper. Open by default. Solder it closed to select.
- **15V** -&nbsp;The 15V jumper. Open by default. Solder it closed to select.
- **18V** - The 18V jumper. Open by default. Solder it closed to select.

To select **20V** , or the highest available voltage from your adapter, leave all of the voltage jumpers open.

# Adafruit HUSB238 USB Type C Power Delivery Breakout

## CircuitPython and Python

It's easy to use the **HUSB238** with Python or CircuitPython, and the [Adafruit\_CircuitPython\_HUSB238](https://docs.circuitpython.org/projects/husb238/en/latest/) module. This module allows you to easily write Python code to control the power delivery chip.

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. For testing, you can connect the **+** and **-** outputs from the breakout to a multimeter with alligator clips. You'll set the multimeter to read DC voltage (labeled with a "V" and one dashed and one solid line). The following is the breakout wired to a Feather RP2040 using a solderless breadboard:

- **USB C PD power supply** to **breakout USB C port**
- **Board GND** to **breakout GND (black wire)**
- **Board SCL** to **breakout SCL (yellow wire)**
- **Board SDA** to **breakout SDA (blue wire)**
- **Breakout +** to **multimeter positive (red wire)**
- **Breakout -** to **multimeter negative (black wire)**

![components_feather_bb_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/186/medium640/components_feather_bb_bb.jpg?1697468083)

### Digital Multimeter - Model 9205B+

[Digital Multimeter - Model 9205B+](https://www.adafruit.com/product/2034)
This massive multimeter has everything but the kitchen sink included. It's a great addition to any workbench or toolbox. &nbsp;It's low cost, simple to use, and has a big clear display with all the measurements you need and more!

The multimeter includes:

- AC/DC Voltage...

In Stock
[Buy Now](https://www.adafruit.com/product/2034)
[Related Guides to the Product](https://learn.adafruit.com/products/2034/guides)
![Angled shot of a Digital Multimeter - Model 9205B+. ](https://cdn-shop.adafruit.com/640x480/2034-01.jpg)

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

For testing, you can connect the **+** and **-** outputs from the breakout to a multimeter with alligator clips. You'll set the multimeter to read DC voltage (labeled with a "V" and one dashed and one solid line).

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

- **USB C PD power supply** to **breakout USB C port**
- **Pi GND** to **breakout GND (black wire)**
- **Pi SCL** to **breakout SCL (yellow wire)**
- **Pi SDA** to **breakout SDA (blue wire)**
- **Breakout +** to **multimeter positive (red wire)**
- **Breakout -** to **multimeter negative (black wire)**

![components_pi_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/187/medium640/components_pi_bb.jpg?1697468099)

## Python Installation of HUSB238 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-husb238`

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\_HUSB238** 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 and file:

- **adafruit\_bus\_device/**
- **adafruit\_register/**
- **adafruit\_husb238.mpy**

![CIRCUITPY](https://adafruit.github.io/Adafruit_CircuitPython_Bundle/husb238_husb238_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_HUSB238/blob/main/examples/husb238_simpletest.py

For this example, it's best to test with the output from the breakout connected to a multimeter in DC voltage mode. DC voltage mode is labeled with a V and two lines, one dashed and one solid. [For information on using a multimeter, check out this guide.](https://learn.adafruit.com/multimeters/overview)

![components_instruments_masdcvoltage.jpg](https://cdn-learn.adafruit.com/assets/assets/000/125/190/medium640/components_instruments_masdcvoltage.jpg?1697468167)

[Multimeters Learn Guide](https://learn.adafruit.com/multimeters/overview)
In the example, the HUSB238 is instantiated over I2C. Then, the available voltages are read from the attached USB-C PD power supply. In the loop, the available voltages are set, one by one, by the HUSB238. You'll see these output on your multimeter. The voltage and current are read from the PD supply and are printed to the serial console.

![](https://cdn-learn.adafruit.com/assets/assets/000/125/579/medium800/components_cp_serial.png?1698176120)

# Adafruit HUSB238 USB Type C Power Delivery Breakout

## Python Docs

# Adafruit HUSB238 USB Type C Power Delivery Breakout

## Arduino

Using the HUSB238 breakout with Arduino involves wiring up the breakout to your Arduino-compatible microcontroller, installing the [Adafruit\_HUSB238](https://github.com/adafruit/Adafruit_HUSB238) library, plugging in a USB C PD power supply to the breakout and running the provided example code. It's important to note that when you are controlling the breakout over I2C, the jumper settings on the board are used on startup until the I2C commands come over.

Warning: 

## Wiring

Here is an Adafruit Metro wired up to the breakout. For testing, you can connect the **+** and **-** outputs from the breakout to a multimeter with alligator clips. You'll set the multimeter to read DC voltage (labeled with a "V" and one dashed and one solid line).

- **USB C PD power supply** to **breakout USB C port**
- **Board GND** to **breakout GND (black wire)**
- **Board SCL** to **breakout SCL (yellow wire)**
- **Board SDA** to **breakout SDA (blue wire)**
- **Breakout +** to **multimeter positive (red wire)**
- **Breakout -** to **multimeter negative (black wire)**

![adafruit_products_metro_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/124/719/medium640/adafruit_products_metro_bb.jpg?1695737394)

### Digital Multimeter - Model 9205B+

[Digital Multimeter - Model 9205B+](https://www.adafruit.com/product/2034)
This massive multimeter has everything but the kitchen sink included. It's a great addition to any workbench or toolbox. &nbsp;It's low cost, simple to use, and has a big clear display with all the measurements you need and more!

The multimeter includes:

- AC/DC Voltage...

In Stock
[Buy Now](https://www.adafruit.com/product/2034)
[Related Guides to the Product](https://learn.adafruit.com/products/2034/guides)
![Angled shot of a Digital Multimeter - Model 9205B+. ](https://cdn-shop.adafruit.com/640x480/2034-01.jpg)

## Library Installation

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

![](https://cdn-learn.adafruit.com/assets/assets/000/124/720/medium800/adafruit_products_Arduino_Open_Library_Manager.png?1695739512)

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

![](https://cdn-learn.adafruit.com/assets/assets/000/124/721/medium800/adafruit_products_arduino_lib.png?1695739568)

If asked about dependencies, click "Install all".

![](https://cdn-learn.adafruit.com/assets/assets/000/124/722/medium800/adafruit_products_depends.png?1695739602)

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

Warning: 

## Simple Test
https://github.com/adafruit/Adafruit_HUSB238/blob/main/examples/HUSB238_test/HUSB238_test.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the HUSB238 recognized over I2C by the code. It will set the voltage to 5V over I2C. Then, it will query the attached PD adapter to see which voltage and current combinations are available and print the currently set voltage.

![](https://cdn-learn.adafruit.com/assets/assets/000/124/723/medium800/adafruit_products_testSketchSerial.png?1695739726)

## Test All Voltages Example
For this example, it's best to test with the output from the breakout connected to a multimeter in DC voltage mode. DC voltage mode is labeled with a V and two lines, one dashed and one solid. [For information on using a multimeter, check out this guide.](https://learn.adafruit.com/multimeters/overview)

![adafruit_products_instruments_masdcvoltage.jpg](https://cdn-learn.adafruit.com/assets/assets/000/124/724/medium640/adafruit_products_instruments_masdcvoltage.jpg?1695739940)

[Multimeters Learn Guide](https://learn.adafruit.com/multimeters/overview)
https://github.com/adafruit/Adafruit_HUSB238/blob/main/examples/HUSB238_TryAllVoltages/HUSB238_TryAllVoltages.ino

![](https://cdn-learn.adafruit.com/assets/assets/000/124/725/medium800/adafruit_products_allVoltsSerial.png?1695740087)

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the HUSB238 recognized over I2C by the code. Then, it will try setting a new voltage one after the other. As the Serial Monitor updates, you should see the same voltage read by your multimeter.

![](https://cdn-learn.adafruit.com/assets/assets/000/124/726/medium800thumb/adafruit_products_5807-07.jpg?1695740199)

# Adafruit HUSB238 USB Type C Power Delivery Breakout

## Arduino Docs

# Adafruit HUSB238 USB Type C Power Delivery Breakout

## Downloads

## Files

- [HUSB238 Datasheet](https://cdn-learn.adafruit.com/assets/assets/000/125/150/original/husb238_datasheet_full.pdf?1697209172)
- [EagleCAD PCB Files on GitHub](https://github.com/adafruit/Adafruit-USB-Type-C-Power-Delivery-Dummy-Breakout-PCB)
- [3D models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/5807%20HUSB238%20Breakout)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20HUSB238%20USB-C%20PD%20Breakout.fzpz)

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

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


## Primary Products

### Adafruit USB Type C Power Delivery Dummy Breakout - I2C or Fixed

[Adafruit USB Type C Power Delivery Dummy Breakout - I2C or Fixed](https://www.adafruit.com/product/5807)
The HUSB238 USB PD sink chip is neat in that you can either use jumpers (really, resistor selection) to set the desired PD voltage and current _or_ you can use I2C for dynamic querying and setting. We've build a nice&nbsp; **Adafruit USB Type C Power Delivery Dummy Breakout...**

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

## Featured Products

### USB C to USB C Cable - USB 3.1 Gen 4 with E-Mark - 1 meter long

[USB C to USB C Cable - USB 3.1 Gen 4 with E-Mark - 1 meter long](https://www.adafruit.com/product/4199)
As technology changes and adapts, so does Adafruit! Rather than the regular USB A, this cable has&nbsp; **USB C to USB C** &nbsp;plugs!

USB C is the latest industry-standard connector for transmitting data&nbsp;_and_&nbsp;power. Like Lightning and MagSafe cables, USB C...

In Stock
[Buy Now](https://www.adafruit.com/product/4199)
[Related Guides to the Product](https://learn.adafruit.com/products/4199/guides)
### Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces](https://www.adafruit.com/product/3448)
When working&nbsp;with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These compact jumper cables have a premium male header on one end and a grippy mini alligator clip on the...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3448)
[Related Guides to the Product](https://learn.adafruit.com/products/3448/guides)
### Digital Multimeter - Model 9205B+

[Digital Multimeter - Model 9205B+](https://www.adafruit.com/product/2034)
This massive multimeter has everything but the kitchen sink included. It's a great addition to any workbench or toolbox. &nbsp;It's low cost, simple to use, and has a big clear display with all the measurements you need and more!

The multimeter includes:

- AC/DC Voltage...

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

## Related Guides

- [CircuitPython Essentials](https://learn.adafruit.com/circuitpython-essentials.md)
- [Spinning Logo](https://learn.adafruit.com/spinning-logo.md)
- [Drama Piñata](https://learn.adafruit.com/customizable-reusable-pinata.md)
- [Plantagotchi: PyBadge Plant Monitor](https://learn.adafruit.com/plantagotchi-pybadge-plant-monitor.md)
- [Trash-Built Robotic Fish](https://learn.adafruit.com/trash-robo-fish.md)
- [CRICKIT Exhibit Demo Board](https://learn.adafruit.com/crickit-exhibit-demo-board.md)
- [Pushrod Garage](https://learn.adafruit.com/pushrod-garage.md)
- [Comparison and Experimentation with Flammable Gas Sensors](https://learn.adafruit.com/gas-sensor-comparison.md)
- [Automation with Crickit and Capsela](https://learn.adafruit.com/automation-with-crickit-and-capsela.md)
- [Circuit Playground Express Spooky Laughing Box](https://learn.adafruit.com/spooky-circuit-playground-express-mystery-box.md)
- [Make It Bubble](https://learn.adafruit.com/make-it-bubble.md)
- [Archimedes' Boat](https://learn.adafruit.com/archimedes-boat.md)
- [micro:bit Lesson 4. Sensing Light](https://learn.adafruit.com/micro-bit-lesson-4-sensing-light-and-temperature.md)
- [Tilt Controlled Marble Maze](https://learn.adafruit.com/tilt-controlled-marble-maze.md)
- [Adafruit Simple Soil Moisture Sensor](https://learn.adafruit.com/adafruit-simple-soil-moisture-sensor.md)
