ACS758 050B Current sensor with ESP32

I am facing problem with esp32 with acs758. When i connect load to acs758 seeming that no value change. Is it necessary to connect adc1015 with esp32 to ACS758 to corect readings?
`const int analogInPin = 33; // Replace with your chosen ESP32 analog input pin
const float adcReferenceVoltage = 3.3; // ADC reference voltage of the ESP32
const float acs758Sensitivity = 0.04; // Sensitivity of ACS758 (40mV/A)

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

void loop() {
int adcValue = analogRead(analogInPin);
float voltage = adcValue * adcReferenceVoltage / 4095; // Convert ADC reading to voltage
float current = voltage / acs758Sensitivity; // Calculate current using ACS758 sensitivity

Serial.print("Raw ADC Value: ");
Serial.print(adcValue);
Serial.print(" Voltage: ");
Serial.print(voltage, 4);
Serial.print("V Current: ");
Serial.print(current, 4);
Serial.println("A");

delay(1000); // Delay for stability
}
this code i am using 40mv is sensitivity.`

Everyone keeps wrongly assuming that the ESP32 analog reference is 3V3, when, in fact, it is 1V1.
You have an attenuation parameter, which by default should be set to 11, giving you an approximate range of 150mV to 2.450mV

Output is not changing i changed 3.3 to 1.1. Problem is that voltage not changes nor current.

I am measuring AC current.

Could you please share a schematic of your connections?

Also make sure you fix the code in your post to make it readable to other users who might want to help :slight_smile:

Remove the single tick at begin of the code and after the word "sensitivity." , select the code only and press the button above to format it

I'm with same problem, could you please give me a help? what do you did?