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
-
💬 RFM69 Livolo 1 channel 1 way EU switch(VL-C700X-1_Ver_C2)
OpenHardware.io • 8 May 2017, 16:04 • openhardware.io 12 May 2017, 22:01 -
Mysensors Uno Shield Version 2.0
OpenHardware.io • 9 Mar 2016, 03:44 • openhardware.io 10 Mar 2016, 07:33 -
💬 MDMSNode "Lighting" Rev 1.1
OpenHardware.io • 27 Jul 2017, 06:45 • openhardware.io 30 Nov 2018, 11:56 -
ATMega328p board w/ NRF24l01+ and Bluetooth module sockets
OpenHardware.io • 17 May 2016, 10:45 • openhardware.io 17 May 2016, 10:45 -
SCT-013-000 Calibration Value
General Discussion • 23 Sept 2021, 17:07 • Junior Ximenes 23 Sept 2021, 17:07 -
💬 NModule Temperature, Humidity, Light, Door sensor shield
OpenHardware.io • 28 May 2017, 16:09 • openhardware.io 27 May 2018, 12:32 -
💬 OH 433Mhz Mysensors Bridge
OpenHardware.io • 9 Mar 2017, 20:59 • openhardware.io 5 Jun 2017, 22:15