Why is the output of ACS712 current measurement module unchanged?
-
Why is the output of [ACS712](
link url) current measurement module unchanged? I connected 5.0V to VCC, and the output is always 2.56V. After connecting the current of 2-5A in series, the output has not changed. I use an AC power supply, and I directly use an AC voltage regulator to connect the thermal, serial current. Does anyone know the reason?
-
I think you need to post a clear drawing or photos of the setup and the code you are using.
I donlt know what you mean by "connecting the current in series" nor what "AC regulator" you are using or what "thermal serial currenr" is.
-
It seems the ACS712 current measurement module may not show expected changes due to setup issues, like incorrect wiring or misunderstanding of signal interpretation. Checking if you're measuring the right type of current (AC vs. DC) and ensuring your connections are correct can often resolve this.
-
@ZenBlizzard in case you are measuring the output with a multimeter, you will get an averaged level, since AC current waveform should be sinusoidal and overlapped with the Vcc/2->2.56V in your case.
To measure the current you need a decently high sampling and some math.#define SENSITIVITY 66 // mV/A const float readings = 5; const float alpha = 2.0 / (2 * readings + 1); for (ifor = 0; ifor < 250; ifor++) { // Voltage voltageSampleRead = analogRead(V) * vccRead / 1023 - vccRead / 2; /* read the sample value including offset value*/ voltageSampleSum = voltageSampleSum + sq(voltageSampleRead); /* accumulate total analog values for each sample readings*/ voltageSampleOffsetSum = voltageSampleOffsetSum + voltageSampleRead; // Current currentSampleRead = analogRead(I) * vccRead / 1023 - vccRead / 2; /* read the sample value including offset value*/ currentSampleSum = currentSampleSum + currentSampleRead * currentSampleRead; /* accumulate total analog values for each sample readings*/ currentSampleOffsetSum = currentSampleOffsetSum + currentSampleRead; wait(1); } voltageMean = voltageSampleSum / ifor; /* calculate average value of all sample readings taken*/ voltageOffset = voltageSampleOffsetSum / ifor; reading = (sqrt(voltageMean) - voltageOffset) * 230.0 / 1.0; // read voltage / reported voltage. voltage = round_to_dp(alpha * reading + (1 - alpha) * voltage,1); Serial.println(voltage); if (voltage < 25) voltage = 0; currentMean = currentSampleSum / ifor; /* calculate average value of all sample readings taken*/ currentOffset = currentSampleOffsetSum / ifor; reading = (sqrt(currentMean) - currentOffset) / SENSITIVITY * 1000 - currentZeroOffset; // subtract no load current. if (reading < 0) reading = 0; current = round_to_dp( alpha * reading + (1 - alpha) * current,2);
Suggested Topics
-
Home Automation and monitoring
My Project • 26 Jun 2016, 23:04 • sudo_bash80 26 Jun 2016, 23:04 -
💬 MySensors compact (junction box) relay
OpenHardware.io • 3 Feb 2020, 19:01 • openhardware.io 3 Feb 2020, 19:01 -
💬 MDMSNode "Lighting" Rev 1.1
OpenHardware.io • 27 Jul 2017, 06:45 • openhardware.io 30 Nov 2018, 11:56 -
💬 Homini Pulse Meter Monitor
OpenHardware.io • 14 Mar 2017, 22:25 • openhardware.io 19 May 2017, 17:20 -
Which presentation to use for a Turbidity Sensor?
My Project • 19 Mar 2020, 02:37 • Shiny 19 Mar 2020, 02:37 -
💬 NModule PIR sensor shield
OpenHardware.io • 29 May 2017, 18:57 • openhardware.io 15 Jun 2017, 10:27