GithubHelp home page GithubHelp logo

denkitronik / ads1118 Goto Github PK

View Code? Open in Web Editor NEW
19.0 6.0 14.0 984 KB

Arduino Library for Texas Instruments ADS1118 - 16-Bit Analog-to-Digital Converter with internal Reference and Temperature Sensor

License: MIT License

C++ 88.83% C 11.17%

ads1118's People

Contributors

alvaro-salazar avatar per1234 avatar vishnueaswaran avatar wfang-tochtech avatar wfang2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ads1118's Issues

enablePullup and disablePullup

You are setting the wrong variable in these methods.

configRegister.bits.operatingMode

should be

configRegister.bits.pullUp

Totally meaningless results

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

SAMD Support

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.

SPI begin transaction

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.

Two thermocouples device, second thermocouple readings issue.

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?

getMilliVoltsNoWait(uint8_t pin_drdy, double &volts); function, How can I use it?

Hello~

Arduino mega (ATmega2560)

  1. 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?

  2. 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~

Function arguments

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.

Support for Teensy Microcontrollers

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.

connect with a spi display

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

Error calling function

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.