Using a Hall sensor to measure current - Page 1
Forum section: electronics / projects

author: outrage
author_rank: Newbie
timestamp: April 19, 2025, 10:59:59 am
content: Hi!I am a student, finishing my bachelor's degree. I am currently writing my graduation thesis and in it I need to measure the parameters of 220 V electrical networks.In my work, I want to use a current measuring sensor based on the Hall effect. For these purposes, the ZMCT116-A is suitable for me, I want to connect it to the ESP-12 based on 8266.I searched for information on the Internet and on Google Scholar and the like, but I did not find answers to my questions.I don't really understand how the sensor should be connected to the controller.I'll start from the beginning: According to information from the Internet, the sensor outputs a signal equal to the RMS current flowing in the 220 V circuit. The analog pin on the ESP-12 senses a voltage of up to 3.3 volts, and the sensor outputs up to 2.5 milliamps.Do I need to use some kind of signal converters, such as operational amplifiers? Does such an amplifier need a reference signal source, such as TL431?It would be very cool if someone shared their experience of using such sensors and gave an example of practical use in a real circuit, shared their experience, and provided links to literature on the topic.Thank you very much in advance!PS English is not my native language, so I may make mistakes, I'm sorry

author: moffy
author_rank: Super Contributor
timestamp: April 19, 2025, 11:26:55 am
content: The device you mention ZMCT116-A :https://www.lcsc.com/datasheet/lcsc_datasheet_1810010923_ZHE-MING-LANG-XI-ZMCT116A_C155200.pdfis not a Hall effect device but a current transformer, it doesn't measure DC only AC currents which is the main difference between a Hall effect sensor and a current transformer. The datasheet shows two applications:1. Using an opamp as a virtual ground input to convert the current to a voltage.2. A low value resistor placed across the output to convert the output current into a voltage.For connection to I assume the ADC of the micro the AC signal would need a DC bias voltage to keep the AC signal within the voltage range of the ADC.The current transformer produces an output current, as long as the output load is small, proportional to the input current, AC only, and in this case the output current is 1/2500 of the input or through current.

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 19, 2025, 11:28:55 am
content: Ouch, I don't know what they taught you in school, but I will give a hint. How do you convert current into voltage. Think of Ohms law.Ai, moffy spilled the beans already.

author: Zero999
author_rank: Super Contributor
timestamp: April 19, 2025, 11:30:07 am
content: The ZMCT116-A is a current transformer, not a Hall effect sensor. It has a turns ratio of 2500:1, which means it outputs a current equal to1/2500of the primary current, not a voltage.https://hadibanelectronic.com/wp-content/uploads/2022/04/ZMCT116A-specification.pdfYou need to put a current sense resistor on the secondary side of your current transformer. Assuming the voltage range of your ADC is 3.3V, the peak-to-peak voltage across the sense resistor needs to be under 3.3V and biased to 3.3/2 = 1.65V.

author: outrage
author_rank: Newbie
timestamp: April 19, 2025, 11:46:19 am
content: Oh, I'm sorry, I made a mistake with the sensor name. What if it's a Hall sensor? What will fundamentally change?

author: outrage
author_rank: Newbie
timestamp: April 19, 2025, 11:47:47 am
content: I mean, what will change in the connection scheme.

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 19, 2025, 11:57:13 am
content: Depends on the sensor, but ones with a linear output will most likely give of a voltage within a certain range. Search for datasheets on these components.

author: moffy
author_rank: Super Contributor
timestamp: April 19, 2025, 11:58:18 am
content: A Hall effect sensor is normally prebiased based upon the supply voltage, but you need to take into account DC drift.

author: outrage
author_rank: Newbie
timestamp: April 19, 2025, 12:07:54 pm
content: Thanks for the answers! Brainstrom begins

author: Zero999
author_rank: Super Contributor
timestamp: April 19, 2025, 02:03:25 pm
content: Use a potential divider to bias one side of the CT secondary at half the supply voltage. Put a sense resistor (also known as a burden resistor) across the secondary.

author: outrage
author_rank: Newbie
timestamp: April 19, 2025, 04:34:47 pm
content: Can anyone recommend literature on the topic of connecting and using Hall sensors? I want to study the topic better

author: TimFox
author_rank: Super Contributor
timestamp: April 19, 2025, 04:58:29 pm
content: Start by looking up the "Hall Effect" in physics, upon which these sensors are based.Fundamentally, take a slab of conductor, shaped roughly like a domino.Apply an external magnetic field through the thin dimension of the slab.Send an electrical current down the long dimension of the slab.The magnetic field will deflect the current a bit in the direction perpendicular to the current flow and the magnetic field.This produces a voltage in that direction.However, one must be careful not to confuse that voltage with the voltage in the direction of current flow caused by Ohm's Law, sensed due to misalignment of the contacts for sensing the Hall voltage.This can be improved by modulating the internal current flow and using multiple contacts for the voltage sense.With modulation, the sensor is useful for DC through a frequency less than the modulating frequency.Interestingly, the polarity of the Hall voltage depends on what the charge carriers in the material are: negative electrons or positive holes, or a combination.We see that a Hall Sensor is useful to measure the magnetic field through the sample: your external current, which you want to measure, induces a magnetic field according to the geometry of that current flow.

