# DC/AC Current Measurements Using Hall-Effect Sensors

## Hall Effect:

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.

## 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.

## 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.

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++){
T_sample = T_sample + sample[i];

_delay_us(1);

}
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.

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;```

If you need any more help feel free to comment below and don't forget to like our facebook page. 🙂

#### Ismail

Electrical engineering is my profession, my hobby and my passion. I completed bachelors of electrical engineering in 2015. Currently I am working with a utility company which provides electricity to its consumers. Power Electronics, Embedded Systems and Energy Metering are my fields of specialization. In free time I listen music and watch movies.