Do-it-yourself non-contact current meter. Small size AC sensor. Contacts for connecting a three-wire loop

The current transducer is a device that can replace the current transformers and shunts used today. It is used for control and measurement, and is an excellent engineering solution. The design of the device is made in accordance with modern methods of technical implementation of equipment and ways to ensure the versatility, convenience and reliability of the system. That is why measuring transducers developed by a Russian manufacturer are in great demand every year. The range of possible modifications pleases consumers, as it allows you to choose the most suitable solution and at the same time not overpay.

What is special about current transducers?

The main feature of the measuring current transducer is its versatility. Both direct current, and pulsed, and alternating current can be applied to the input of the device. To make this versatility possible, manufacturers have developed a device based on the Hall principle. The converter implements a small circuit made on semiconductors. With its help, the magnitude and direction of the magnetic field of the current applied to the input of the device is determined. Thus, the Hall effect current converter is a unique device with high performance and functionality.

The device is made in the form of a housing with a hole through which a current-carrying conductor is passed. The power supply of the electronic circuit of the converter is carried out from the mains with a DC voltage equal to 15 volts. A current appears at the output of the device, which changes in value, direction and time in direct proportion to the current at the input. In this case, the current measuring transducer based on the Hall effect can be made not only with a hole for the output of current-carrying conductors, but also in the form of a device intended for installation in a circuit break.

Design features of measuring current transducers

The non-contact current measuring transducer is made with galvanic isolation between the control circuit and the power circuit. The converter consists of a magnetic circuit, a compensation winding and a Hall device. When current flows through the tires, induction is induced in the magnetic circuit, while the Hall device generates a voltage that changes as the induced induction changes. The output signal is fed to the input of an electronic amplifier, and then goes to the compensation winding. As a result, a current flows through the compensation winding, which is directly proportional to the current at the input, while the shape of the primary current is completely repeated. In fact, it is a current and voltage converter.

Non-contact AC current measuring transducer

Most often, consumers purchase current and voltage sensors for three-phase AC power networks. Therefore, manufacturers have specially developed PIT-___-T measuring transducers with simpler electronics and, accordingly, low price. The operation of the devices can take place at different temperatures, in the frequency range from 20 to 10 kHz. At the same time, consumers have the opportunity to select the type of output signal from the converter - voltage or current. Non-contact current transducers are manufactured for installation on a round or flat busbar. This significantly expands the scope of this equipment and makes it relevant in the reconstruction of substations of different capacities.

For arranging the power supply of the garage, it is very convenient to know the current that is consumed by one or another device included in this network. The range of these devices is quite wide and is constantly increasing: drill, sharpener, grinder, heaters, welding machines, memory, industrial hair dryer, and much more ....

To measure alternating current, as is known, as a current sensor itself, as a rule, a current transformer is used. This transformer, in general, is similar to a conventional step-down, turned on, as it were, "vice versa", i.e. its primary winding is one or more turns (or a bus) passed through the core - a magnetic circuit, and the secondary is a coil with a large number of turns of a thin wire located on the same magnetic circuit (Fig. 1).

However, industrial current transformers are quite expensive, bulky and often designed to measure hundreds of amperes. A current transformer designed for the range of a household network is rarely seen on sale. It is for this reason that the idea was born to use an electromagnetic DC / AC relay for this purpose, without any use of the contact group of such a relay. In fact, any relay already contains a coil with a large number of turns of thin wire, and the only thing that is needed to turn it into a transformer is to provide a magnetic circuit around the coil with a minimum of air gaps. In addition, of course, such a design requires enough space to pass the primary winding, which represents the input network. The picture shows such a sensor made from a RES22 type relay for 24 V DC. This relay contains a winding with a resistance of approximately 650 ohms. Most likely, many other types of relays, including the remains of faulty magnetic starters, etc., can find similar applications. To ensure the magnetic circuit, the relay armature is mechanically blocked at the maximum approach to the core. The relay seems to be on all the time. Next, a coil of the primary winding is made around the coil (in the picture it is a triple blue wire).

