ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING Module for measuring and protecting the power supply. Encyclopedia of radio electronics and electrical engineering Encyclopedia of radio electronics and electrical engineering / Power Supplies The proposed module can be used in conjunction with laboratory power supplies to protect their load from voltage and current exceeding the established limits. Descriptions of such devices have been repeatedly published, an example is the article "Advanced digital protection device with a measurement function" ("Radio", 2007, No. 7, pp. 26-28, author N. Zaets), which describes a device of this purpose on a microcontroller PIC16F873 with two-digit seven-element LED indicator. In contrast, the proposed module is based on an ATmega8535L-8PU microcontroller and an LCD containing four lines of 16 characters each. Initially, I intended to use the differential input of the ADC of the microcontroller with a built-in preamplifier to measure the current. However, the test revealed the instability of such a measurement. The use of an op-amp in the current measurement unit was also found to be inappropriate for the same reason. A compromise option was chosen for measuring the current with two ADC channels with a relatively high resistance of the current sensor resistors. The first channel, using a current sensor with a resistance of 0,5 Ohm, measures current up to 1 A with a resolution of 10 mA. The second channel is capable of measuring current up to 5 A with a resolution of 0,1 A using a current sensor with a resistance of 0,05 Ohm. The device measures voltage with a resolution of 0,1 V. The protection response time mainly depends on the ADC clock frequency (125 kHz). Calculated and confirmed with the help of an oscilloscope, the duration of the analog-to-digital conversion is 110 µs. The microcontroller spends 220 μs plus the total duration of the execution of switching commands to measure both voltage and current. With a microcontroller clock frequency of 8 MHz, they are completed in 3,7 µs. The procedures for displaying information on the indicator can contribute to increasing the protection response time. The program accesses it every 0,28 seconds (specified by the TimeDisp constant). It takes 4 ms to output information (measured by an oscilloscope). The time is counted by two counters, the first of them is incremented by the program in each measurement cycle, and the second one counts overflows of the first one. When the content of the second counter reaches the value of the above constant, information is displayed on the indicator. The probability that an emergency event will occur during the service time of the indicator decreases with an increase in the period of calls to the indicator. If a minimum response delay is required, the program should be prohibited from accessing the indicator. Such a mode is provided. The device is controlled using seven buttons, a switch and an encoder with a button. The use of an encoder simplifies the input of information into the microcontroller. The indicator for 64 familiarity significantly increases the possibility of informing the user about the status of the device. The relatively large volume of the program is due to the presence in it of numerous message texts displayed on the indicator. In addition to displaying visual information, there is also an audible signaling of protection operation. Two versions of the program are attached to the article. The first one (source text Modul-P&M4.asm, boot file Modul-P&M4.hex) does not provide for saving the set values of the protection operation thresholds in the non-volatile memory of the microcontroller. After the power is turned on or the microcontroller is forced to reset, this program will write the maximum allowable values to the comparison registers. In the second variant of the program (source code Modul-P&M-EP.asm, boot file Modul-P&M-EP.hex), the set threshold values are stored in EEPROM when the power is turned off. The next time you turn it on, the program restores them. The module diagram is shown in fig. 1. The first current measurement channel is formed by resistors-current sensors R12, R14, trimmer resistor R16 and asymmetric input of ADC ADC1, the second current measurement channel is resistors R11, R13, trimmer resistor R15 and asymmetric input of ADC ADC3. The load of the first channel is connected between the positive terminal of the protected source and the "-out," terminal, and the load of the second channel is connected between the same source terminal and the "-out.2" terminal. Part of the source voltage from the "+U" terminal through a voltage divider formed by a constant resistor R18 and a trimmer resistor R17 is fed for measurement to the unbalanced input of the ADC4 ADC.
Trimmer resistors R15-R17 are used when setting up to set the voltage and current readings on the HG1 indicator using standard instruments. Each of the transistor switches, which, if necessary, disconnect the load and the controlled source, consists of a powerful field-effect transistor and a bipolar transistor that controls it. Field-effect transistors with a threshold voltage of 2 ... 5 V can be used here. The short-term flash of the HL1 LED when the power is turned on (setting to the initial state) is caused by the fact that after that the microcontroller outputs are in a high-impedance state for some time. As a result, a current pulse flows through the plus power circuit - HL1 LED - resistors R2, R7 - emitter junction VT4 - diode VD3 - common wire (for channel 1). For a similar reason, the HL2 LED also flashes. When the module is working, the corresponding LED lights up simultaneously with the channel being turned on: channel 1 - HL1, channel 2 - HL2. Encoder S1 is used to set the thresholds for current and voltage protection. Sound signalization of protection operation by voltage or current is provided. For this, a node from an amplifier based on a VT5 transistor and an electromagnetic sound emitter HA1 serves. LCD HG1 works with an eight-bit data bus formed by the lines of port B of the microcontroller. On its screen, the program displays information about the measured values of voltage and current, the modes of operation of the device. After the power is turned on or the microcontroller is reset, the module goes into standby mode. Both channels are closed, voltage and current are not measured. Connect the regulated voltage source to the terminals "+U" and "-izh", and the load - to the terminals "+U" and "-out1". Having selected the first channel by pressing the SB3 button, use trimmer resistors R16 and R17 to match the readings of the module and the reference ammeter and voltmeter. By pressing the SB2 button, return to standby mode. Then connect the load to channel 2 (terminals "+U" and "-out.2"), select the second channel by pressing the SB4 button and adjust the trimmer resistor R15 to match the readings of the LCD and the reference ammeter. By pressing the encoder button, select it to set the voltage and current protection thresholds. Set the desired current threshold in one of the channels by rotating the encoder and pressing the SB6 (channel 1) or SB7 (channel 2) button write this value to the microcontroller comparison register. The program prohibits setting the protection threshold above 1 A in channel 1, and when you try to do this, it displays a corresponding warning on the LCD. Pressing the SB5 button writes the overvoltage protection threshold to the comparison register. After recording all the thresholds, by pressing the SB2 button, return the module to the standby mode. Check the operation of the protection by exceeding the set thresholds for voltage and current. When it is triggered, a sound signal will be given, and information about the event will be displayed on the LCD. At the same time, the LED of the channel in which the triggering occurred will go out. After the protection is triggered, two options for further actions are possible: by pressing the SB2 button, return to the standby mode or by pressing the encoder button, enter the threshold setting mode. In the second case, the current values from the comparison registers will be copied to the registers used in the encoder service routine, which will speed up the installation of new values. In the operating mode of the module, by pressing the buttons SB5-SB7, you can write to the comparison registers the current values of the voltage or current of the switched on channel, increased by two units of the least significant digit. Enable high-speed protection switch SA1, pre-set the required values of voltage, current and thresholds. The relevant information is displayed on the LCD. The printed circuit board of the module is shown in fig. 2, the arrangement of elements on it - in fig. 3. All pads for connecting buttons, encoder, LEDs, LCD and power supply are located with a pitch of 2,54 mm at the edges of the board. If desired, you can connect external components and power through the male multi-pin connectors. Due to the large (up to 220 mA) current consumption, the indicator backlight is powered directly from the power supply through the SA2 switch. It is better to place the contrast adjustment resistor R20 on one of the case walls. The sections of the printed conductors, through which the load current of the second channel flows, must be strengthened by soldering wires with a diameter of 1 mm over them.
There is enough space on the board to install, if necessary, heat sinks for transistors VT1 and VT2. The ATmega8535L-8PU microcontroller can be replaced with an ATmega8535-16PU or one of the same family with PI indices, and the DV-16400S1F-BLY-H/R LCD can be replaced with a WH-1604A-YGH-CT or another Russified four-line with a controller compatible with KS0066U. Instead of the HC0905F electromagnetic sound emitter, the HCM1212A will do. The GS1A diodes (VD2 and VD3) indicated in the diagram are analogues of the 1N4001 diodes in the surface mount version. Trimmer resistors R15-R17 - multi-turn imported 3266W with a resistance of 100 to 500 ohms (R15, R16) and at least 500 ohms (R17). It is possible to replace tuning resistors with dividers from two fixed resistors, selected during commissioning. Resistors R12, R14 - MOH-0,5, which can be replaced with imported CF-50 or CF-100. Resistors R11, R13 - SQP with a power of 3 watts. The current limit of 5A is caused by these resistors heating up too much at higher current. By replacing them with more powerful ones, such as wire-wound KNP-500 or KNP-600, it is possible to measure currents up to 9,9 A without changing the program. To power the module, the author used a transformer power supply from the video player. Voltage + 12 V is removed from the input of the integral voltage regulator +5 V. The module is assembled in a case from a 300 W computer power supply unit. All the old contents of the case have been removed, the back wall has been cut out. Its remains form a frame to which a new plastic front panel of the module is attached with M3 screws. Its view from this panel is shown in Fig. 4.
The microcontroller program was created in the AVR Studio 4 development environment. The configuration of the ATmega8535L microcontroller to work with an internal RC generator at a frequency of 8 MHz must correspond to the table. Table
I use an adjustable power supply made in the 80s in my work, and there are cases of overheating of the P210 regulating transistor, followed by an increase in the output voltage. This also happened when working together with the described protection module. The module worked as expected, turned off the voltage, gave sound and light signals, displayed the relevant information on the LCD. The microcontroller programs can be downloaded from ftp://ftp.radio.ru/pub/2016/10/modul.zip. Author: N. Salimov See other articles Section Power Supplies. Read and write useful comments on this article. Latest news of science and technology, new electronics: Machine for thinning flowers in gardens
02.05.2024 Advanced Infrared Microscope
02.05.2024 Air trap for insects
01.05.2024
Other interesting news: ▪ Intelligence is more important than vision ▪ Successful control of hot qubits ▪ Efficient hemp supercapacitors ▪ Yogurts are good for heart and vascular health News feed of science and technology, new electronics
Interesting materials of the Free Technical Library: ▪ site section Tone and volume controls. Article selection ▪ article A scammer sits on a scammer and drives a scammer. Popular expression ▪ article Who first said: Whoever enters us with a sword will die by the sword? Detailed answer ▪ article Master of the steam power section (boiler room). Job description ▪ article FET Distortion Effect Devices. Encyclopedia of radio electronics and electrical engineering ▪ article Coin and coin box for manipulation. Focus Secret
Leave your comment on this article: Comments on the article: Jury Is it possible to get the firmware for the LCD in English. I can not find or buy with Russian. All languages of this page Home page | Library | Articles | Website map | Site Reviews www.diagram.com.ua |