wollewald / ADS1220_WE

Arduino library for the 24-bit, 4 channel ADS1220 ADC
https://wolles-elektronikkiste.de/en/
MIT License
22 stars 2 forks source link

About AIN2 pin #2

Closed djdlgl closed 1 year ago

djdlgl commented 2 years ago

Hello, I am having a problem with AIN2 pin.

The other pins are well working like if I connect AIN0 to GND, it shows few miliV only which is very close to GND. However, for AIN2 pin, it shows about 500 mV. Why does it happen? Even, I am not using with IDAC function.

And according to your tutorial, I checked that your AIN2 (microVolt) is about 800 mV.

Thank you for reading.

wollewald commented 2 years ago

Hi @djdlgl ,

I just tried it. I took the following small sketch:

#include <ADS1220_WE.h>
#include <SPI.h>

#define ADS1220_CS_PIN    7 // chip select pin
#define ADS1220_DRDY_PIN  6 // data ready pin 

ADS1220_WE ads = ADS1220_WE(ADS1220_CS_PIN, ADS1220_DRDY_PIN);

void setup(){
  Serial.begin(9600);
  ads.init();
  ads.bypassPGA(true);
}

void loop(){
  float result = 0.0;
  long longResult = 0;

  ads.setCompareChannels(ADS1220_MUX_0_AVSS);
  result = ads.getVoltage_mV();
  Serial.print("AIN0 vs. AVSS  [mV]: ");
  Serial.println(result);

  ads.setCompareChannels(ADS1220_MUX_2_AVSS);
  result = ads.getVoltage_mV();
  Serial.print("AIN2 vs. AVSS  [mV]: ");
  Serial.println(result);

  Serial.println();

  delay(2000);
}

When I attach AIN0 and AIN2 to GND I get the following output:

Screenshot 2022-08-23 202002

When I attach both to ~1 Volt, then I get:

Screenshot 2022-08-23 201407

The results are more or less as expected, i.e. I can't reproduce the issue you are facing.

If you apply exactly the same sketch like the one above, do you get results that make sense? If no, then something might be wrong with your circuit or your module. If yes, then check the code you had used when you got the strange results.

Good luck!

wollewald commented 2 years ago

Hi @djdlgl, have you tried my sketch? Do you still have the problem?

wollewald commented 1 year ago

Hi @djdlgl , any news? If I don't hear anything from you I will close the the issue.

wollewald commented 1 year ago

Since there was no further feedback I close the issue.