Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Mains voltage stabilizer with microcontroller control. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Microcontrollers

Comments on the article Comments on the article

A long-term deviation of the mains voltage by more than 10% from the nominal value of 220 V in many regions of our country, unfortunately, has become a common occurrence.

With an increased (up to 240 ... 250 V) voltage in the network, the service life of lighting devices is significantly reduced, the heating of transformer power supplies and motors in refrigerator compressors increases.

Reducing the mains voltage below 160 ... 170 V causes a significant increase in the load on key transistors in switching power supplies (this can lead to their overheating and subsequent thermal breakdown), as well as jamming of motors in refrigerator compressors, which also leads to their overheating and output out of service.

Even greater voltage fluctuations for single-phase consumers powered by a three-phase network occur in the event of a break in the neutral wire in the area from the point of connection of the consumer to the four-wire network to the transformer substation. In this case, due to phase imbalance, the voltage in the outlet can vary from several tens of volts up to linear 380 V, which will inevitably lead to damage to almost all complex household appliances connected to the outlet. The proposed stabilizer will help to avoid the troubles associated with extreme voltage fluctuations in the network.

To stabilize the mains voltage in domestic conditions, ferroresonance stabilizers are mainly used. Their disadvantages include distortion of the sinusoidal form of the output voltage (for example, it is forbidden to connect a refrigerator to such a stabilizer), the limited power of household stabilizers (300 ... 400 W) with significant weight and size indicators, the inability to work without load, a narrow stabilization range failure at high voltage in the network.

The compensation voltage stabilizer is free from these shortcomings, the block diagram of which is shown in fig. one.

Mains voltage stabilizer with microcontroller control

It works on the principle of stepwise voltage correction, carried out by switching the taps of the winding of the autotransformer T1 using triac switches Q2-Q6 under the control of a microcontroller (MK) that monitors the voltage level in the network.

The method used in the stabilizer for estimating the amplitude of the mains voltage is extremely simple to implement and provides quite sufficient measurement accuracy for this application. However, it imposes a number of restrictions on the possible use of the device. First of all, the mains voltage frequency must remain constant (50 Hz). This condition may be violated, for example, if power is supplied from an autonomous diesel generator. In addition, the measurement accuracy decreases with an increase in the nonlinear distortion of the mains voltage waveform, which occurs during the operation of closely spaced powerful consumers with a pronounced inductive nature of the load.

The schematic diagram of the device is shown in fig. 2.

Mains voltage stabilizer with microcontroller control
(click to enlarge)

According to the program recorded in the memory, MK DD1 measures the mains voltage in each period (20 ms). From the divider R1R2, the negative half-waves of the mains voltage, passing through the zener diode VD1, form pulses on it with an amplitude determined by the stabilization voltage of the zener diode, in this case 10 V.

From the divider R3R4, which reduces the amplitude of the received signal to the TTL level (Fig. 3), these pulses come to line 0 of port A, configured for input. Using the trimmer resistor R4, the lower signal level at the MK input is set to 0,2 ... 0,3 V below the log level. 0. At room temperature and a stabilized supply voltage, the voltage level of the transition of the digital input of the CMOS microcircuit from the state of the log. 1 to the state of the log. 0 (and back from 0 to 1 with some hysteresis, which in this case can be neglected due to its constant value) remains almost constant.

Mains voltage stabilizer with microcontroller control

As can be seen from fig. 3, when the mains voltage changes from 145 to 275 V, the duration of the pulses corresponding to the log. 0, varies from about 0,5 to 6 ms. By measuring the duration of these pulses, the MC program calculates the level of mains voltage in the current period. (R4.1 is the resistance of a part of the resistor R4 from the bottom - according to the diagram - output to the engine).

After turning on the stabilizer, the mains voltage is controlled for 5 s. If it is in the range of 145 ... 275 V, the green LED HL2 "Normal" flashes, otherwise the LED HL3 "Low" or HL1 "High" lights up (depending on the value of the mains voltage). In this state, the stabilizer is until the voltage in the network enters the specified limits.

If after 5 s the voltage in the network remains within acceptable limits, the MK issues a command to open the triac VS1, through which the autotransformer T1 is connected to the network. After that, the MK makes control measurements of the mains voltage for another 0,5 s, and then, depending on the result of the measurement, opens one of the triacs VS2-VS6, thereby connecting the load to one of the five taps of the autotransformer. Galvanic isolation of triacs with MK is carried out by thyristor optocouplers U1-U6.

In the process of regulation, the opening pulse is removed from the switched on triac at the end of the half-cycle of the sinusoid of the mains voltage. After that, the MK program pauses for 4 ms, and then sends an opening pulse to another triac. The duration of the delay between switching triacs can be increased by changing at the beginning of the program (in the constant description block) the corresponding value of the delay time (see comments in the source code of the program). Increasing this time to 10...15 ms is necessary if an inductive load with a power factor less than 0,7...0,8 is connected to the stabilizer.

