Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADS111x problems #94

Closed
2 tasks done
schroedermarius opened this issue Jul 6, 2020 · 5 comments
Closed
2 tasks done

ADS111x problems #94

schroedermarius opened this issue Jul 6, 2020 · 5 comments
Labels
question Further information is requested

Comments

@schroedermarius
Copy link

Device type

  • ESP32
  • [] ESP8226

Framework version

  • ESP-IDF latest master
  • [] ESP-IDF 3.2.x
  • [] ESP-IDF 3.3.x
  • [] ESP8266 RTOS SDK latest master
  • [] ESP8266 RTOS SDK 3.2

Describe the bug
Im trying to connect the ADS1115 chip to my ESP32 board on ESP-IDF using your library.
First of all I tried your example code for the library which checks the ADS for readiness (ads111x_is_busy) which was always true. So the chip was busy.
I've figured out to call "ads111x_start_conversion" before "ads111x_is_busy" to achieve the chip to be ready. Should it be done like that?

Now I've got the problem, that the raw ADC value printed out by "ads111x_get_value" is always 1.
Im trying to measure pressure.

The code im setting up my device for the first pressure sensor is the following:
ESP_ERROR_CHECK(ads111x_init_desc(device, ADS111X_ADDR_GND, I2C_NUM_0, GPIO_NUM_21, GPIO_NUM_22)); ESP_ERROR_CHECK(ads111x_set_mode(device, ADS111X_MODE_SINGLE_SHOT)); ESP_ERROR_CHECK(ads111x_set_gain(device, ADS111X_GAIN_6V144)); ESP_ERROR_CHECK(ads111x_set_input_mux(pressure_up1, ADS111X_MUX_0_1));

@schroedermarius
Copy link
Author

I've changed it to ADS111X_MUX_0_GND and got now good measuring values around 2890.
I've only attached 1 sensor at ADS111X_MUX_0_GND, why am I getting the same values at ADS111X_MUX_1_GND, ADS111X_MUX_2_GND and ADS111X_MUX_3_GND? I need to switch the channels for other sensors.

@UncleRus UncleRus changed the title ADS111x always busy ADS111x problems Jul 9, 2020
@UncleRus UncleRus added the question Further information is requested label Jul 9, 2020
@helopez
Copy link

helopez commented Sep 1, 2020

I had the same problem (reading the same voltage) when trying to measure a differential and a relative to ground voltage. Is there a work around to this problem?

@helopez
Copy link

helopez commented Sep 2, 2020

I figured out the problem, this is not a bug, at least not a problem with the library.

Depending on how you set the ads111x_set_data_rate, you must add a delay to allow the ads1115 chip to measure the value. In my case I was setting the data rate to 8 per second (ADS111X_DATA_RATE_8) , theoretically then I must wait 125ms before reading the value. I configured it to 150ms and the values are read fine.
Another way of doing this would be to connect the alert/ready pin to get notified when the conversion is ready.

@DhruvaG2000
Copy link
Contributor

Hey feel free to refer this repo where you will find pin diagram and corresponding code that actually works!

@UncleRus UncleRus closed this as completed Mar 5, 2021
@HamadAli09
Copy link

Hi, I see this issue is closed but i am stuck at this point. I am only able to read one analaog input channel at one time only. How can i read all four single ended channels simultaneously?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants