nanoFramework.Iot.Device.Mcp3428 1.2.864

Prefix Reserved
dotnet add package nanoFramework.Iot.Device.Mcp3428 --version 1.2.864
                    
NuGet\Install-Package nanoFramework.Iot.Device.Mcp3428 -Version 1.2.864
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="nanoFramework.Iot.Device.Mcp3428" Version="1.2.864" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Mcp3428" Version="1.2.864" />
                    
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Mcp3428" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add nanoFramework.Iot.Device.Mcp3428 --version 1.2.864
                    
#r "nuget: nanoFramework.Iot.Device.Mcp3428, 1.2.864"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Mcp3428&version=1.2.864
                    
Install nanoFramework.Iot.Device.Mcp3428 as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Mcp3428&version=1.2.864
                    
Install nanoFramework.Iot.Device.Mcp3428 as a Cake Tool

Mcp3428 - Analog to Digital Converter (I2C)

The library implements the Microchip MCP3428 16 bit A/D converter with I2C interface. It has hardware configurable I2C address and software configurable resolution and gain. Can work in continuous and on-demand conversion modes.

Documentation

"The MCP3426, MCP3427 and MCP3428 devices (MCP3426/7/8) are the low noise and high accuracy 16 Bit Delta-Sigma Analog-to-Digital (ΔΣ A/D) Converter family members of the MCP342X series from Microchip Technology Inc. These devices can convert analog inputs to digital codes with up to 16 bits of resolution." - Datasheet

The 3 devices differ only in addressing capability and channel number. The library implements all of them.

Board

MCU Breadboard diagram

Usage

Simple example for measuring LED forward voltage using the MCP3428 ADC and a MCU.

// I2C addres based on pin configuration
var addr = Mcp3428.AddressFromPins(PinState.Low, PinState.Low);
var options = new I2cConnectionSettings(1, addr);

using (var dev = new UnixI2cDevice(options))
using (var adc = new Mcp3428(dev, ModeEnum.OneShot, ResolutionEnum.Bit16, GainEnum.X1))
{
    var ch1 = adc.ReadChannel(0);

    Debug.WriteLine($"LED forward voltage value: {ch1} V");
}

On the MCP3428 you can select 8 different I2C addresses that the device answers on. It's done by connecting two pins, Adr0 and Adr1 to supply voltage or ground or leaving then floating. The library has a helper method to choose the address based on pin states.

With this instantiating the device and reading the first channel is done like this:

var options = new I2cConnectionSettings(1,
    Mcp3428.AddressFromPins(PinState.Low, PinState.Floating));
using (var dev = new UnixI2cDevice(options))
using (var adc = new Mcp3428(dev)) // Default settings
{
    var ch1 = adc.ReadChannel(0);

    Debug.WriteLine($"ADC Channel value: {ch1} V");
}

The library provides an async API as reading with 16 bit resolution can take up to 60-80ms. It's in a separate class called Mcp3428Async.

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.864 157 4/2/2025
1.2.852 164 3/11/2025
1.2.829 108 2/27/2025
1.2.822 106 2/26/2025
1.2.775 103 2/4/2025
1.2.772 95 2/4/2025
1.2.755 107 1/31/2025
1.2.737 77 1/13/2025
1.2.704 106 12/18/2024
1.2.696 109 12/16/2024
1.2.673 114 10/23/2024
1.2.631 119 8/28/2024
1.2.590 131 7/17/2024
1.2.570 123 6/14/2024
1.2.436 324 11/10/2023
1.2.416 132 11/8/2023
1.2.329 207 5/26/2023
1.2.313 166 5/12/2023
1.2.297 170 5/3/2023
1.2.212 332 1/5/2023
1.2.203 327 12/28/2022
1.2.159 399 11/14/2022
1.2.153 403 11/5/2022
1.2.141 419 10/25/2022
1.2.95 461 9/22/2022
1.2.87 533 9/15/2022
1.2.82 513 9/14/2022
1.1.116.8772 480 6/24/2022
1.1.113.2032 463 6/23/2022
1.1.97.17326 500 6/13/2022
1.1.92.53000 462 6/8/2022
1.1.58.10097 481 5/23/2022
1.1.3 483 4/15/2022
1.1.1 484 4/14/2022
1.0.300 513 3/31/2022
1.0.288-preview.114 148 3/25/2022
1.0.288-preview.113 136 3/25/2022
1.0.288-preview.104 130 3/22/2022
1.0.288-preview.100 139 3/19/2022
1.0.288-preview.98 142 3/18/2022
1.0.288-preview.93 138 3/15/2022
1.0.288-preview.65 146 2/18/2022
1.0.288-preview.48 160 2/4/2022
1.0.288-preview.42 155 1/31/2022
1.0.288-preview.29 154 1/28/2022
1.0.288-preview.22 151 1/27/2022
1.0.288-preview.20 158 1/27/2022
1.0.288-preview.18 156 1/27/2022
1.0.288-preview.1 157 1/21/2022
1.0.260 347 12/10/2021
1.0.259 341 12/9/2021
1.0.258 328 12/8/2021
1.0.189 452 9/25/2021
1.0.155 370 8/31/2021
1.0.138 406 7/18/2021
1.0.136 443 7/17/2021
1.0.135 194 7/16/2021
1.0.134 206 7/15/2021
1.0.133 231 7/14/2021
1.0.130 190 7/6/2021
1.0.125 236 7/5/2021
1.0.121 238 6/29/2021
1.0.119 256 6/28/2021
1.0.112 239 6/16/2021
1.0.105 311 5/29/2021
1.0.55 242 5/25/2021