Author Topic: Measuring current using hall-effect sensor  (Read 710 times)

eskoilola

  • Guest
Measuring current using hall-effect sensor
« on: May 23, 2018, 12:37:17 AM »
Pekka asked me to start a thread about hall effect sensors and their use on measuring current.

Well, these sensors can be used to measure current. Actually they do not measure electrical current but the magnetic field that the current creates.

If You pass current through a wire there is a magnetic field created around the wire in 90 degree angle to the direction of the current. If it is a wire then the magnetic field takes a cylinder form around the wire.

In order to measure this magnetic field the sensor has to be in 90 degree angle with the magnetic field to be measure so that the magnetic field goes through the sensor.

Luckily the hall effect sensors are quite small so placing those nearby the wire might give acceptable result.

However, the magnetic field is rather weak as compared to the sensitivity of the sensor. To overcome this issue a concentrator can be used. Basically it is tube made of some ferromagnetic materiall having a slot on one side. The sensor is then placed in that slot.

I have made a solar panel current sensing equipment for 12 solar panels where the current of each panel was measured separately. Ended up using hall effect sensors with concentrators made from mild steel tube. These sensors were then equipped with microcontrollers and finally all of the communicated with a master device using I2C.

Sensor data sheet


Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2125
  • Country: fi
Re: Measuring current using hall-effect sensor
« Reply #1 on: May 23, 2018, 04:10:33 AM »
You mentioned some problems....

I tried integraded current HAL-sensor with breakout board:
https://www.sparkfun.com/products/8882

It has Allegro ACS712 IC and although it looks like best thing ever for a really cheap current probe for a scope (for low DC + swiching) I had that much trouble in live circuit current measurement that I bought a cheap clamp type current probe (which is much bigger, and needs a wire loop to measure current).

Needs shielding and pretty good understanding (or least reading the data sheet). Also the output is sort of nonstandard, needs additional amplifier/buffer and the works.

Pekka

Offline John Rudd

  • Hero Member
  • *****
  • Posts: 2246
  • Country: gb
Re: Measuring current using hall-effect sensor
« Reply #2 on: May 23, 2018, 05:06:01 AM »
EPE magazine did a project to measure current using a HE device so time ago....Maybe worth a look for ideas?.... I might have the relevant magazine, but its in storage at the moment... :Doh:
eccentric millionaire financed by 'er indoors
Location:  Backworth Newcastle

Skype: chippiejnr

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2125
  • Country: fi
Re: Measuring current using hall-effect sensor
« Reply #3 on: May 23, 2018, 06:01:35 AM »
I used Google to find my findings....and this text explains it better than I did:
https://warmcat.com/2015/12/21/hall-effect-current-sensing.html

Stray magnetic field may be avoided by canning the "shut" IC, haven't tried that. Or by using toroid consentrator and different chip. However, noise and temperature drift auto correction artefacts are harder.

There are some advertizement text that helps somewhat.

https://www.allegromicro.com/en/Design-Center/Technical-Documents/Hall-Effect-Sensor-IC-Publications/Non-Intrusive-Hall-Effect-Current-Sensing-Techniques-for-Power-Electronics.aspx

https://www.infineon.com/dgdl/Current_Sensing_Rev.1.1.pdf?fileId=db3a304332d040720132d939503e5f17

Whole different matter is using HAL-sensor for compensating circuit or to measure DC-component only. This is something I haven't tried yet:


https://meettechniek.info/instruments/scope-probes.html
https://www.digikey.com/en/articles/techzone/2017/aug/understanding-selecting-effectively-using-current-probes



eskoilola

  • Guest
Re: Measuring current using hall-effect sensor
« Reply #4 on: May 23, 2018, 01:38:01 PM »
Yes, there were some problems.

At first the sensitivity of that sensor was not good enough in order to be used without concentrator.

I tried several variants of these and had a few problems:

