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.`