ADS-sensor for voltage

How can I use ADS115 to measure voltage?

Tutorial:

The ADS1115 is a 16-bit analog-to-digital converter (ADC) that can be used to measure voltage. Here are the general steps to use it:

  1. Connect the ADS1115 to the Arduino: The ADS1115 has four pins: VCC (power), GND (ground), SCL (serial clock), and SDA (serial data). Connect VCC to 5V, GND to GND, SCL to A5, and SDA to A4 on the Arduino.
  2. Configure the ADS1115: The ADS1115 has several configuration registers that determine its operating mode, gain, and other settings. You can configure these registers by sending commands over I2C to the ADS1115.
  3. Read the voltage: To read the voltage, you can send a command over I2C to the ADS1115 to start a conversion. The ADS1115 will convert the voltage and store the result in its internal register. You can then read the result over I2C and convert it to a voltage using the gain setting and other configuration parameters.

Here is an example code snippet that shows how to read the voltage using the ADS1115:

cCopy code

#include <Wire.h>
#include <Adafruit_ADS1015.h>

Adafruit_ADS1115 ads;  // create an ADS1115 object

void setup() {
  Serial.begin(9600);
  Wire.begin();
  ads.begin();  // initialize the ADS1115
}

void loop() {
  int16_t raw = ads.readADC_SingleEnded(0);  // read the voltage on channel 0
  float voltage = raw * 0.1875 / 1000;  // convert the raw value to voltage (assuming a gain of 1 and a reference voltage of 3.3V)
  Serial.print("Voltage: ");
  Serial.print(voltage, 4);  // print the voltage with 4 decimal places
  Serial.println("V");
  delay(1000);  // wait for 1 second before taking another measurement
}

Note that this example assumes a gain of 1 and a reference voltage of 3.3V. You may need to adjust these values depending on your specific setup.

Doesn't make sense. Please explain.

The ADS has an internal reference with a ProgrammableGainAmplifier.
Default gain is AFAIK 2/3, which is 6.144volt, and PGA gain of 1 is 4.096volt.
The ADS1115 is a 15-bit A/D, and only 16-bit in differential mode.
Leo..

Thank you for providing additional information about the ADS1115.

Based on your description, it seems that the ADS1115 is a 15-bit analog-to-digital converter with an internal reference and a programmable gain amplifier (PGA). The default gain is 2/3, which corresponds to a voltage range of 6.144 volts. However, the PGA gain can be set to 1, which corresponds to a voltage range of 4.096 volts. Additionally, the ADS1115 is capable of differential mode, which provides 16-bit resolution.

It's worth noting that the resolution of an ADC determines the number of discrete values that can be represented by the ADC. In the case of the ADS1115, its 15-bit resolution means that it can represent 2^15, or 32,768, discrete values. However, in differential mode, the resolution increases to 16 bits, which means that it can represent 2^16, or 65,536, discrete values.

Sounds like a reply of ChatGPT.

What we should have done is ask OP what he/she wants to measure, and with which Arduino.
Maybe an external A/D is not needed.
Leo..

1 Like

Definitely chatGPT. I've put @hiibrarahmad on my ignore list.

What we should have done is ask OP what he/she wants to measure

In another thread, the OP wants to "measure the voltage of fork, coin, wire ... "

1 Like

@hiibrarahmad if you are going to use AI generated content when providing help here, it must be done responsibly.

Just as with any other source of information you find on the Internet, you must carefully evaluate AI generated content for accuracy, relevance, and appropriateness within the context. Copy/pasting without giving any thought to the information is irresponsible. If you are not knowledgeable enough on a subject to make such an evaluation on some content, then don't share it here on the forum.

Thanks in advance for your cooperation.

1 Like

Let's say I did this circuit,


How can I know measure voltage of any material? How does the new circuit have to look like?

Measure the voltage relative to what?
What are trying to do?

Voltage of forks, coins, wires, etc

A fork doesn't have a voltage until you put it next to a dissimilar metal, with an electrolyte between.

What are you trying to do?

Wouldn't it have a voltage, if I put two jumper wires at the ends, then it will create a voltage drop due to the resistance of the material?

You can certainly measure the voltage drop between two ADS1115 inputs. That is one of the intended uses, in differential mode.

The voltage on each input must be between 0 and ADS1115 supply voltage, relative to the ADS1115 GND.

Like the A#, with # a random number pins?

Use the ADS1115 library functions to read voltages from the ADS1115.

One of many tutorials on line.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.