Sensing and controlling current flow is a fundamental requirement in a wide variety of applications including, over-current protection circuits, battery chargers, switching mode power supplies, digital watt meters, programmable current sources, etc. One of the simplest techniques of sensing current is to place a small value resistance (also known as Shunt resistor) in between the load and the ground and measure the voltage drop across it, which in fact, is proportional to the current flowing through it. Whereas this technique is easy and straightforward to implement, it may not be very precise because the value of the shunt resistor slightly varies with its temperature, which in fact is not constant because of the Joule heating. Besides, this simple technique does not provide an isolation between the load and current sensing unit, which is desirable in applications involving high voltage loads. Today, we will talk about Allegro ACS712 device which provides an economical and precise way of sensing AC and DC currents based on Hall-effect. This discussion is divided into two parts. The first part will provide a brief overview of the ACS712 sensor and its characteristics. In the second part, a test experiment will be carried out to interface the sensor with a PIC microcontroller to measure a dc current.
The current sensing technique based on a shunt resistor is described in How to measure dc current with a microcontroller? and implemented in the Multi-functional power supply project. The major disadvantages of this technique are:
- load is lifted from the direct ground connection
- non-linearity in the response due to Joule heating that drifts the resistance value
- lack of electrical isolation between the load and the sensing part
The Allergo ACS712 current sensor is based on the principle of Hall-effect, which was discovered by Dr. Edwin Hall in 1879. According to this principle, when a current carrying conductor is placed into a magnetic filed, a voltage is generated across its edges perpendicular to the directions of both the current and the magnetic field. It is illustrated in the figure shown below. A thin sheet of semiconductor material (called Hall element) is carrying a current (I) and is placed into a magnetic field (B) which is perpendicular to the direction of current flow. Due to the presence of Lorentz force, the distribution of current is no more uniform across the Hall element and therefore a potential difference is created across its edges perpendicular to the directions of both the current and the field. This voltage is known Hall voltage and its typical value is in the order of few microvolts. The Hall voltage is directly proportional to the magnitudes of I and B. So if one of them (I and B) is known, then the observed Hall voltage can be used to estimate the other.
The ACS712 device is provided in a small, surface mount SOIC8 package. It consists of a precise, low-offset, linear Hall sensor circuit with a copper conduction path located near the surface of the die. When current is applied through the copper conductor, a magnetic field is generated which is sensed by the built-in Hall element. The strength of the magnetic field is proportional to the magnitude of the current through the conduction path, providing a linear relationship between the output Hall voltage and input conduction current. The on-chip signal conditioner and filter circuit stabilizes and enhances the induced Hall voltage to an appropriate level so that it could be measured through an ADC channel of a microcontroller. The pin diagram of ACS712 device and its typical application circuit is shown below. Pins 1, 2 and 3, 4 forms the copper conduction path which is used for current sensing. The internal resistance of this path is around 1.2 m?, thus providing low power loss. As the terminals of this conduction path are electrically isolated from the sensor leads (pins 5 through 8), the ACS712 device eliminates the risk of damaging the current monitoring circuit due to the high voltage on the conduction side. The electrical isolation between the conduction current and the sensor circuit also minimizes the safety concerns while dealing with high voltage systems.