ACS712 Hall Effect Sensor Reference
ACS712 Hall Effect Sensor Reference
ACS712 Hall Effect Sensor Reference
There are various methods available for sensing current flow in a system. Usage of shunt
resistors, current transformers and usage of Hall-effects sensors are some such
available methods. This articles talks about usage of Allegro ACS712 sensor [1] with an
Arduino development board for measuring current in a system. Allegro ACS712 sensor
operates according to the Hall-effect principal and it can be used for both AC and DC
current measurement. There is no need of auxiliary circuits for this sensor it is an
immense advantage over the other available methods.
The Hall-effect is the production of a voltage difference (the Hall voltage) across an
electrical conductor, transverse to an electric current in the conductor and a magnetic
field perpendicular to the current. It was discovered by Edwin Hall in 1879.[2]
This is a bi-directional measuring device and therefore this can be used for both AC and
DC current sensing. The ACS712 sensor is designed for three current ranges 5A, 20A
and 30A. The sensor consists of an integrated circuit which works according to the Hall-
effect principal. This IC generates a voltage proportional to the current flowing in the
circuit. Breakout board of current sensors based on this device also available in the
market and they make your life easier.
Following graph show the variation of the output voltage with the current flow for 5A
sensor [1].
Connection configuration
T1 and T2 of the sensor should be connected in series with the current path which is
need to sense. Out pin should be need to connect one of the analog input pin available in
the Arduino. VCC and GND pins should be connected to 5V and GND pin of the Arduino
respectively.
Code
The sensor outputs an analog voltage correspondence to the current flow. Therefore to
get the current reading from the Arduino. So we need to perform analog to digital
conversion inside the Arduino and multiply with calibrating constant to get the actual
value.
We need to use little bit of mathematics for the actual current value calculation. Adruino
has 10 bit analog to digital converter register. So ADC value is in range of 0-1023. Then
the actual sensor voltage output can be obtained from
OutputSensorVoltage = analogRead(sensorPin)*5.0/1023.0
Following is an example code which can be used for measuring current using the sensor.
It will display the current measurement on serial monitor.