VOOZH about

URL: https://www.nuget.org/packages/nanoFramework.Iot.Device.Ads1115/

⇱ NuGet Gallery | nanoFramework.Iot.Device.Ads1115 1.2.952




👁 Image
nanoFramework.Iot.Device.Ads1115 1.2.952

Prefix Reserved
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package nanoFramework.Iot.Device.Ads1115 --version 1.2.952
 
 
NuGet\Install-Package nanoFramework.Iot.Device.Ads1115 -Version 1.2.952
 
 
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.Ads1115" Version="1.2.952" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="nanoFramework.Iot.Device.Ads1115" Version="1.2.952" />
 
Directory.Packages.props
<PackageReference Include="nanoFramework.Iot.Device.Ads1115" />
 
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.Ads1115 --version 1.2.952
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: nanoFramework.Iot.Device.Ads1115, 1.2.952"
 
 
#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.
#:package nanoFramework.Iot.Device.Ads1115@1.2.952
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=nanoFramework.Iot.Device.Ads1115&version=1.2.952
 
Install as a Cake Addin
#tool nuget:?package=nanoFramework.Iot.Device.Ads1115&version=1.2.952
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ADS1115 - Analog to Digital Converter

ADS1115 is an Analog-to-Digital converter (ADC) with 16 bits of resolution.

Documentation

Prodcut datasheet can be found here

Sensor Image

Usage

Important: make sure you properly setup the I2C pins especially for ESP32 before creating the I2cDevice, make sure you install the nanoFramework.Hardware.ESP32 nuget:

//////////////////////////////////////////////////////////////////////
// when connecting to an ESP32 device, need to configure the I2C GPIOs
// used for the bus
Configuration.SetPinFunction(21, DeviceFunction.I2C1_DATA);
Configuration.SetPinFunction(22, DeviceFunction.I2C1_CLOCK);

For other devices like STM32, please make sure you're using the preset pins for the I2C bus you want to use.

// set I2C bus ID: 1
// ADS1115 Addr Pin connect to GND
I2cConnectionSettings settings = new I2cConnectionSettings(1, (int)I2cAddress.GND);
I2cDevice device = I2cDevice.Create(settings);

// pass in I2cDevice
// measure the voltage AIN0
// set the maximum range to 6.144V
using (Ads1115 adc = new Ads1115(device, InputMultiplexer.AIN0, MeasuringRange.FS6144))
{
 // read raw data form the sensor
 short raw = adc.ReadRaw();
 // raw data convert to voltage
 double voltage = adc.RawToVoltage(raw);
}

See the samples project for more examples and usage for different applications.

If you want to use the interrupt pin, the pulses generated by the ADS1115 might be to short to be properly recognized in the software, i.e. on a MCU. The schematic below shows a way of increasing the pulse length so that it is properly recognized (from about 10us to 150us). This uses discrete electronics, but an implementation with an NE555 or equivalent would likely work as well (Just note that you need a type that works at 3.3V).

Example

Hardware Required

  • ADS1115
  • Rotary Potentiometer
  • Male/Female Jumper Wires

Circuit

ADS1115

  • ADDR - GND
  • SCL - SCL
  • SDA - SDA
  • VCC - 5V
  • GND - GND
  • A0 - Rotary Potentiometer Pin 2

Rotary Potentiometer

  • Pin 1 - 5V
  • Pin 2 - ADS1115 Pin A0
  • Pin 3 - GND

Code

// set I2C bus ID: 1
// ADS1115 Addr Pin connect to GND
I2cConnectionSettings settings = new I2cConnectionSettings(1, (int)I2cAddress.GND);
I2cDevice device = I2cDevice.Create(settings);

// pass in I2cDevice
// measure the voltage AIN0
// set the maximum range to 6.144V
using (Ads1115 adc = new Ads1115(device, InputMultiplexer.AIN0, MeasuringRange.FS6144))
{
 // loop
 while (true)
 {
 // read raw data form the sensor
 short raw = adc.ReadRaw();
 // raw data convert to voltage
 double voltage = adc.RawToVoltage(raw);

 Debug.WriteLine($"ADS1115 Raw Data: {raw}");
 Debug.WriteLine($"Voltage: {voltage}");
 Debug.WriteLine();

 // wait for 2s
 Thread.Sleep(2000);
 }
}

Results

Product Versions Compatible and additional computed target framework versions.
.NET Framework net 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
2.0.0-preview.85 50 6/1/2026
2.0.0-preview.80 51 5/27/2026
2.0.0-preview.73 60 5/20/2026
2.0.0-preview.69 59 5/18/2026
2.0.0-preview.62 60 5/13/2026
2.0.0-preview.49 49 5/4/2026
2.0.0-preview.45 64 4/29/2026
2.0.0-preview.37 68 4/22/2026
2.0.0-preview.32 65 4/20/2026
2.0.0-preview.16 72 3/10/2026
1.2.952 148 3/4/2026
1.2.931 323 11/10/2025
1.2.907 274 10/2/2025
1.2.889 257 7/28/2025
1.2.869 388 4/2/2025
1.2.864 335 4/2/2025
1.2.852 333 3/11/2025
1.2.846 341 3/10/2025
1.2.822 293 2/26/2025
1.2.775 312 2/4/2025
Loading failed