Actually, on this the current sensor is ready, without too much fuss with winding the wire on the coil. Of course, it is difficult to consider this device as a full-fledged transformer both in view of the small cross-sectional area of ​​the newly obtained magnetic circuit and, possibly, in view of the difference in its magnetization characteristics from the ideal one. However, all this turns out to be less important due to the fact that we need the minimum power of such a “transformer” and is necessary only in order to ensure a proportional (preferably linear) deviation of the magnetoelectric system pointer indicator depending on the current in the primary winding.

A possible circuit for pairing a current sensor with such an indicator is shown in the diagram (Fig. 2). It is quite simple and resembles a detector receiver circuit. The rectifier diode (D9B) is germanium and was chosen due to the smallness of the voltage drop across it (about 0.3 V). The threshold of the minimum current value that this sensor is able to determine will depend on this diode parameter. In this regard, for this it is better to use the so-called detector diodes with a small voltage drop, for example, GD507 and the like. A pair of silicon diodes kd521v is installed in order to protect the pointer device from overload, which is possible with significant current surges caused, for example, by a short circuit within the network, turning on powerful transformers or a welder. This is a very common approach in such cases. It should be noted that such a simple circuit has the disadvantage that it absolutely cannot “see” the load in the form of a current of one polarity, such as a heater or a heating element connected through a rectifier diode. In these cases, a somewhat “complicated” circuit is used, for example, in the form of a voltage doubling rectifier (Fig. 3).

Hi all!

Perhaps I should introduce myself a little - I am an ordinary circuit engineer who is also interested in programming and some other areas of electronics: DSP, FPGA, radio communication and some others. Lately I've been immersed in SDR receivers. At first I wanted to devote my first article (I hope not the last one) to some more serious topic, but for many it will become just reading material and will not be useful. Therefore, the topic chosen is highly specialized and exclusively applied. I also want to note that, probably, all articles and questions in them will be considered more by a circuit engineer, and not by a programmer or anyone else. Well - let's go!

Not so long ago, I was ordered to design a "System for monitoring the power supply of a residential building", the customer is building country houses, so some of you may even have already seen my device. This device measured consumption currents at each input phase and voltage, simultaneously sending data over the radio channel to the already installed Smart Home system + was able to cut down the starter at the input to the house. But the conversation today will not be about him, but about his small, but very important component - the current sensor. And as you already understood from the title of the article, these will be “non-contact” current sensors from Allegro - ACS758-100.
________________________________________________________________________________________________________________________

You can see the datasheet, on the sensor that I will talk about. As you might guess, the number "100" at the end of the marking is the maximum current that the sensor can measure. To be honest - I have doubts about this, it seems to me that the conclusions simply cannot withstand 200A for a long time, although it is quite suitable for measuring the inrush current. In my device, a 100A sensor passes through itself without problems constantly at least 35A + there are consumption peaks up to 60A.

Figure 1 - Appearance of the ACS758-100(50/200) sensor

Before I move on to the main part of the article, I suggest that you familiarize yourself with two sources. If you have basic knowledge of electronics, then they will be redundant and feel free to skip this paragraph. For the rest, I advise you to go over for a general development and understanding:

1) Hall effect. Phenomenon and principle of operation
2) Modern current sensors
________________________________________________________________________________________________________________________

Well, let's start with the most important, namely the labeling. I buy components in 90% of cases on www.digikey.com. The components arrive in Russia in 5-6 days, the site has everything, there is also a very convenient parametric search and documentation. So the full list of sensors of the family can be viewed there on request " ACS758". My sensors were bought in the same place - ACS758LCB-100B.

Inside the datasheet, everything is labeled, but I will still pay attention to the key point " 100V":

1) 100 - this is the measurement limit in amperes, that is, my sensor can measure up to 100A;
2) "IN"- here you should pay special attention to this letter, instead of it there may also be a letter" U". Gauge with letter B can measure alternating current, and, accordingly, direct current. Sensor with letter U can only measure direct current.

Also at the beginning of the datasheet there is an excellent plate on this topic:


