ADC Voltage measurement is not right!!!

mehdi.na94rm
Posts: 10
Joined: Mon Jun 17, 2019 4:04 pm

ADC Voltage measurement is not right!!!

Postby mehdi.na94rm » Mon Jun 17, 2019 5:52 pm

Hi,

I am using a simple resistor ladder to measure the voltage accross one resistor with the ADC. But, the measured voltage has 100mV offset from the real measured voltage accross the resistor with the multimeter. I thoght that it might take some current to the ADC and added a large resistor in series to the input of the ADC but the measured voltage changed a lot, so it highly depends on that (technically it should not have any dependacy to the series big resistor). Could you please help me on that how to measure it accurately.

Regards,
Mehdi

costaud
Posts: 55
Joined: Wed Dec 30, 2015 5:09 pm

Re: ADC Voltage measurement is not right!!!

Postby costaud » Tue Jun 18, 2019 3:23 am

Was the voltage in the linear range ?
Would you please give some details of the real voltage and the read value ?
And what settings did you use to initialize and to read the voltage ?

Here are some application examples of ADC module.
https://docs.espressif.com/projects/esp ... n-examples

mehdi.na94rm
Posts: 10
Joined: Mon Jun 17, 2019 4:04 pm

Re: ADC Voltage measurement is not right!!!

Postby mehdi.na94rm » Tue Jun 18, 2019 3:07 pm

Thanks for your reply. I have used 0 value as the initial point and the value that I am reading is in the linear region and also tried different regions but got the same issue. Here is my code:

/*Program to control LED (ON/OFF) from ESP32 using Serial Bluetooth
* Thanks to Neil Kolbans for his efoorts in adding the support to Arduino IDE
* Turotial on: www.circuitdigest.com
*/

#include "BluetoothSerial.h" //Header File for Serial Bluetooth, will be added by default into Arduino

BluetoothSerial ESP_BT; //Object for Bluetooth

int incoming;
const int Analog_channel_pin= 33;
int ADC_VALUE = 0;
int voltage_value = 0;
int i = 0;

void setup() {
Serial.begin(115200); //Start Serial monitor in 9600
ESP_BT.begin("ESP32_LED_Control"); //Name of your Bluetooth Signal
Serial.println("Bluetooth Device is Ready to Pair");

}

void loop() {



if (ESP_BT.available()) //Check if we receive anything from Bluetooth
{
incoming = ESP_BT.read(); //Read what we recevive
Serial.print("Received:"); Serial.println(incoming);

delay(1000);
if (incoming == 49)
{
ESP_BT.println("System turned ON");

int i;
for(i=0; i<10; i++)
{


ADC_VALUE = analogRead(Analog_channel_pin);
Serial.print("ADC VALUE = ");
Serial.println(ADC_VALUE);
delay(1000);
voltage_value = (ADC_VALUE * 3.3 ) / (4095);
Serial.print("Voltage = ");
Serial.print((ADC_VALUE * 3.3 ) / (4095));
Serial.print(" volts");

Serial.print("Resistance = ");
Serial.print((((ADC_VALUE * 3.3 ) / (4095)/3.3) * 2412)/(1-((ADC_VALUE * 3.3 ) / (4095)/3.3)));
Serial.print(" ohms ");
}
}
if (incoming == 48)
{
ESP_BT.println("System turned OFF");
}
}
delay(1000);
}

Who is online

Users browsing this forum: No registered users and 54 guests