DC/AC Current Measurements Using Hall-Effect Sensors

DC/AC Current Measurement using Arduino and Hall Effect Sensor (LF-DI12-15B2):

When current passes through the conductor present in the magnetic field, a voltage is produced at the ends of that conductor. This effect is called as Hall-Effect. In this article we will study about Current measurement using Hall effect Sensors

 Hall-Effect sensors:

When you closely look upon the definition of the Hall-Effect you will find that there are two ways to use this sensor.

  1. Pass current and get magnetic field
  2. Pass magnetic field and get current

In both conditions, voltage will produce which will proportional to the current / magnetic field applied. Both types of hall-effect sensors are useful for different kind of applications like speed measurements, magnetic code reading, position sensing etc . But here we will discuss only first type of sensors which operate in the principle that is pass the current and get magnetic field. These types of sensor can accurately measure the DC and AC currents both.

 Medium Ranges Current Sensors:

In medium current portion we will discuss the sensors which can measure the current range from 1 ampere to 200 amperes. ACS712 sensors are really good example for current measurements from 1amp to 30 amps. They come in 5ampere, 20ampere and 30 ampere ranges. To use this sensor just connect it in the series of load, energize it by 5volt and it is ready to use. 10 mA current is required by this IC to produce voltage proportional to the applied load current. The pins of load current are isolated from the measuring pins so you don’t need to worry about opto-couplers to isolate your high current part with sensitive equipments. (you can buy Hall effect sensor from link given below)

Coding part:

In coding part I will give you just directions to use the sensor with micro-controllers like Arduino, Atmega8/16/32, and PIC etc. if you need any more help feel free to contact. The table present below is showing the sensitivity of these three  types of Hall sensors.

Sensitivity Callibration of Current Sensor
Figure 2: Sensitivity Callibration Table

I took this table from the datasheet to calibrate the sensor as the sensitivity setting is important for the sensor.


for (g=0; g <= 9; g++){
sample[i] = adc_read(5);
T_sample = T_sample + sample[i];


T_sample = T_sample /10;

     current = (double)( T_sample / 1023.0) * 5000; // 5000 for getting mV
//As sensitivity in mV

current = (current - 2500) / 185;// for 5A = 185,for 20A = 100, for 30A = 66
// 2500 is to cut the 2.5volts from the measured value
//the remaining will be the value of current

//To save you from getting negative value
if (conv < 0)
     conv = 0

Note: If you want to measure the voltage up to 200 amp then use the sensor ACS758 with the same directions.

High Current Sensors:

We will take high current as above 200 amps like 400 amps or 500 amps. These kinds of Hall sensors are difficult to find. Recently I was working on data logging of a solar bus. There was a single DC motor installed on the bus to drive it. I had to measure and log the current of that motor. At full speed the motor needed 300amps. I searched on the aliexpress.com and there I found a very smart and accurate but expensive sensor “ LF-DI12-15B2-1.0/0~500A”. The price of the sensor is 60.47$. The sensor works on 12 volt and if you can give it. negative voltage it will measure the negative voltage as well. But this is an additional functionality.

Current Sensor for 500 amperes
Figure 3: LF-DI12-15B2-1.0/0~500A

The main advantage of this sensor is you don’t have to cut the load wire to put this sensor in series. Just pass the wire through the hole and your sensor is ready to work. Another advantage of this sensor is the output voltage is from 0 to 5 volts. So you don’t have to worry about any additional amplifier or protections circuits.

Coding part:

The coding part of this sensor is really easy. You just have to map the output voltage of the sensor and your sensor is ready to work. I’ll give you just an idea of the mapping of the voltage. This technique can be used with Atmel AVR , Arduino or PIC micro-controller. If you still need any help feel free to contact.

x = adc_read(5);// To measure the digital value at micro-controller pin x = 300/1024; //for current range up to 300amps use 300 for 400 use 400 and for 500 amps use 500 here //1024 is the 10bit resolution of ADC Print the output;

Also try to build an interesting rather easy project on Hall effect Sensors:

Tachometer Using Arduino and Hall Effect SensorIf you need any more help feel free to comment below and don’t forget to like our facebook page. 🙂

6 thoughts on “DC/AC Current Measurements Using Hall-Effect Sensors”

  1. Hi. I’m interested in the high current sensor and the code.for the above Figure 3: LF-DI12-15B2-1.0/0~500A unit. I shall be thank ful if you could reply me on my email, apperar below. Thanks.

  2. Hi. Nice article. And you can find a lot of Hall Sensors for a HUGE range of currents from LEM and others. Look on Digikey. LEM makes a good one that will easily measure 300 amps DC for 50 amps on the high end.

    The other issue in the lowest noise, highest sensitivity designs is what max current they can handle. To get low noise you need to move away from the torroidal design. And pass all your current via the PCB.

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.