First it was really hard to create a gap on a glass hard ferrite. Finally bought a diamond blade for my dremel and did the cutting under water. Ferrite reacts with diamond (the iron in it) and cripples the blade in no time. Underwater cutting had several advantages. Lubrication, cooling and dust control. When I finally got the toroid gapped and placed the sensor there the result was far from amazing. Seemed like the toroid had some sort of a hysteresis which made it so that it remembered previous current and suddenly fell back to new value when the difference was big enough. Might be a material issue. The toroid also picked up all possible disturbances around.

A much better candidate was the iron powder toroid. It was easy to cut and it did not have as much of hysteresis. Nevertheless it was even more sensitive for disturbances. The sensor output was far from stable.

The best solution was also the cheapes and easiest to do. Ordinary iron plumbing pipe (very mild steel). It was easy to cut into suitably long toroids and the gap was also really easy to make. I actually used my angle grinder for this. Further more the material dampends high frequency noise and the output was really stable. It is also possible to ground the toroid as the material is conductive. Also mild steel had some magnetic memory but it was way better that the other two.

The output of the Allegro device is rail-to-rail 5V. The output is in the middle when there is no magnetic field. The output goes towards ground or 5 volts depending on magnetic field strength and direction.

The sensor needs a good quality ceramic capacitor on supply wires to avoid internal oscillations. The capacitor should be as close as possible of the sensor.

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2125
  • Country: fi
Re: Measuring current using hall-effect sensor
« Reply #5 on: May 23, 2018, 04:16:50 PM »
Thank you. Very good and practical info. I have noticed the need for closely coupled bypass capacitor even with HAL-switched, some need a little capacitor from output to ground too, even though it seems counter intuitive on OC-output.

I am surprised that you got away without degausing the toroid.

Did you got a whole lot of noise from the output even without the toroid? Did it had chopper or auto-zero artefacts?

Pekka

Offline efrench

  • Full Member
  • ***
  • Posts: 140
Re: Measuring current using hall-effect sensor
« Reply #6 on: May 23, 2018, 09:47:18 PM »
My Consew CSM1000 servo uses a hall effect sensor to control the speed.  It might be worth looking at.

Offline angus

  • Jr. Member
  • **
  • Posts: 57
  • Country: gb
Re: Measuring current using hall-effect sensor
« Reply #7 on: May 24, 2018, 01:43:43 AM »
I have a fluke ma meter that must use the same principle.?. Does up to 25 ma dc

eskoilola

  • Guest
Re: Measuring current using hall-effect sensor
« Reply #8 on: May 24, 2018, 10:49:45 AM »
My Consew CSM1000 servo uses a hall effect sensor to control the speed.  It might be worth looking at.
In that application it is not nessecary to measure the current. t is sufficient to know whether the sensor is near some object or not. The speed is the of course a series of pulses that can be converted into speed by counting and dividing by time.

eskoilola

  • Guest
Re: Measuring current using hall-effect sensor
« Reply #9 on: May 24, 2018, 10:59:30 AM »
I am surprised that you got away without degausing the toroid.

Did you got a whole lot of noise from the output even without the toroid? Did it had chopper or auto-zero artefacts?

Pekka
Actually I did not get away. The mild steel was the only one that did not need to be degaussed but even that gave erratic results. The major factor was the earth magnetic field. When one has a gap in a toroid it immediately starts picking up unwanted magnetic fields. For this reason I had a calibration phase when all the 12 sensors figured out their zeroes. The best results were obtained by first cutting off the solar panels, then eating a nice dinner with the friend and after two hours or more just run the calibration. Degaussing was not an option as it totally removes any magnetism from the iron. Somehow the earth magnetism seemed to cumulate into the toroid... I was pretty overwhelmed with the behaviour until I realized that the orientation of the sensors had a lot to do on how they behaved. It did not become perfect. The measurement was reliable to 200mA. In this application it was good enough.