Which separate ADC to use?

Hello,

I want to connect an analog sensor to a digital GPIO but i would need a separate ADC and i am looking for recommendations?

My setup: ESP8266 which has only one analog input. I could obviously connect the analog sensor output to the analog pin but the issue is that if the analog pin is continuously sensing, it crashes the ESP module since the same analog pin is also used to determine the Wi-Fi signal strength. Based on my research, this limitation of the ESP8266 could be solved by reading a limited number of samples from the analog input, pausing for a few milliseconds and repeating, but i want to explore the easier alternative with a separate ADC.

I researched and i found these two ADC breakout boards: ADS1115 and ADS1015 with more info at Overview | Adafruit 4-Channel ADC Breakouts | Adafruit Learning System

Which one best meets your requirements?

groundFungus:
Which one best meets your requirements?

From the Adafruit webpage:

These two boards are very similar, differing only in resolution and speed. The ADS1115 has higher resolution and the ADS1015 has a higher sample rate.

From the project requirements: 200 analog samples in one shot and 3 ms pause, repeat. So, in 1s, assuming the 200 samples are practically instantaneous, this is about 66,666 samples. So, i think the ADS1015 is the better option although it is limited to a maximum of 3300 Samples/Second. Isn't there a better/faster ADC?

I am sure that there are faster ADCs, but without concrete requirements how to recommend one?

Where is the data to be stored? How fast can you store the data? How often do you want to transmit the data off of the Arduino? How long does it take to transmit the data? The point being that there is temporal overhead that is separate from the actual acquisition of the data that directly affects sample rate.

The simplest way to find a suitable ADC chip is to search the website of one of the large component suppliers such as RS Components or Digikey

I have some 8-bit ADCs that I bought over 20 years ago that can do 40 million SPS.

...R

It seems, from your previous posts, that you want to read a pot and/or an ACS712.
The ADS range uses an absolute/voltage A/D (internal reference), and is fundamentally wrong for both of the above (ratiometric) sensors. If you use ratiometric sensors with an ACS712 or pot, then you should also measure supply voltage, and include that in your calculations. Maybe easier to just use a ratiometric A/D.

groundFungus:
Which one best meets your requirements?

Yep.
Leo..

Hi.
How fast do you need to do an A to D conversion and why?
What is the applicaton?

Thanks.. Tom... :slight_smile:

I've used an MCP3002 with an ESP8266 in the project below. The built in ADC was not fast enough (in any of the published modes) for the demodulater part.

You may find, however, that simply issuing the yield() statement once every X iterations of the loop you use to read the ADC may help the "crash" problem.

https://forum.arduino.cc/index.php?topic=528459.0

groundFungus:
I am sure that there are faster ADCs, but without concrete requirements how to recommend one?

Where is the data to be stored? How fast can you store the data? How often do you want to transmit the data off of the Arduino? How long does it take to transmit the data? The point being that there is temporal overhead that is separate from the actual acquisition of the data that directly affects sample rate.

I'm not sure what you mean, but the goal is to use a separate ADC to read the analog output signal from the sensor (ACS712 current sensor) and then connect the output of the ADC to a digital GPIO pin of the NodeMCU 1.0 ESP8266.

Here is my sketch tested successfully on the Arduino UNO for measuring the AC current using the ACS712 sensor. It takes continuous analog samples for 3s and then calculates the results, and repeats:

/*
  Measuring AC Current Using ACS712
*/
const int ACS_pin = A0;
const int mVperAmp = 100; // Output sensitivity in mV per Amp
// Use scale factor: 185 for 5A module, 100 for 20A module and 66 for 30A module

float VPP = 0.0; // peak-to-peak voltage
float VRMS = 0.0;  // RMS voltage
float IRMS = 0.0; // RMS current

float VRMSoffset = 0.0; //0.025; // set quiescent Vrms output voltage
//voltage at an output terminal with reference to a common terminal, normally ground,
//when no signal is applied to the input.

void setup() {
  Serial.begin(115200);
}

void loop() {
  VPP = getVPP(); // find peak-to-peak voltage
  VRMS = ((VPP / 2.0) * 0.707) - VRMSoffset; // divide by 2 to get peak voltage. 1 ÷ √(2) is 0.707
  IRMS = (VRMS * 1000.0) / mVperAmp; // first, multiply by 1000 to convert to mV

  Serial.print("Vpp/V: ");
  Serial.print(VPP, 3); // print to 3 decimal places
  Serial.print("\tVrms/V: ");
  Serial.print(VRMS, 3);  // print to 3 decimal places
  Serial.print("\tIrms/A: ");
  Serial.println(IRMS, 3);  // print to 3 decimal places
}

// function to measure peak-to-peak voltage
float getVPP()  // continously sampling and logging max and min values
{
  float result;
  int readValue; // value from the sensor
  int maxValue = 0; // to store max value, initialised at lowest value.
  int minValue = 1024; // to store min value, initialised at highest value.


  uint32_t start_time = millis();
  while ((millis() - start_time) < 3000) // sample for 3000 ms or 3 secs
  {
    readValue = analogRead(ACS_pin);
    // check if a new maxValue
    if (readValue > maxValue)
    {
      // record the maximum sensor value
      maxValue = readValue;
    }
    if (readValue < minValue)
    {
      // record the minimum sensor value
      minValue = readValue;
    }
  }

  // subtract min from max and convert range to volts
  result = ((maxValue - minValue) * 5.0) / 1024.0;
  return result;
}

Robin2:
The simplest way to find a suitable ADC chip is to search the website of one of the large component suppliers such as RS Components or Digikey

I have some 8-bit ADCs that I bought over 20 years ago that can do 40 million SPS.

...R

I am looking for suggestions in terms of which ADC would work well in this application. I found only two breakout boards from Adafruit but i am hoping that there are better ones.

Wawa:
It seems, from your previous posts, that you want to read a pot and/or an ACS712.
The ADS range uses an absolute/voltage A/D (internal reference), and is fundamentally wrong for both of the above (ratiometric) sensors. If you use ratiometric sensors with an ACS712 or pot, then you should also measure supply voltage, and include that in your calculations. Maybe easier to just use a ratiometric A/D.
Yep.
Leo..

The analog sensor that i'm using is an ACS712 current sensor that i'm using to measure AC current.
The datasheet: https://www.sparkfun.com/datasheets/BreakoutBoards/0712.pdf mentions only that it is a 5V device. I tested the ACS712 sensor by connecting its VCC pin to the 5V pin on the UNO.

TomGeorge:
Hi.
How fast do you need to do an A to D conversion and why?
What is the applicaton?

Thanks.. Tom... :slight_smile:

I mentioned the project requirements in reply #2.

DryRun:
From the project requirements: 200 analog samples in one shot and 3 ms pause, repeat. So, in 1s, assuming the 200 samples are practically instantaneous, this is about 66,666 samples. So, i think the ADS1015 is the better option although it is limited to a maximum of 3300 Samples/Second. Isn't there a better/faster ADC?

6v6gt:
I've used an MCP3002 with an ESP8266 in the project below. The built in ADC was not fast enough (in any of the published modes) for the demodulater part.

You may find, however, that simply issuing the yield() statement once every X iterations of the loop you use to read the ADC may help the "crash" problem.

Esp8266 Arduino Telephone Caller ID system with anti-spam feature - Exhibition / Gallery - Arduino Forum

That's very interesting. I will have a look. :slight_smile: