denkitronik / ads1118 Goto Github PK
View Code? Open in Web Editor NEWArduino Library for Texas Instruments ADS1118 - 16-Bit Analog-to-Digital Converter with internal Reference and Temperature Sensor
License: MIT License
Arduino Library for Texas Instruments ADS1118 - 16-Bit Analog-to-Digital Converter with internal Reference and Temperature Sensor
License: MIT License
You are setting the wrong variable in these methods.
configRegister.bits.operatingMode
should be
configRegister.bits.pullUp
NoWait variants of getmillis and getADC are defined inside #elif defined(ESP32), together with .begin.
Using the example ads1118example sketch, changed to ads1118.setInputSelected(ads1118.AIN_0) on an Arduino Nano I get very random results with this library. Why does the temperature reading vary wildly?
22.3125020000mV
9.718750 C
22.3125020000mV
9.937500 C
22.3125020000mV
10.156250 C
22.3125020000mV
10.531250 C
22.3125020000mV
10.656250 C
22.3125020000mV
11.031250 C
22.3437520000mV
3.656250 C
22.3437520000mV
10.343750 C
22.3437520000mV
10.062500 C
22.3437520000mV
10.218750 C
22.3437520000mV
10.250000 C
22.3437520000mV
10.218750 C
22.3437520000mV
10.218750 C
12.0156260000mV
10.281250 C
22.3437520000mV
10.343750 C
22.3750000000mV
10.312500 C
22.3750000000mV
10.531250 C
22.3750000000mV
10.812500 C
22.3750000000mV
22.375000 C
22.3750000000mV
11.968750 C
22.3750000000mV
11.156250 C
22.3750000000mV
11.187500 C
22.3750000000mV
10.937500 C
22.3750000000mV
10.781250 C
22.3750000000mV
0.000000 C
22.4062500000mV
22.406250 C
22.4062500000mV
0.000000 C
22.4062500000mV
0.000000 C
22.4062500000mV
0.000000 C
22.4062500000mV
0.031250 C
22.4062500000mV
8.937500 C
22.4062500000mV
9.906250 C
22.4062500000mV
10.125000 C
22.4062500000mV
10.781250 C
22.4062500000mV
10.656250 C
22.4062500000mV
10.437500 C
22.4062500000mV
10.593750 C
22.4062500000mV
10.468750 C
22.4062500000mV
10.718750 C
22.4062500000mV
11.000000 C
12.5625000000mV
10.906250 C
22.4375020000mV
11.593750 C
22.4375020000mV
11.750000 C
22.4375020000mV
0.125000 C
22.4375020000mV
0.093750 C
22.4375020000mV
0.000000 C
22.4375020000mV
0.000000 C
0.0000000000mV
0.000000 C
22.4375020000mV
I managed to get the library working with both the ItsyBitsy M0 and M4 from adafruit with a relatively small code fix. I can submit a pull request(I think) once I get a bit more familiar with GIT, but the only change that needs to be made is to replace
#if defined(__AVR__)
with
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_SAMD)
If other boards use the standard SPI configuration as defined for AVRs, then moving to
#if defined(ESP32)
// esp32 specific code here
#elif
// code for everyone else here
#endif
might work better.
I've seen that for AVR hardware SPI the driver doesn't call SPI.beginTransaction, therefore in case you are working with multiple SPI devices, transaction settings could be overriden by another device. I've tested this using Ethernet Shield and two ADS1118, and after each ethernet call the adc gets misconfigured. I've suggest to add the instruction into AVR blocks too.
There is a problem with second TC (thermocouple) reading: it is off by couple degrees or some mV. I've already edited this issue while troubleshooting, and so far the only problem left is this voltage difference. With detached TCs, readings are ~150 mV from 1st TC end analog input, and ~250 form the second. I did not calculate schematics parameters, I just followed ADS datasheet blueprint for RC part and this github project for arduino, and electric part is not my strong point so I am a bit at loss here. Is it supposed to have voltage difference and therefore temperature difference by some degrees, or the datasheet schematics themselves are bit off?
Hello~
Arduino mega (ATmega2560)
I used getMilliVolts() function to read voltage of DIFF_0_1 and it works well but it needs totally 257ms. ???
Does this function need long execution time?
How can I use getMilliVoltsNoWait() function ?
I can't understand parameters, (uint8_t pin_drdy, double &volts)
double Vtc1 = 0;
int drdy = 50; // PB3
bool b_return = getMilliVoltsNoWait(drdy, &Vtc1); // it makes error in compiling.
Anybody help~
What are the function arguments to the begin() function? without dissecting the code i want to use single ended mode not the differential mode used in the examples. In fact a completed list for all functions would be helpful.
Great library, thanks a bunch! Just wanted to suggest a quick change which would add support for the Teensy Microcontrollers. Would just need to change
#if defined(__AVR__)
to
#if defined(__AVR__) || defined(CORE_TEENSY)
tested and everything should work as expected.
Dears
Seems there's a conflict between display and the sensor. I used an esp32 to connect but nothing seems to work.
I only connect CS PIN (ads1118 and sharp display) with two pins differents. How could be the solutions?
Thank you
When i try to use the ads1118.getADCValue() function I get an error message error: no matching function for call to 'ADS1118::getADCValue()'
line is Serial.println(String(ads1118.getADCValue()));
Can you tell me why this is an issue? And how can i pull the raw ADC value for a given channel?
Might this library work on an ESP8266? Anyone used it on an ESP8266?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.