author: Zero999
author_rank: Super Contributor
timestamp: April 19, 2025, 06:21:50 pm
content: Are you talking about making your own Hall effect current sensor or asking about how to use one in your project?I wouldn't know where to start, regarding making a Hall effect current sensor, but I have used one before in a project.Anyway, you need to be specific about the input current range.

author: outrage
author_rank: Newbie
timestamp: April 19, 2025, 08:09:27 pm
content: Thank you all for the answers! I probably didn't make it very clear what I wanted to do.My project involves measuring the current flowing in the home wiring. I want to make this measurement using a Hall sensor.Now about the parameters: in my country, the standard voltage in home electrical networks is 220~ 230 volts; the current flowing in the circuit does not exceed 32 amperes. Therefore, a current in the range of 32 amperes will flow to the sensor input. I want to take the ACS758 sensor (https://www.chipdip.ru/product0/8752432854) , so that it can record the current in case of possible failures in the electrical network. The signal from the sensor must be output to the ESP-12, to a port that senses voltage up to 3.3 volts.Here's what we have: the measured current is 32 amps maximum; the maximum possible output voltage from the sensor is 3.3 volts.I have a few questions.:1. What exactly is the value of the output signal relative to the wire on which the sensor stands? RMS current?2. What should be included in the sensor connection circuit? I know that a filtering capacitor and a measuring resistor should be included, but maybe something else is needed?I apologize for any possible inaccuracies. It's difficult to translate the terms I'm used to into English.

author: TimFox
author_rank: Super Contributor
timestamp: April 19, 2025, 08:36:54 pm
content: To measure large AC currents, it is much easier to use a current transformer.They are readily available, need no power, and can be used without breaking the wire through which the current flows.The specification for some transformers will include the correct termination resistor on the output, and the voltage per ampere on that resistor.Others merely specify the current ratio from the wire (high current) to the secondary (low current) and the maximum current in the secondary winding.A simple AC voltmeter circuit following that resistor can be read by your voltage sense port on the ESP-12.I can't access your webpage on the ACS758. Allegro referred me tohttps://www.allegromicro.com/en/products/sense/current-sensor-ics/fifty-to-two-hundred-amp-integrated-conductor-sensor-ics/acs772for a replacement for the obsolescent 758. It seems to be overkill for your problem: Hall-Effect sensors are typically required when you need to measure DC current.

author: Zero999
author_rank: Super Contributor
timestamp: April 20, 2025, 10:17:47 am
content: Definitely use a transformer for AC.Use the circuit I posed above.The voltage across R3 must be under 3.3V peak-to-peak, or 1.65V peak.The current you want to measure is 32A RMS. To get the peak current it must be multiplied by √2, giving 45.25A.The current transformer divides the current by 2500, so the current flowing through the secondary and R3 is 45.25/2500 = 18.1mA peak.The maximum peak voltage across R3 is determined by Ohm's law. R = V/I, so 1.65/0.0181 = 91.15 Ohms.Use a 91 Ohm or 90.9 Ohm resistor for R3.

author: xvr
author_rank: Frequent Contributor
timestamp: April 20, 2025, 12:38:24 pm
content: QuoteNo, just voltage, proportional to momentary value of current. Zero current will produce Vcc/2 output voltage. Positive current will produce voltage > Vcc/2, negative - less than Vcc/2.QuoteTake a look at datasheet for sensor - it contains application circuit (BTW - there is no measuring resistor there, just RC filter on output)You could be needed an amplifier between output of sensor and input of ADC, it depends on curretn range you have to measure and type of sensor.Your ACS758LCB-050B-PFF-T has 40mV/A, it could be not enough to drive ADC directly

author: Zero999
author_rank: Super Contributor
timestamp: April 20, 2025, 04:08:03 pm
content: I entered my circuit into LTSpice.SPICE models the transformer as a pair of coupled inductors. I don't know what the inductance of the CT is, so I guessed, but it doesn't matter, since it's the ratio which is important.NP/NS= √(LP/LS)

author: outrage
author_rank: Newbie
timestamp: April 22, 2025, 06:23:35 am
content: Thank you all so much for the answers! I didn't expect such a feedback.

author: BadeBhaiya
author_rank: Regular Contributor
timestamp: April 22, 2025, 08:29:09 am
content: Hope I'm not intruding but just curious if its possible to make a current sensor using these hall effect sensors. Basically some kind of assembly that would let the conductor current be measured by the sensor. Yes I'm aware this sounds awfully like the sensors available these days, but hear me out. Instead of a single sensor, why not have multiple of them for different ranges, so we have an array of sensors, using which we can get better dynamic range than with a single sensor.We probably wouldn't be able to measure too low. But it sounds pretty cool to me.

author: Infraviolet
author_rank: Super Contributor
timestamp: April 23, 2025, 12:30:24 am
content: BadeBhaiya: It can be done, but it's the sort of sensor where calibrating it before use will be very important. Might only work for fairly large currents, depending on the sensor sensitivity, and you have to get the sensor very close to the current carrying wire and ensure the distance between it and that wire remains absolutely constant. Magnetic fields around a current carrying wire drop off quickly with distance, if there's any wiggle room at all then the changing in distance could cause a much larger change in the hall effect sensor's output signal than variations in the amount of current carried would cause.

author: Terry Bites
author_rank: Super Contributor
timestamp: May 03, 2025, 07:10:42 pm
content: Not an engineering degree I take it.