2.1.0 • Published 6 days ago

@iiot2k/ads1115 v2.1.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 days ago

@iiot2k/ads1115

platform

ads1115 analog to digital converter library

Installation

npm install @iiot2k/ads1115

or add in your package.json:

"dependencies": {
    "@iiot2k/ads1115": "latest"
},

View on npm View on GitHub

ads1115 16bit analog to digital converter

  • 16bit Conversion Resolution.
  • Four Analog Inputs.
  • Each input can be selected Single-Ended, Differential.
  • Internal Voltage Reference.
  • Internal Oscillator.
  • Programmable Data Rate 8 SPS to 860 SPS.
  • The PGA offers input ranges from ±256 mV to ±6144 mV.
  • I2C Interface with four pin-selectable addresses.

Usage

  • This library works on Raspberry Pi with 32bit or 64bit OS.
  • The output value is mV or adc raw data.
  • Enable I2C with raspi-config.
  • In this case i2c-1 is enabled (port=1).
  • If you use i2c-0 port add dtparam=i2c_vc=on to /boot/config.txt, then Pin27=SDA, Pin28=SCK.
  • For other ports add this to /boot/config.txt.

API

API functions are explained in documents API.md

C++ libraries and examples

Report any issues here

Address Pin Connection

I2C AddressADDR Pin
48HGND or open
49HVCC
4AHSDA
4BHSCL

Example

Examples are on examples folder.

// example reads single adc input
"use strict";

const ads1115 = require("@iiot2k/ads1115");

ads1115.read(
    1, // i2c-1
    ads1115.ADR_48, // address 0x48
    ads1115.MUX_I0_GND, // AIN0 - GND
    ads1115.GAIN_4096, // 4096 mV
    ads1115.RATE_128, // 128 SPS
    false, // no rawdata
    function(data) {
        if (data === undefined)
            console.log(ads1115.error_text());
        else
            console.log(data, "mV");
    });
2.1.0

6 days ago

2.0.7

2 months ago

2.0.6

2 months ago

2.0.9

1 month ago

2.0.10

18 days ago

2.0.8

2 months ago

2.0.1

2 months ago

2.0.0

2 months ago