Time: 2024-08-18  韦克威科技

How does ACS712 current sensor measure current- Weikewei - accuracy up to 0.5%, comes with a technical manual as a gift

Linear current sensor based on AC 712 Hall effect and Arduino Uno for measuring DC current. If used and designed properly, ACS712 can accurately measure current. Various blogs on the Internet have introduced the interface between the ACS712 current sensor and Arduino and other microcontrollers. In fact, all of their current measurement formulas (obtained for the ACS712 current sensor) are inaccurate. Therefore, the editor decided to write an article about the ACS712 current sensor and provided circuit and code examples. In this post, the editor will define the best method and precise formula for measuring DC current using the ACS712 current sensor. The editor will use logic to define each step of the code and circuit in a simple and in-depth manner. The project code is open source, and you can download and modify it as needed.

The Acs712 current sensor can measure both DC and AC currents. For this project, only direct current will be measured. This article only explains the DC measurement formula. When using the ACS712 Hall effect current sensor to measure AC current, the following formula cannot be used.

About acs712

ACS712电流传感器引脚定义图

Acs712 is a linear current sensor based on the Hall effect. It can measure both DC (direct current) and AC (alternating current). The sensor chip is made of Allegro. The pin outputs and pin descriptions of the chip are as follows.

IP+and IP-

Connect the sensor in series to the system where its current is to be measured. Cut off the circuit wires and connect one end of the wires to IP+and the other end to IP -. Recalling a high school lecture, current can only be measured in series. Therefore, do not connect the sensors in parallel. Parallel connection may damage the sensor.

Vout

Viout is the voltage output pin. ACS712 outputs analog signals corresponding to any changes on the IP+and IP - pins; In other words, if there is any change in their current, ACS712 outputs an analog voltage on the VIOUT pin.


Static output voltage (VIOUT (Q)). The device output when the primary current is zero. For a unipolar power supply, the nominal voltage is maintained at VCC ⁄ 2. Therefore, VCC=5V is converted to VIOUT (Q)=2.5V. The change in VIOUT (Q) can be attributed to the resolution of Acs712. If the operating voltage of Acs712 is 5V (VCC=5V) and there is no input current, Viout will be 2.5V. 2.5V is the basic voltage when 5V is input, and any change in input current will result in a change in output voltage. When the current starts flowing through pin acs712, Viout decreases.

ACS712 DC current measurement formula

Current=(AcsOffset - (analog reading measured by Arduino)/sensitivity


When no current flows through the circuit, Acs Offset is the normal voltage output on the Viout pin.

The analog reading measured by ALLEGRO is an analog signal value, which is read from the analog channel connected to the output of acs712 and converted to the actual voltage.

Sensitivity represents the variation of Acs712 in a current of 1 ampere. For all versions of ACS712, they are shown in the above figure.


ACS712电流传感器


There are reassembled ACS712 current sensor boards on the market. They are easy to install in circuits and have very simple connections. They have three pins. The two are power pins vcc and gnd. The third one is the output pin. A 2-pole connector is also provided to insert the wires of devices that require current measurement. A typical ALLEGRO acs712 current circuit board is shown in the following figure.

ACS712电流传感器板

Phone Consultation
Email Consultation
Map
QQ