ads1115 analog to digital converter Node.js and C++ library
If you like my work and find it helpful, please support me.
This library works only on Raspberry Pi with 64bit OS.
32bit OS is no longer supported.
npm install @iiot2k/ads1115
or add in your package.json
:
"dependencies": {
"@iiot2k/ads1115": "latest"
},
View on npm📌
View on GitHub📌
Report any issues here📌
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.
- 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 config.txt,
then Pin27=SDA, Pin28=SCK.
- For other ports add this to config.txt.
- The default i2c speed is 100kHz, to speed up add/change this line in config.txt:
dtparam=i2c_arm=on,i2c_arm_baudrate=400000
I2C Address | ADDR Pin |
---|---|
48H | GND or open |
49H | VCC |
4AH | SDA |
4BH | SCL |
Node.js API functions are explained in document API.md
Node.js examples are on examples folder.
This library uses C++ addon modules as interface to hardware.
Therefore, there is also a C++ interface to the drivers.
Some C++ examples are in the cpp directory.
The C++ API functions are described in the header file ads1115_lib.h