Figure 2 - Types of current sensors of the ACS758 family

Also one of the most important reasons for using such a sensor was - galvanic isolation. Power outputs 4 and 5 are not electrically connected to outputs 1,2,3. In this sensor, communication is only in the form of an induced field.

Another important parameter appeared in this table - the dependence of the output voltage on the current. The beauty of this type of sensors is that they have a voltage output, not a current output like classic current transformers, which is very convenient. For example, the sensor output can be connected directly to the ADC input of the microcontroller and take readings.

For my sensor, this value is 20 mV/A. This means that when a current of 1A flows through the terminals 4-5 of the sensor, the voltage at its output will increase by 20 mV. I think the logic is clear.

The next moment, what will be the output voltage? Considering that the power supply is “human”, that is, unipolar, then when measuring alternating current there should be a “reference point”. In this sensor, this reference point is equal to 1/2 of the supply (Vcc). This solution often happens and it is convenient. When current flows in one direction, the output will be " 1/2Vcc+I*0.02V", in the other half-cycle, when the current flows in the opposite direction, the output voltage will be narrower" 1/2 Vcc - I*0.02V". At the output we get a sinusoid, where "zero" is 1/2Vcc. If we measure direct current, then at the output we will have " 1/2Vcc+I*0.02V", then when processing data on the ADC, we simply subtract the constant component 1/2 Vcc and work with the true data, that is, with the remainder I*0.02V.

Now it's time to check in practice what I described above, or rather subtracted from the datasheet. To work with the sensor and check its capabilities, I built this “mini-stand”:


Figure 3 - Site for testing the current sensor

First of all, I decided to apply power to the sensor and measure its output to make sure that it took 1/2 Vcc. The connection diagram can be found in the datasheet, but I, just wanting to get acquainted, did not waste time and sculpt a filter capacitor for power supply + RC low-pass filter circuit at the Vout pin. In a real device, there is nowhere without them! I ended up with this picture:


Figure 4 - The result of the measurement of "zero"

When power is applied 5V from my handkerchief STM32VL Discovery I saw these results - 2.38V. The first question that came up was: Why 2.38 and not those described in the 2.5 datasheet?"The question disappeared almost instantly - I measured the power bus for debugging, and there 4.76-4.77V. And the thing is that the power comes from USB, there is already 5V, after USB there is a linear stabilizer LM7805, and this is clearly not an LDO with a 40 mV drop. Here it is about 250 mV and they fall. Well, okay, this is not critical, the main thing is to know that "zero" is 2.38V It is this constant that I will subtract when processing data from the ADC.

And now we will carry out the first measurement, so far only with the help of an oscilloscope. I will measure the short circuit current of my regulated power supply, it is equal to 3.06A. This and the built-in ammeter shows and the fluke gave the same result. Well, we connect the PSU outputs to the legs 4 and 5 of the sensor (in the photo I have a twist) and see what happened:


Figure 5 - Measuring the short circuit current of the PSU

As we can see, the voltage vout increased from 2.38V to 2.44V. Looking at the dependency above, we should have 2.38V + 3.06A*0.02V/A, which corresponds to a value of 2.44V. The result is in line with expectations, at a current of 3A we got an increase to "zero" equal to 60 mV. Conclusion - the sensor is working, you can already work with it using the MC.

Now you need to connect the current sensor to one of the ADC pins on the STM32F100RBT6 microcontroller. The pebble itself is very mediocre, the system frequency is only 24 MHz, but this scarf has survived a lot and has proven itself. I have owned it for probably 5 years, because it was obtained for free at a time when ST was handing them out right and left.

At first, out of habit, I wanted to put an op-amp with a coefficient after the sensor. gain "1", but, looking at the structural diagram, I realized that he was already inside. The only thing worth considering is that at the maximum current, the output power will be equal to the power supply of the Vcc sensor, that is, about 5V, and the STM can measure from 0 to 3.3V, so in this case it is necessary to put a resistive voltage divider, for example, 1:1.5 or 1:2. My current is scanty, so I will neglect this moment for now. My test device looks something like this:


Figure 6 - We assemble our "ammeter"

Also, to visualize the results, I screwed a Chinese display on the ILI9341 controller, since it was lying around at hand, but my hands couldn’t reach it. To write a full-fledged library for him, I killed a couple of hours and a cup of coffee, since the datasheet turned out to be surprisingly informative, which is rare for the crafts of Jackie Chan's sons.

Now you need to write a function to measure Vout using the ADC of the microcontroller. I won’t tell you in detail, on STM32 there is already a lot of information and lessons. So let's just look:

Uint16_t get_adc_value() ( ADC_SoftwareStartConvCmd(ADC1, ENABLE); while(ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET); return ADC_GetConversionValue(ADC1); )
Further, in order to get the results of the ADC measurement in the executable code of the main body or interrupt, you must write the following:

data_adc = get_adc_value();
Having previously declared the data_adc variable:

extern uint16_t data_adc;
As a result, we get the data_adc variable, which takes a value from 0 to 4095, because ADC in STM32 is 12 bit. Next, we need to turn the result obtained “in parrots” into a more familiar form for us, that is, into amperes. Therefore, it is necessary to first calculate the division price. After the stabilizer on the 3.3V bus, my oscilloscope showed 3.17V, I didn’t figure out what it was connected with. Therefore, dividing 3.17V by 4095, we get the value 0.000774V - this is the division price. That is, having received a result from the ADC, for example, 2711, I simply multiply it by 0.000774V and get 2.09V.

In our task, the voltage is only an “intermediary”, we still need to convert it to amperes. To do this, we need to subtract 2.38V from the result, and divide the remainder by 0.02 [V/A]. The result is this formula:

Float I_out = ((((float)data_adc * presc)-2.38)/0.02);
Well, it's time to upload the firmware to the microcontroller and see the results:


Figure 7 - Results of measuring data from the sensor and their processing

I measured the circuit's own consumption as you can see 230 mA. Having measured the same thing with a verified fluke, it turned out that the consumption was 201 mA. Well - the accuracy of one decimal place is already very cool. I will explain why ... The range of the measured current is 0..100A, that is, the accuracy up to 1A is 1%, and the accuracy up to tenths of an ampere is already 0,1%! And please note, this is without any circuit solutions. I was even too lazy to hang filtering power supply conduits.

Now I need to measure the short circuit current (SC) of my power supply. I turn the knob to the maximum and get the following picture:


Figure 8 - Short-circuit current measurements

Well, actually the readings on the source itself with its native ammeter:


Figure 9 - Value on the BP scale

In fact, it showed 3.09A, but while I was photographing, the winding heated up, and its resistance increased, and the current, respectively, fell, but this is not so scary.

In conclusion, I don't even know what to say. I hope my article will somehow help beginner radio amateurs in their difficult journey. Perhaps someone will like my form of presentation of the material, then I can continue to periodically write about working with various components. You can express your wishes on the topic in the comments, I will try to take into account.

To control the current consumption, fix the blocking of the motors or the emergency de-energization of the system.

Working with high voltage is hazardous to health!

Touching the terminal block screws and their terminals may result in electric shock. Do not touch the board if it is connected to a household network. For the finished device, use an insulated housing.

If you do not know how to connect the sensor to an electrical appliance powered by a common 220 V network or if you have doubts, stop: you can start a fire or kill yourself.

You must clearly understand the principle of operation of the device and the dangers of working with high voltage.

Video review

Connection and setup

The sensor communicates with the control electronics via three wires. The output of the sensor is an analog signal. When connected to Arduino or Iskra JS, it is convenient to use Troyka Shield, and for those who want to get rid of wires, Troyka Slot Shield is suitable. For example, let's connect a cable from the module to the group of Troyka Shield contacts related to the analog pin A0. You can use any analog pins in your project.

Work examples

To make it easier to work with the sensor, we have written the TroykaCurrent library, which converts the sensor's analog output values ​​to milliamps. Download and install it to repeat the experiments described below.