If the mains voltage deviates beyond the permissible limits, the autotransformer, together with the load, is turned off by the triac VS1. LEDs HL1-HL8 indicate the state of the stabilizer and the voltage levels in the network.

Depending on the value of the mains voltage U, the outputs of the additional windings of the autotransformer are switched in the following order:

  • U < 145 V - the load is off, the red LED HL3 is on ("Low");
  • 145< U < 165 V - the load is connected to terminal 7 (hereinafter, for brevity, only the numbers of the terminals to which the load is connected are indicated), the red LED HL8 ("+ 20%") is on, HL3 flashes ("Low");
  • 165 < U < 190 V - pin 7, HL8 is on ("+ 20%");
  • 190 < U < 205 V - terminals 8 and 8', yellow LED HL7 is on ("+ 10%");
  • 205 < U < 235 V - output 1, the green LED HL6 is on ("0%");
  • 235 < U < 245 V - pins 6 and 6', yellow LED HL5 is on ("-7,5%");
  • 245 < U < 265 V - output 5', red LED HL4 is on ("-15%");
  • 265 < U < 275 V - output 5', red LED HL4 is on ("-15%"), HL1 is flashing ("High");
  • U > 275 V - the load is disconnected from the network, the red LED HL1 ("High") is on.

To prevent erratic switching of triacs in case the mains voltage is at the threshold of switching the taps of the autotransformer, some "hysteresis" in operation has been introduced into the program. For example, if with an increase in the mains voltage from 189 to 190 V, the load is switched from the "+ 20%" tap to "+ 10%", then the MC will switch the load back to "+ 20%" only when the mains voltage drops to approximately 187 V. The delay between the voltage change in the network and the corresponding switching of the autotransformer taps does not exceed 40 ms.

In the event of a "failure" of the mains voltage below 145 V for more than 100 ms (can be changed, see comments in the source code of the program), the MK disconnects the autotransformer with the load connected to it from the network, while the green LED HL2 "Normal" goes out and the red LED lights up HL3 "Low". If the voltage in the network has risen above 275 V, the controlled load will be disconnected from the network after 40 ms and the red LED HL1 "High" will light up.

