Giter VIP home page Giter VIP logo

Comments (2)

wollewald avatar wollewald commented on May 27, 2024

@realdognose, I have just tried the following sketch:

#include<ADS1115_WE.h> 
#include<Wire.h>
#define I2C_ADDRESS 0x48
ADS1115_WE adc = ADS1115_WE(I2C_ADDRESS);

void setup() {
  Wire.begin();
  Serial.begin(9600);
  if(!adc.init()){
    Serial.println("ADS1115 not connected!");
  }
  adc.setVoltageRange_mV(ADS1115_RANGE_6144); //comment line/change parameter to change range
  adc.setCompareChannels(ADS1115_COMP_0_GND); //comment line/change parameter to change channel
  adc.setMeasureMode(ADS1115_CONTINUOUS); //comment line/change parameter to change mode
}

void loop() {
  float voltage = 0.0;

  Serial.print("0_1: ");
  voltage = readChannel(ADS1115_COMP_0_1);
  Serial.print(voltage);

  Serial.print(",   2_3: ");
  voltage = readChannel(ADS1115_COMP_2_3);
  Serial.println(voltage);
  delay(1000);
}

float readChannel(ADS1115_MUX channel) {
  float voltage = 0.0;
  adc.setCompareChannels(channel);
  voltage = adc.getResult_V(); // alternative: getResult_mV for Millivolt
  return voltage;
}

And I have applied this circuit:

Screenshot 2024-04-20 203852

And this is what I get as output:
Screenshot 2024-04-20 202645

Both positive as expected and same result on the multimeter. Repeated with mV Range and still a match (< 1mV deviation). So, all OK on my side. That leads to the difficult question what leads to the negative values on your side and honestly speaking I have no idea.

With regards to the link you sent: according to my expereince, the data sheet and my latest results A0 and A2 are the positive inputs to get positive results.

What you could do is checking the wiring on the module, i.e. is the resistance between the Ax (with x = 0-3) Pin of the ADS1115 IC and and the Ax Pin that you connect to your voltage to be measured zero? I have never seen or heard that someone had a wrongly wired module, but not sure what else it could be.

from ads1115_we.

realdognose avatar realdognose commented on May 27, 2024

hmm, last thing I could check is the actual supply of the AD-Board. Maybe flipping VCC+ and GND makes it produce inverted results and that is what happened? (Not sure, would rather expect it to die immediately, if that would have happened)

Will verify when in range of the device again.

(For now, adding a *-1 obvisouly worked out as well)

With regards to the link you sent: according to my expereince, the data sheet and my latest results A0 and A2 are the positive inputs to get positive results.

Yeah, I also think the datasheet is right and clear on this.

from ads1115_we.

Related Issues (20)

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.