DC current measurement

To measure direct current, connect the sensor to the open circuit between the LED strip and the power supply. Let's output the current value of the DC current in milliamps to the Serial port.

CurrentDC.ino #include Serial.print("Current is " ) ; Serial.print (sensorCurrent.readCurrentDC () ) ; Serial.println("mA"); delay(100) ; )

AC current measurement

To measure alternating current, we connect the sensor to the open circuit between the alternating voltage source and the load. Let's output the current value of the alternating current in milliamps to the Serial port.

CurrentAC.ino // library for working with current sensor (Troyka-module)#include // create an object to work with the current sensor // and pass it the pin number of the output signal ACS712 sensorCurrent(A0) ; void setup()( // open serial port Serial.begin(9600) ; ) void loop() ( // display sensor readings for direct current Serial.print("Current is " ) ; Serial.print (sensorCurrent.readCurrentAC () ) ; Serial.println("mA"); delay(100) ; )

Board elements

Sensor ACS712ELCTR-05B

The ACS712ELCTR-05B current sensor is based on the Hall effect, the essence of which is as follows: if a current-carrying conductor is placed in a magnetic field, an EMF appears at its edges, directed perpendicular to the direction of the current and the direction of the magnetic field.
The microcircuit structurally consists of a Hall sensor and a copper conductor. The current flowing through the copper conductor creates a magnetic field, which is perceived by the Hall element. The magnetic field depends linearly on the strength of the current.

The sensor output voltage level is proportional to the measured current. Measurement range from −5 A to 5 A. Sensitivity - 185 mV/A. In the absence of current, the output voltage will be equal to half the supply voltage.

The current sensor is connected to the load in an open circuit through the pads under the screw. To measure direct current, connect the sensor, taking into account the directions of the current, otherwise you will get values ​​with the opposite sign. For alternating current, polarity does not matter.

Contacts for connecting a three-wire loop

The module is connected to the control electronics via three wires. The purpose of the contacts of the three-wire loop:

    Power (V) - red wire. Based on the documentation, the sensor is powered by 5 volts. As a result of the test, the module also works from 3.3 volts.

    Ground (G) - black wire. Must be connected to the ground of the microcontroller;

    Signal (S) - yellow wire. Connected to the analog input of the microcontroller. Through it, the control board reads the signal from the sensor.

Content:

In order to successfully automate various technological processes, effectively manage instruments, devices, machines and mechanisms, it is necessary to constantly measure and control many parameters and physical quantities. Therefore, sensors providing information on the state of controlled devices have become an integral part of automatic systems.

At its core, each sensor is an integral part of regulating, signaling, measuring and control devices. With its help, one or another controlled value is converted into a certain type of signal, which makes it possible to measure, process, register, transmit and store the information received. In some cases, the sensor can affect the processes under control. All these qualities are fully possessed by the current sensor used in many devices and microcircuits. It converts the impact of electric current into signals that are convenient for further use.

Sensor classification

Sensors used in various devices are classified according to certain characteristics. If it is possible to measure input values, they can be: electrical, pneumatic, speed sensors, mechanical displacements, pressure, acceleration, force, temperature and other parameters. Among them, the measurement of electrical and magnetic quantities takes about 4%.

Each sensor converts an input value into some output parameter. Depending on this, control devices can be non-electrical and electrical.

The most common of the latter are:

  • DC sensors
  • AC Amplitude Sensors
  • Resistance sensors and other similar devices.

The main advantage of electrical sensors is the ability to transmit information over certain distances at high speed. The use of a digital code provides high accuracy, speed and increased sensitivity of measuring instruments.

Operating principle

According to the principle of operation, all sensors are divided into two main types. They can be generator - directly converting the input values ​​into an electrical signal. Parametric sensors include devices that convert input values ​​into changed electrical parameters of the sensor itself. In addition, they can be rheostatic, ohmic, photoelectric or optoelectronic, capacitive, inductive, etc.