After the mains voltage returns to normal (145

When the mains voltage fails, the charge of the capacitor C2 is enough for about 30 seconds to maintain the normal operation of the MK, then the program freezes, as a result of which the independent watchdog timer (WDT) built into the MK is triggered. Information about the signal from this timer is stored in the memory of the MK for about 3 minutes more (until the capacitor C2 is discharged to almost zero). If at this time the mains voltage is restored, the newly launched program, having found a signal from the WDT in the memory, will wait for the SB1 button to be pressed. Thus, the restoration of the mains voltage after 4 ... 5 minutes after the shutdown will be regarded by the stabilizer as a regular one and, therefore, after 5 s (the time of the control testing of the mains voltage), the load through the autotransformer will be connected to the network.

If the stabilizer works, for example, in conjunction with an uninterruptible power supply or another device for which possible cycles of random on-off voltage due to a power outage are not critical, waiting in the program for pressing the SB1 button can be bypassed (see comments in program source code).

Pressing the SB1 button for 2 s during normal operation of the device leads to a load disconnection, and the stabilizer goes into standby mode, similar to the one that occurs after a power failure in the network.

MK DD1 is powered by two sources of a stabilized voltage of 5 V. In standby mode, when the T1 autotransformer is disconnected from the network (VS1 triac is closed), the current consumed by the control device is minimal (20 ... 25 mA) and the power is supplied from a transformerless source, consisting from the ballast capacitor C1 and the zener diode VD3. This source ensures stable operation of the microcontroller when the mains voltage changes from 100 to 400 V.

When the device switches from standby mode to operating mode, when the T1 autotransformer is connected to the network together with the load (optocoupler U1, one of the optocouplers U2-U6, as well as one of the LEDs HL4-HL8 and, possibly, HL1 or HL3, flashing when the voltage approaches network to the limits of the permitted range), the current consumption increases to about 100 mA. In this mode, the power of the transformerless power supply is not enough to maintain a stable (without noticeable ripples) supply voltage of 5 V. To exclude the influence of the instability of the MC supply voltage on the result of measuring the mains voltage, the device provides a second source of stabilized voltage of 5 V, assembled on an integrated stabilizer DA1. The C6R5R6 circuit, when the device is connected to the network, generates a time delay before starting the MK, which is necessary for the voltage on the capacitor C2 to rise to a level that ensures the normal operation of the MK.

The stabilizer uses MLT fixed resistors, trimmers (R2, R4) SP5-2. Capacitor C1 - MBGCH with a rated voltage of at least 500 V. It is possible to use a K73-17 capacitor with a rated voltage of 630 V (it should, however, be noted that the permissible amplitude of the alternating voltage of this capacitor does not exceed 315 V). It is desirable to select a zener diode VD3 with a stabilization voltage of 0,05 ... 0,1 V greater than the voltage at the output of the DA1 stabilizer.

Triacs KU208G are replaceable by any others designed for the required current and voltage in the closed state of at least 400 V.

The T1 autotransformer was converted from a TS-180-2 network transformer (from an old black and white TV). In the autotransformer mode, it is capable of supplying a load with a power of up to 1 kW [1]. The twisted magnetic circuit of this transformer consists of two U-shaped parts, on which frames with windings are placed. The windings, the numbers of which are indicated in the diagram without strokes, are wound on one frame, with strokes on the other. If we limit ourselves to the long-term output power of the stabilizer 250 ... 300 W, the primary windings 1-2 and 1'-2', containing 450 turns of wire PEV-2 0,9, can be left unchanged. In this case, all secondary windings of the transformer are removed and new ones are wound in their place with PEV-20,9 mm wire. Windings 5-6 and 5'-6' should contain 75, 7-8 and 7'-8' - 100, winding 9-10 - 35 turns. If more power is needed, both primary and all secondary windings should be rewound with a wire of an appropriately larger cross section [1].

All parts of the voltage regulator, with the exception of capacitor C1, zener diode VD3, triacs VS1 - VS6 and autotransformer T1, are mounted on a 60x110 mm printed circuit board made of double-sided foil fiberglass. An 18-slot panel is installed on the board to connect the MK. Triacs VS1-VS6 are equipped with U-shaped heat sinks with a dissipation area of ​​25 cm2, bent from a sheet of aluminum alloy 2 mm thick. Together with the VD3 zener diode, they are mounted on a separate 60x110 mm fiberglass board. To reduce noise from a working autotransformer, it is advisable to stick four mugs of soft rubber with a diameter of 15 and a thickness of 5 mm on the base of the stabilizer housing at the corners. A view of the installation of the stabilizer is shown in fig. 4.

Mains voltage stabilizer with microcontroller control

MK firmware codes are given in the table.

Mains voltage stabilizer with microcontroller control
(click to enlarge)

When programming, the configuration byte indicates: generator type - HS, WDT and Power-up timer are enabled.

Program source code

The establishment of the stabilizer begins with checking the correct connection of the autotransformer windings. To do this, its primary winding 1-1' is connected to the network and the voltage is measured between terminals 5-5' and 7-7'. With a mains voltage of 220 V, the first of them should be 33, the second - 44 V. If instead the measured voltage is 0, it is necessary to swap the conclusions of the windings 5-6 or 7-8, depending on in which case the voltage turned out to be equal 0. Then measure the voltage between points Г and 5'. If instead of 187 253 V is obtained, the conclusions 5 and 5' are interchanged. In conclusion, the voltage between points 1'and 7 is checked, which should be equal to 264 V. The voltage of 176 V indicates that it is necessary to swap the conclusions 7 and 7'.

To set the voltage limits at which the MK performs the corresponding switching of autotransformer taps, you will need an adjustable AC voltage source (LATR), an AC voltmeter with a measurement redistribution of 300 V and an oscilloscope. Adjust the stabilizer in the following sequence.

Having moved the engine of the trimmer resistor R2 to the lower (according to the diagram) position, connect the stabilizer to the LA-TR and set (according to the voltmeter) a voltage of 145 V at its output. Then, slowly moving the resistor engine up (also according to the diagram) and observing the shape on the oscilloscope screen voltage on the zener diode VD1, bring the signal amplitude to a level that is approximately 0,1 V higher than its stabilization voltage (the beginning of the appearance of a characteristic area on the oscillogram, see Fig. 3). Next, set the engine of the tuning resistor R4 to the lower (according to the diagram) position (in this case, the red LED HL3 should light up) and slowly move it up until the green LED HL2 starts flashing.

After that, an incandescent lamp with a power of 100 ... 200 W is connected to the output of the stabilizer. By smoothly increasing the voltage at the LATR output to 290 V, the HL4-HL8 LEDs check the voltage values ​​at which the autotransformer taps switch, as well as the upper limit of the input voltage at which the MK turns off the load. It is also desirable, if possible, to check the performance of the stabilizer with a long-term supply of a linear voltage of 380 V to its input (from a three-phase network).

The values ​​of the autotransformer tap switching voltages can be changed by adjusting the corresponding constants at the beginning of the program and recompiling the resulting text using the MPASM macro assembler compiler [2]. It is necessary to make other changes to the source text related to the algorithm of the program with extreme caution, clearly understanding the meaning of these changes. The possible occurrence of errors associated with such an adjustment can lead, for example, to the simultaneous switching on of a pair of triacs from VS2-VS6 (short circuit mode) or switching the load at a mains voltage of 250 V to the "+20%" tap, etc.

Literature

  1. Nikiforov I. Simplified calculation of a network transformer. - Radio, 2000, No. 10, p. 39.
  2. microchip.ru

Author: S.Koryakov, Shakhty, Rostov region

See other articles Section Microcontrollers.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Machine for thinning flowers in gardens 02.05.2024

In modern agriculture, technological progress is developing aimed at increasing the efficiency of plant care processes. The innovative Florix flower thinning machine was presented in Italy, designed to optimize the harvesting stage. This tool is equipped with mobile arms, allowing it to be easily adapted to the needs of the garden. The operator can adjust the speed of the thin wires by controlling them from the tractor cab using a joystick. This approach significantly increases the efficiency of the flower thinning process, providing the possibility of individual adjustment to the specific conditions of the garden, as well as the variety and type of fruit grown in it. After testing the Florix machine for two years on various types of fruit, the results were very encouraging. Farmers such as Filiberto Montanari, who has used a Florix machine for several years, have reported a significant reduction in the time and labor required to thin flowers. ... >>

Advanced Infrared Microscope 02.05.2024

Microscopes play an important role in scientific research, allowing scientists to delve into structures and processes invisible to the eye. However, various microscopy methods have their limitations, and among them was the limitation of resolution when using the infrared range. But the latest achievements of Japanese researchers from the University of Tokyo open up new prospects for studying the microworld. Scientists from the University of Tokyo have unveiled a new microscope that will revolutionize the capabilities of infrared microscopy. This advanced instrument allows you to see the internal structures of living bacteria with amazing clarity on the nanometer scale. Typically, mid-infrared microscopes are limited by low resolution, but the latest development from Japanese researchers overcomes these limitations. According to scientists, the developed microscope allows creating images with a resolution of up to 120 nanometers, which is 30 times higher than the resolution of traditional microscopes. ... >>

Air trap for insects 01.05.2024

Agriculture is one of the key sectors of the economy, and pest control is an integral part of this process. A team of scientists from the Indian Council of Agricultural Research-Central Potato Research Institute (ICAR-CPRI), Shimla, has come up with an innovative solution to this problem - a wind-powered insect air trap. This device addresses the shortcomings of traditional pest control methods by providing real-time insect population data. The trap is powered entirely by wind energy, making it an environmentally friendly solution that requires no power. Its unique design allows monitoring of both harmful and beneficial insects, providing a complete overview of the population in any agricultural area. “By assessing target pests at the right time, we can take necessary measures to control both pests and diseases,” says Kapil ... >>

Random news from the Archive

Biostar J3160MD motherboard 01.04.2016

Biostar has announced the J3160MD motherboard suitable for building silent desktops and home media centers.

The novelty was initially equipped with an Intel Celeron J3160 processor of the Braswell generation. The named 14-nanometer chip contains four computing cores with a clock speed of 1,6 GHz (dynamically increased to 2,24 GHz) and an Intel HD Graphics 400 graphics controller. The design power of the product is only 6 watts, so it is content with a passive cooling system.

Supports up to 16 GB of DDR3L RAM in the form of two modules of 8 GB each. There are two SATA 3.0 ports for connecting drives. There is a PCI Express 2.0 x16 slot for a discrete graphics accelerator and a pair of PCI Express 2.0 x1 slots for expansion cards.

The equipment also includes a Realtek RTL8111H gigabit network controller and a Realtek ALC662 multi-channel audio codec. On the connector bar, you can find PS / 2 jacks for keyboard and mouse, two USB 3.0 and USB 2.0 ports, DVI and D-Sub interfaces for connecting displays, as well as a network cable jack and a set of audio connectors.

The board is made in the form factor Micro ATX (226 [ 188 mm). Of the implemented proprietary technologies, the manufacturer highlights the BIO-Remote2 system. It allows you to turn your smartphone into a computer remote control. The app is supported by Android devices as well as Apple devices.

Other interesting news:

▪ Microrobot colony management technology

▪ Electric cars help reduce asthma risk

▪ Multi-standard DVD-RAM/-RW/-R recorder

▪ Vivo 2 Wireless Headset for Athletes

▪ Food from insects will create waste-free agriculture

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ site section Preamplifiers. Article selection

▪ article Knight for an hour. Popular expression

▪ What were the reasons for the collapse of Charlemagne's empire? Detailed answer

▪ article Flight operator for checking main pipelines. Job description

▪ article Drop-down boards. Encyclopedia of radio electronics and electrical engineering

▪ article Catching a pigeon with a net from the air. Focus Secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024