Comments (2)
@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:
And this is what I get as output:
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.
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)
- Ability to use result range HOT 44
- SPS is Low HOT 3
- Reduce code duplication HOT 3
- Hysteresis HOT 27
- Can you make an example on how to use the library in continous mode using more than one input? HOT 3
- ADS1115 - real 16 bit resolution? HOT 11
- Connecting another device change the voltage of the other device HOT 2
- Differential example HOT 5
- getResultWithRange(), can you please precise? HOT 2
- different gain settings by channel? HOT 7
- Why autorange blocks so much time when range is under 80% max? HOT 4
- Example with 2 I2C addresses HOT 1
- add license to library.properties HOT 2
- Using Wire1 with teensy 4.0 HOT 3
- Question: wrong read value HOT 9
- Use with ADS1015? HOT 9
- sometimes no value on random channel HOT 13
- Is the duplicate call to delayAccToRate() in setCompareChannels() necessary? HOT 3
- Speed of 1015 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ads1115_we.