There are certain requirements for the operation of all sensors. In each device, the input and output values ​​must be directly related to each other. All characteristics must be stable over time. As a rule, these devices are characterized by high sensitivity, small size and weight. They can work in a variety of conditions and can be installed in a variety of ways.

Modern current sensors

Current sensors are devices that determine the strength of direct or alternating current in electrical circuits. Their design includes a magnetic core with a gap and a compensation winding, as well as an electronic board that processes electrical signals. The main sensitive element is the Hall sensor, fixed in the gap of the magnetic circuit and connected to the input of the amplifier.

The principle of operation is generally the same for all such devices. Under the action of the measured current, a magnetic field arises, then, using the Hall sensor, the corresponding voltage is generated. Further, this voltage is amplified at the output and fed to the output winding.

The main types of current sensors:

Direct Gain Sensors (O/L). They have small size and weight, low power consumption. The range of signal conversions has been significantly expanded. Avoids losses in the primary circuit. The operation of the device is based on a magnetic field that creates a primary current IP. Next, the magnetic field is concentrated in the magnetic circuit and its further transformation by the Hall element in the air gap. The signal received from the Hall element is amplified and a proportional copy of the primary current is formed at the output.

Current sensors (Eta). They are characterized by a wide frequency range and an extended conversion range. The advantages of these devices are low power consumption and low latency. The operation of the device is supported by a unipolar power supply from 0 to +5 volts. The operation of the device is based on a combined technology that uses a compensation type and direct amplification. This contributes to a significant improvement in sensor performance and more balanced operation.

Compensating current sensors (C/L). They feature a wide frequency range, high accuracy and low latency. This type of instrument has no primary signal loss, excellent linearity characteristics and low temperature drift. Compensation of the magnetic field created by the primary current IP, occurs due to the same field formed in the secondary winding. The generation of the secondary compensating current is carried out by the Hall element and the electronics of the sensor itself. Ultimately, the secondary current is a proportional copy of the primary current.

Compensation current sensors (type C). The undoubted advantages of these devices are a wide frequency range, high accuracy of information, excellent linearity and reduced temperature drift. In addition, these instruments can measure residual currents (CD). They have high levels of isolation and reduced influence on the primary signal. The design consists of two toroidal magnetic circuits and two secondary windings. The operation of the sensors is based on the compensation of ampere-turns. A current with a small value from the primary circuit passes through the primary resistor and the primary winding.

PRIME current sensors. AC conversion uses a wide dynamic range. The instrument features good linearity, low temperature losses and no magnetic saturation. The advantage of the design is small dimensions and weight, high resistance to various types of overloads. The accuracy of the readings does not depend on how the cable is located in the hole and is not affected by external fields. This sensor does not use a traditional open coil, but a sensor head with touch printed circuit boards. Each board consists of two separate air-core coils. All of them are mounted on a single basic printed circuit board. Two concentric circuits are formed from the sensor boards, at the outputs of which the induced voltage is summed. As a result, information about the parameters of the amplitude and phase of the measured current is obtained.

Current sensors (type IT). They feature high precision, wide frequency range, low output noise, high temperature stability and low crosstalk. There are no Hall elements in the design of these sensors. The primary current creates a magnetic field, which is further compensated by the secondary current. At the output, the secondary current is a proportional copy of the primary current.

Advantages of current sensors in modern circuits

Chips based on current sensors play a big role in energy conservation. This is facilitated by low power and power consumption. In integrated circuits, all the necessary electronic components are combined. The characteristics of the devices are greatly improved due to the joint work of the magnetic field sensors and all other active electronics.

Modern current sensors further reduce size as all electronics are integrated into a single common chip. This has led to new innovative compact design solutions, including those for the primary tyre. Each new current sensor has increased isolation and successfully interacts with other types of electronic components.

The latest designs of sensors allow them to be mounted in existing installations without disconnecting the primary conductor. They consist of two parts and are detachable, which makes it easy to install these parts on the primary conductor without any disconnection.

For each sensor there is a technical documentation, which reflects all the necessary information that allows you to make preliminary calculations and determine the place of the most optimal use.

Up