DIY digital ammeter. Digital ammeters and voltmeters

Ammeters are devices that are used to determine the current strength in a circuit. Digital modifications are made on the basis of comparators. They differ in measurement accuracy. It is also important to note that the devices can be installed in circuits with direct and alternating current.

Based on the type of construction, there are panel-mounted, portable, and built-in modifications. There are pulse and phase-sensitive devices according to their intended purpose. Selective models are included in a separate category. In order to understand the devices in more detail, it is important to know the structure of the ammeter.

Ammeter circuit

A typical digital ammeter circuit includes a comparator along with resistors. A microcontroller is used to convert the voltage. It is most often used with reference diodes. Stabilizers are installed only in selective modifications. To increase measurement accuracy, broadband filters are used. Phase devices are equipped with transceivers.

DIY model

Assembling a digital ammeter with your own hands is quite difficult. First of all, this will require a high-quality comparator. The sensitivity parameter must be at least 2.2 microns. It must maintain a minimum resolution of 1 mA. The microcontroller in the device is installed with reference diodes. The display system is connected to it through a filter. Next, to assemble a digital ammeter with your own hands, you need to install resistors.

Most often they are selected as a switched type. The shunt in this case should be located behind the comparator. The division factor of the device depends on the transceiver. If we talk about a simple model, then it is used of the dynamic type. Modern devices are equipped with ultra-precise analogues. A regular lithium-ion battery can serve as a source of stable current.

Microprocessor based voltmeter

Parts selection

Before making a voltmeter, experts recommend carefully studying all the options offered in various sources. The main requirement for such selection is the extreme simplicity of the circuit and the ability to measure alternating voltages with an accuracy of 0.1 Volt.

An analysis of many circuit solutions has shown that for self-manufacturing a digital voltmeter, it is most advisable to use a programmable microprocessor of the PIC16F676 type. For those who are new to the technique of reprogramming these chips, it is advisable to purchase a chip with ready-made firmware for a homemade voltmeter.

When purchasing parts, special attention should be paid to choosing a suitable indicator element on LED segments (the option of a standard pointer ammeter in this case is completely excluded). In this case, preference should be given to a device with a common cathode, since the number of circuit components in this case is noticeably reduced.

Additional Information. Conventional purchased radioelements (resistors, diodes and capacitors) can be used as discrete components.

After purchasing all the necessary parts, you should proceed to wiring the voltmeter circuit (making its printed circuit board).

Preparing the board

Before making a printed circuit board, you need to carefully study the circuit of the electronic meter, taking into account all the components on it and placing them in a place convenient for desoldering.

Electronic device circuit

Important! If you have available funds, you can order the production of such a board in a specialized workshop. The quality of its execution in this case will undoubtedly be higher.

After the board is ready, you need to “stuff” it, that is, place all the electronic components (including the microprocessor) in their places, and then solder them with low-temperature solder. Refractory compounds are not suitable in this situation, since they will require high temperatures to heat them up. Since all the elements in the assembled device are miniature, their overheating is extremely undesirable.

Power supply (PSU)

In order for the future voltmeter to function normally, it will need a separate or built-in DC power supply. This module is assembled according to the classical scheme and is designed for an output voltage of 5 Volts. As for the current component of this device, which determines its calculated power, half an ampere is quite enough to power the voltmeter.

Based on these data, we prepare ourselves (or send it to a specialized workshop for manufacturing) a printed circuit board for the power supply.

Note! It would be more rational to prepare both boards at once (for the voltmeter itself and for the power supply), without spacing these procedures out over time.

When manufactured independently, this will allow you to perform several similar operations at once, namely:

  • Cutting blanks of the required size from fiberglass sheets and cleaning them;
  • Making a photomask for each of them with its subsequent application;
  • Etching these boards in a ferric chloride solution;
  • Stuffing them with radio components;
  • Soldering of all placed components.

AC Modifications

You can make an AC ammeter (digital) yourself. Microcontrollers in the models are used with rectifiers. To increase the measurement accuracy, broadband filters are used. The shunt resistance in this case should not be less than 2 ohms. The sensitivity of resistors must be 3 microns. Stabilizers are most often installed of the expansion type. It is also important to note that you will need a triode for assembly. It must be soldered directly to the comparator. The permissible error of devices of this type fluctuates around 0.2%.

How to convert a DC voltmeter into AC voltage

The circuit shown in Figure 1 is a DC voltmeter. To make it variable or, as experts say, pulsating, it is necessary to install a rectifier in the design, with the help of which the direct voltage is converted into alternating voltage. In Figure 2, an AC voltmeter is shown schematically.

This scheme works like this:

  • when there is a positive half-wave at the left terminal, diode D1 opens, D2 in this case is closed;
  • voltage passes through the ammeter to the right terminal;
  • when the positive half-wave is at the right end, then D1 closes and no voltage passes through the ammeter.

A resistor Rd must be added to the circuit, the resistance of which is calculated in exactly the same way as the other elements. True, its calculated value is divided by a coefficient equal to 2.5-3. This is the case if a half-wave rectifier is installed in the voltmeter. If a full-wave rectifier is used, then the resistance value is divided by a coefficient: 1.25-1.5. By the way, the diagram of the latter is shown in Figure 3.

To assemble a voltmeter, the following components are required:

  • microcircuits CA31162 and KR514ID2;
  • transistors KT361 – 3 pcs.;
  • constant resistors with a power of 0.125 W, nominal: 1 kOhm - 4 pcs.; 470 Ohm – 7 pcs.; 470 kOhm – 1 pc.; 4.7 kOhm – 1 pc.; 820 kOhm – 1 pc.;
  • variable resistors: 5.1 kOhm (adjustment of the “limit” mode) and 47 kOhm (adjustment of the “zero setting”)
  • capacitors: 0.22 mF – 2 pcs.; 6800 pF; electrolytic at 100 mF * 150 V;
  • AL324B indicators – 3 pcs.

Parts can be taken used, with leads of sufficient length for successful installation. Key transistors are selected with the same transition resistances or with similar values.

Pulse measuring instruments

Pulse modifications are distinguished by the presence of counters. Modern models are produced on the basis of three-digit devices. Resistors are used only of the orthogonal type. As a rule, their division coefficient is 0.8. The permissible error, in turn, is 0.2%. The disadvantages of the devices include sensitivity to environmental humidity. They should also not be used at sub-zero temperatures. Assembling the modification yourself is problematic. Transceivers in the models are used only of the dynamic type.

Details

Perhaps the most difficult to obtain are the CA3162E microcircuits. Of the analogues, I know only NTE2054. There may be other analogues that I am not aware of.

The rest is much easier. As already said, the output circuit can be made using any decoder and corresponding indicators. For example, if the indicators have a common cathode, then you need to replace KR514ID2 with KR514ID1 (the pinout is the same), and drag the transistors VT1-VT3 down, connecting their collectors to the power supply negative, and the emitters to the common cathodes of the indicators. You can use CMOS logic decoders by connecting their inputs to the power supply positive using resistors.

Phase-sensitive modification device

Phase-sensitive models are sold at 10 and 12 V. The permissible error parameter for the models fluctuates around 0.2%. Counters in devices are used only of the two-digit type. Microcontrollers are used with rectifiers. Ammeters of this type are not afraid of high humidity. Some modifications have amplifiers. If you are assembling a device, you will need switched resistors. A regular lithium-ion battery can be a source of stable current. A diode is not needed in this case.

Before installing the microcontroller, it is important to solder the filter. A converter for lithium-ion will need a variable type. Its sensitivity indicator is at the level of 4.5 microns. If there is a sudden drop in voltage in the circuit, it is necessary to check the resistors. The division coefficient in this case depends on the throughput of the comparator. The minimum pressure of devices of this type does not exceed 45 kPa. The current conversion process itself takes about 230 ms. The speed of the clock signal depends on the quality of the counter.

Chip CA3162E

BY42A can also be found in two board versions, but the color marking of the wires remains the same. To reduce the influence of ambient temperature on measurements, the additional resistor is made of a material with a low temperature coefficient of resistance. The connection can be made through a special socket connector, or using soldering. They contain a converter of the input signal into the angle of rotation of the arrow, showing on the scale the value of the measured voltage.


To also reduce the temperature factor during measurements, an additional resistor made of the same kind of material is connected in series with the ammeter coil. Connection Using a voltmeter, you can measure the current voltage in the power supply network.


It is clear that a couple of amperes can be easily measured with a regular cheap multimeter, but what about 10, 15, 20 or more amperes? The scale readings are also multiplied by n. Homemade automobile voltmeter on microcircuits. If the connection is incorrect, the device display will show zero values.


Receiving and transmitting alternating current is much easier than direct current: there is less energy loss. With the help of transformers, we can easily change the alternating current voltage.


CAE microcircuit for digital voltmeter and ammeter There are other microcircuits of similar action. Instrument transformers are depicted in the diagrams as ordinary transformers. A nuance when connecting a Chinese voltmeter and ammeter

Selective device diagram

The selective digital DC ammeter is manufactured on the basis of high-capacity comparators. The acceptable error of the models is 0.3%. The devices operate on the principle of single-stage integration. Counters are used only of the two-digit type. Stable current sources are installed behind the comparator.

Resistors are used of the switched type. To assemble the model yourself, you will need two transceivers. Filters in this case can significantly increase the accuracy of measurements. The minimum pressure of the devices is around 23 kPa. A sharp drop in voltage is observed quite rarely. The shunt resistance, as a rule, does not exceed 2 ohms. The current measuring frequency depends on the operation of the comparator.

Sequence of placement and installation of the ammeter

The input current signal (no more than 1 A) is supplied from a stabilized power supply through a shunt resistor, the permissible voltage across which should not exceed 40...50 V. Then, passing through an operational amplifier, the signal is sent to the LEDs. Since the value of the current changes during the passage of the signal, the height of the column will change accordingly. By controlling the load current, you can adjust the height of the diagram, obtaining results with varying degrees of accuracy .

Mounting the board with SMD components, at the user’s request, can be placed either horizontally or vertically. Before starting calibration, the viewing window must be covered with dark glass (a filter with a magnification of 6...10x of a regular welding helmet is suitable).

Calibration of a digital ammeter consists of selecting the minimum current load value at which the LED will light. The setting is varied experimentally, for which a resistor with a small (up to 100 mOhm) resistance is provided in the circuit. The error in readings of such an ammeter usually does not exceed several percent.

Did you know that you can convert an old voltmeter into an ammeter? How to do this - watch the video:

Universal measuring instruments

Universal measuring instruments are more suitable for household use. Comparators in devices are often installed with low sensitivity. Thus, the permissible error is around 0.5%. The counters are of three-digit type. Resistors are used on the basis of capacitors. Triodes are found in both phase and pulse types.

The maximum resolution of the devices does not exceed 12 mA. The shunt resistance, as a rule, lies in the region of 3 ohms. The permissible humidity for devices is 7%. The maximum pressure in this case depends on the installed protection system.

Galvanometers (analog meters)

Analog meters have needles that rotate to mark numbers on a scale. This distinguishes them from digital devices that display digital symbols directly on the screen. At the center of most analog instruments is the galvanometer (G). Current passes through it and causes proportional movement (needle deflection).

A galvanometer is characterized by resistance and current sensitivity. The latter is the current that causes a significant deflection of the galvanometer needle (maximum current). For example, a galvanometer whose current sensitivity is 50 μA reaches a maximum deflection of 50 μA.

If such a device has a resistance of 20 ohms, then only the voltage V = IR = (50 µA) (25 ohms) = 1.25 mV creates a full-scale reading. By combining resistors with it, you can consider it as a voltmeter or ammeter.

Built-in modifications

The digital built-in ammeter is produced on the basis of reference comparators. The throughput of the models is quite high, and the permissible error is about 0.2%. The minimum resolution of the devices does not exceed 2 mA. Stabilizers are used of both expansion and pulse types. Resistors are set to high sensitivity. Microcontrollers are often used without rectifiers. On average, the current conversion process does not exceed 140 ms.

Half-wave synchronous rectifier for ammeter

Figure 1 shows a diagram of a half-wave synchronous rectifier for an ammeter with a linearized scale. During the positive half-cycle of the alternating voltage (plus at the upper ends of windings II and III), diodes VD1 and VD2 open, connecting the microammeter to the shunt Rsh. During the negative half-cycle the diodes are closed.

In the open state, the diodes have a low differential resistance, and the nonlinearity of this resistance is small, so the scale is almost linear.

Rice. 1. Circuit diagram of an ammeter with a transformer.

When using microamp meters with a scale of 50-200 µA with a maximum voltage drop across the frame of no more than 150 mV, the minimum voltage on winding III can be 1.5. 2 V for germanium and 2.2.5 V for silicon diodes (at lower voltages, its instability noticeably affects the ammeter readings).

The maximum voltage is limited by the maximum permissible reverse voltage of the diodes used. The minimum current of the diodes should be 10.. 20 times the maximum current of the microammeter. You can make an additional winding yourself by winding several turns of thin insulated wire onto the transformer coil, if its design allows this.

Resistors R3 and R4 serve to adjust the zero of the ammeter, the shift of which occurs due to the current of the diode VD2 flowing through the shunt and the spread of the diode parameters.

The in-phase connection of windings II and III is important at a relatively low voltage of winding III (less than 2 V), since when these windings are switched out of phase (in this case, the polarity of the microammeter connection must be changed), scale non-linearity appears in the device (the division value at the end of the scale gradually increases) , which, by the way, can sometimes be useful. However, when the voltage on winding III is higher than 4 ..5 V, this nonlinearity is practically unnoticeable and you can ignore the turn-on phase of the windings

To protect the microammeter from accidental overloads, it is useful to connect the D220 KD522 or KD521 silicon diode in parallel to its terminals in the forward direction, after making sure that it does not affect the readings of the microammeter at the end of the scale.

DMK models

Digital ammeters and voltmeters of this company are in great demand. The range of this company includes many stationary models. If we consider voltmeters, they can withstand a maximum pressure of 35 kPa. In this case, transistors are used of the toroidal type.

Microcontrollers are usually installed with converters. Devices of this type are ideal for laboratory research. Digital ammeters and voltmeters of this company are manufactured with protected housings.

Torekh device

The specified ammeter (digital) is manufactured with increased current conductivity. The device can withstand a maximum pressure of 80 kPa. The minimum permissible temperature of the ammeter is -10 degrees. This measuring device is not afraid of high humidity. It is recommended to install it near a power source. The division factor is only 0.8. The maximum pressure the ammeter (digital) can withstand is 12 kPa. The current consumption of the device is about 0.6 A. The triode is of the phase type. This modification is suitable for household use.

How to determine the price of an ammeter division

The variety of instruments creates natural difficulties during measurements. The following example will help you understand the methodology for correctly determining values ​​on a dial indicator. In any case, start with the letter designation on the dial:

  • “A” is amperes, no conversion needed;
  • “mA” – milliamps, the final value is calculated by multiplying by 0.001.

This device measures current up to 4 amperes inclusive. Translation of values ​​is not needed, because there is o. To find out the price of one division, subtract the smaller value of adjacent digits from the larger one. Next, divide by the number of empty spaces between risks.

Reference. “RISK – a line (stroke) marked ... on the scale of a measuring device.” Big Polytechnic Encyclopedia edited by Ryazantsev, vol. 2011

In the given example:

In the description of the device you can find the manufacturer's permissible errors. This value is usually indicated as a percentage.

Lovat device

The specified ammeter (digital) is made on the basis of a two-digit counter. The current conductivity of the model is only 2.2 microns. However, it is important to note the high sensitivity of the comparator. The display system is simple and the device is very comfortable to use. The resistors in this ammeter (digital) are of the switched type.

It is also important to note that they can withstand heavy loads. The shunt resistance in this case does not exceed 3 ohms. The current conversion process occurs quite quickly. A sharp drop in voltage can only be associated with a violation of the temperature regime of the device. The permissible humidity of the specified ammeter is as much as 70%. In turn, the maximum resolution is 10 mA.

Voltmeter and ammeter for the power supply from the M830B multimeter

Voltmeter and ammeter for power supply from multimeter

The idea of ​​​​remaking a multimeter to monitor voltage and current arose during the manufacture of the power supply. To indicate voltage, it was supposed to use a dial indicator. I already took it apart and drew a new scale, but I thought about it and decided that a digital indicator would look much better. Once in the magazine “Radio” there was an article on redesigning a computer power supply and there an ADC chip KR572PV2A was used to control the output voltage and current, and LED digital indicators were used to display information. Since the cost of the microcircuit, indicators and parts is comparable to the price of a multimeter, it was decided to remake the multimeter to monitor the voltage and current in the power supply.

The main purpose of the modification was to reduce the size of the board with the indicator, i.e. I just had to cut off part of the board. For the conversion, the simplest and cheapest Chinese multimeter M830B was purchased. The M830B multimeter circuit diagram can be downloaded from our file archive. The voltage measurement limit of our design will be 200 V, and the current limit will be 10 A. To select the “Voltage” - “Current” measurement mode, switch S1 with two groups of contacts is used. The diagram shows the position of the switch in voltage measurement mode.

First you need to disassemble the multimeter and remove the board. You can see the view of the board from the parts side in the photo.

Our design will be placed on two boards. One board with an indicator, another board with parts of the input part of the multimeter and an additional 9-volt stabilizer. The diagram of the second board is shown in the picture. Soldered resistors from the multimeter board are used as divider resistors. Their designations in the diagram correspond to the designations on the board of the M830B multimeter.

The diagram also provides additional explanations. The letters in the circles correspond to the connection points of one board to another. To power the structure, a low-power voltage stabilizer is used, which is connected to a separate winding of the transformer.

Let's actually get started.

Solder R1 8, R9, R6, R5. We save the cuts and edges R 6 and R5 for the input part of our structure.

We cut off the upper contact R10 from the circuit and cut out part of the track (marked with crosses in the photo). Solder R10.

Solder R12 and R11.

R12 and R11 are connected in series. And solder one end to the top contact of R10, and the other to the track cut off from R10. Unsolder R20 and solder it in place of R9.

We desolder R16 and drill new holes for it (see photo)

Turn the board over with the indicator facing you.

Contact R9 (now R20) closest to the indicator is cut off from the circuit (marked with a cross). We connect the contacts R9 (now R20) and R19 farthest from the indicator together (on the indicator side), indicated in the photo by a red jumper.

We connect the upper contact R10 (there are now R11 and R12) to the lower contact R13, indicated in the photo with a red jumper.

We delete some of the tracks marked with crosses. And we solder a jumper to the contact R9 closest to the indicator (now there is R20), instead of the remote track.

We remove the tracks marked with a cross and prepare the contact patches for wiring to the second board, indicated by arrows in the photo.

Solder the jumper.

We solder the contact wires from the second board, observing the correspondence of the letters (aA, bB, etc.)

In this photo, the design is built into the power supply for which it was created. When the load is connected, by pressing the “Voltage-Current” button, the value of the flowing current is displayed on the indicator.

Model DigiTOP

This digital DC volt-amp meter comes with reference diodes. It has a two-digit counter. The conductivity of the comparator is at around 3.5 microns. The microcontroller is used with a rectifier. Its current sensitivity is quite high. The power source is a regular battery.

Resistors are used in a switched type device. A stabilizer is not provided in this case. There is only one triode installed. The current conversion itself occurs quite quickly. This device is suitable for home use. Filters are provided to increase measurement accuracy.

If we talk about the parameters of a voltmeter-ammeter, it is important to note that the operating voltage is at the level of 12 V. The current consumption in this case is 0.5 A. The minimum resolution of the presented device is 1 mA. The shunt resistance is located at 2 ohms.

The division coefficient of the voltmeter-ammeter is only 0.7. The maximum resolution of this model is 15 mA. The current conversion process itself takes no more than 340 ms. The permissible error of the specified device is at the level of 0.1%. The system can withstand a minimum pressure of 12 kPa.

Ammeter for car charger on ATtiny13

Once upon a time, the author of these lines came across a very interesting device, born in the USSR, back in 1976 - it was simply given away as unnecessary.


This device was called ADZ-101U2, and it was a typical example of Soviet constructivism: a heavy twenty-kilogram “suitcase”, with a carrying handle at the top and a powerful single-phase transformer inside. But the most interesting thing is that this “suitcase” completely lacked a back panel - and not at all because the device managed to “sow” it, no. And the point here was that both of its panels were... front!

On one side, the “suitcase” was a welding machine, and on the other, a charger for car batteries. And if as a “welder” he didn’t evoke any special emotions, that’s okay, since it’s only 50A alternating current; then the “charger” is definitely a necessary thing in the household. Tests of the device confirmed its full combat capability (even welding worked!), but, of course, it was not without its drawbacks. The essence of the problem was that the standard ammeter of the “charger” disappeared in an unknown direction, and the previous owner of the device found a completely “equivalent” replacement for it - a car ammeter, twisted from some kind of military truck, and having a very “informative” scale of ±30 A!

It is clear that monitoring the battery charge (and the charging current is only 3-6 A!) using such a device is, to put it mildly, problematic - it’s as if it doesn’t exist at all... Therefore, it was decided to replace the “truck display meter” with some kind a more or less adequate device, with a clear scale of 0-10 A. The ideal candidate for this role seemed to be a pointer panel ammeter with a built-in shunt - one of those that had previously been used in almost all Soviet-made “chargers”, and in many other places.

However, the very first walk through electrical stores and “breakdowns” brought disappointment: it turns out that nothing even remotely resembling the desired device has been on sale for a long time... And so, at that time the author was not yet familiar with the endless expanses of Chinese miracle sites , then the hands again reached for the soldering iron, as a result of which a device was developed, the diagram of which is shown in Fig. 1, and the characteristics are in Table 1:

To display the measurement results in this ammeter, it was decided to use a pair of 7-segment LED indicators. Such indicators, despite being somewhat archaic compared to newfangled LCD modules of the 16xx type, also have a number of undeniable advantages: they are much more reliable and durable; do not deteriorate and do not become cloudy from contact with petroleum products (and oily hands in the garage are a common thing, the numbers on LED indicators are brighter and much more “readable” - especially from a distance; and besides, LEDs are not afraid of any cold in the garage - unlike An LCD that simply “goes blind” in the cold.

Well, the last argument in favor of the LED matrix - in the context of this development - was the fact that the long 1602 simply did not fit into the standard hole for the ammeter (round and very small!) on the charger housing. Having decided on the type of indicator, another question arose - which microcontroller to use as the basis for this device. There was no doubt that this circuit needed to be built specifically on an MK - making an ammeter on a “CMOS scattering” could damage your mind.

At first glance, the most obvious solution is the “workhorse” ATtiny2313 - this MK has a fairly developed architecture and a number of input/output lines quite suitable for connecting an LED matrix. However, everything here turned out to be not so simple - after all, to measure current, the MK must necessarily include an analog-to-digital converter, but for some reason Atmel engineers did not equip the “2313” with this function... The Meda family is another matter: these chips necessarily have an ADC module “on board”.

But, on the other hand, even ATMedav - as the simplest representative of the “older” family - has much greater functionality than is required by the construction of a simple ammeter. And this is no longer the best solution from the point of view of the classical approach to design!

The “classical approach to design” here means the so-called “principle of the necessary minimum” (the author of these lines is an ardent supporter of which, in defiance of the newfangled “Arduins”), according to which any system should be designed using the minimum possible amount of resources; and the final result should contain as few unused elements as possible.

Therefore, in accordance with this principle - a simple device - a simple microcontroller, and nothing else! True, not all simple MKs are suitable for the task. Take, for example, ATtinyl3 - it has an ADC, it is simple and inexpensive; but it’s just that it doesn’t have enough input-output lines – for connecting a matrix of two “seven-segment units”... Although, if you use your imagination a little, this problem can be completely solvable – with the help of a penny counter K176IE4 and a simple algorithm that controls this counter.

In addition, this approach even has positive aspects - firstly, there is no need to “hang” a current-limiting resistor on each segment of the indicator (current generators are already available in the output stages of the meter); and secondly, in this circuit you can use an indicator with both a common cathode and a common anode - to switch to the “common anode” you need to change the connection of transistors VT1 and VT2, pin. 6 DD2 is connected to the +9V line through a 1 kOhm resistor, and the left pin of R3 is connected to ground. In order to control the counter using an MK, you need to use only two lines: one for the counting signal (C), and the other for the reset signal (R).

Moreover, during testing of the device, it turned out that the K176IE4 CMOS chip, being connected directly to the MK lines, works quite reliably with its TTL levels - without any additional coordination. And two more MK lines control keys VT1-VT2, creating a dynamic indication. A fragment of the source code, where the procedure for controlling the DD2 counter is implemented, is shown in the listing: you can light one or another digit of the indicator.

By the way, thanks to the K176IE4 counter, you can connect a 7x4 indicator matrix to any MK, using only 6 I/O lines (two for controlling the counter, and four more for dynamic switching of bits). And if you add another counter to the K176IE4 as a “partner” - the ten-day counter K176IE8 - in order to use it to “scan” the discharges; then it will be possible to connect an indicator matrix of up to 10 acquaintances to the MK, allocating for this only 5 input-output lines (two for controlling the K176IE8; two for the K176IE4; and one more for extinguishing the indicator at the time of counting the K176IE4)!

In such a case, the procedure is written in the low-level language AVR-Assembler; however, it can easily be translated into any high-level language. In the Temp register, the procedure receives a number that must be sent to the K176IE4 counter to be displayed on the indicator; line 1 of port B of the microcontroller is connected to the counter reset input (R), and line 2 is connected to its counter input (C).

To avoid flickering of numbers at the moment of switching the counter, before calling this procedure, it is necessary to extinguish both bits by closing transistors VT1 and VT2 by applying log.O to lines 0 and 4 of ports B of the MK; Well, after the procedure has worked, the dynamic indication algorithm will be reduced to controlling the K176IE8 counter, which is in many ways similar to the algorithm for transmitting a digit to the K176IE4 counter, given in the listing above.

The disadvantages of such a connection of the indicator matrix - in addition to the use of an “extra” microcircuit - include the need to introduce additional +9 V power supply into the circuit, because attempts to power CMOS counters from +5 V, alas, were unsuccessful... As an indicator in this device, we can use almost any dual “seven-segment” with common cathodes, designed to work in circuits with dynamic indication. It is also possible to use a four-bit matrix, using only two of the four available bits.

In the author’s version, the indicator “board” was assembled on a section of a “sieve” breadboard, from two “ancient” single-digit ALS321... However, in the process of working on the ammeter circuit, a small problem arose - with connecting the decimal point: after all, it should light up in the highest category, and not to burn - in the junior category. And if you do everything “wisely”, then it would be nice to allocate – for the dynamic control of this very comma – another MK leg (since the K176IE4 does not provide any means for controlling commas) – in order to “hang” the indicator output on it , responsible for commas.

But, since all the input-output lines of the MK were already occupied, we had to deal with this problem in a far from elegant way: it was decided to leave both commas constantly lit, powering the corresponding output of the indicator “matrix” from the +9V line through the current-limiting resistor R3 (by selecting its resistance, you can level the brightness of the glow with a comma relative to the other segments); and simply cover up the extra comma in the low order (far right) with a drop of black nitro paint. From a technical point of view, such a solution can hardly be called ideal; but a comma “made up” in this way does not catch the eye at all...

Two parallel connected resistors R1 and R2, each with a power of 5 W, are used as a current sensor. Instead of a pair of R1 and R2, it is quite possible to install one resistor with a resistance of 0.05 Ohm - in this case, its power should be at least 7 W. Moreover, the microcontroller firmware provides the ability to select the resistance of the measuring shunt - both a 0.05-ohm and a 0.1-ohm current sensor can be used in this circuit.

In order to set the microcontroller the resistance of the shunt used in a particular case, it is necessary to write a certain value into the EEPROM memory cell located at address 0x00 - for a resistance of 0.1 Ohm this can be any number less than 128 (in this case, the MK will divide the result measurements by 2); and when using a shunt with a resistance of 0.05 Ohm, a number greater than 128 should be written into this cell, accordingly.

And if you plan to operate the device with the 0.05-ohm shunt shown in the diagram, then you don’t have to worry about writing the specified cell at all, because a new (or “erased to zero”) MK will have the number 255 (OxFF) in all memory cells. The device can be powered either from a separate source - with a voltage of at least 12 V, or from the power transformer of the charger itself. If the power is supplied from the charger transformer, then it is advisable to use a separate winding for this, which is in no way connected with the charging circuit; however, it is possible to power the ammeter from one of the charging windings.

In this case, the supply voltage must be taken before the rectifier bridge of the “charger” (i.e., directly from the winding), and a 75 Ohm/1 W resistor must be connected to the break of both ammeter power wires. Resistors are necessary to protect the “negative” diodes of the VD1-4 bridge from the passage of part of the charging current through them.

The fact is that if you connect the device to the charging winding without installing these resistors, then, taking into account the common “ground” of the VD1-4 bridge and the diode bridge of the charger, about half of the battery charging current will return to the winding not through the powerful diodes of the charger rectifier, and through the “negative” arm of the VD1-4 bridge, causing strong heating of low-power 1N4007.

Installing these resistors will limit the supply current of the device and protect the diode bridge VD1-4 from the flow of charging current, which now, almost completely, will flow along the “correct” circuit - through the powerful diodes of the charger rectifier.

The printed circuit board for this ammeter was developed for specific seats in the housing of a specific charger; its drawing is shown in Fig. 2. The indicator matrix is ​​installed separately - on a small plate (a 30×40 piece of “breadboard”), which is attached to the main board with M2.5 bolts through spacer bushings, on the installation side; and connects to it with a 10-wire cable. Another part of the resulting “sandwich” is a decorative front panel made of plexiglass, painted on the reverse side with nitro paint from a can (only a small rectangle should remain unpainted - the “window” for the indicator).

The front panel is also attached to the main board from the installation side (with M3 bolts with spacer bushings - they also attach the device to the charger housing). The printed traces of the high-current circuit going to resistors R1 and R2 should be made as wide as possible, and the leads of the resistors should be soldered to them for the entire length, at the same time reinforcing the installation with a thick layer of solder. It is advisable to use two M3 bolts as leads for connecting the device to the charger, soldering their heads to the board and securing them on the other side with nuts.

When writing “firmware” to the MK, it must be configured to operate at a frequency of 1.2 MHz. from the internal clock generator. To do this, the clock frequency should be selected equal to 9.6 MHz, and the internal clock divider should be turned on by 8. To increase operational reliability, it is also advisable to activate the internal power supervisor (BOD module), setting it to reset the MC when the supply voltage drops below 2.7 V. All settings are made by writing the corresponding values ​​to the configuration Fuse cells: SUT1=1, SUT0=0, CKDIV8=0, BODLEVEL1 =0. BODLEVELO= 1. WDTON=1. The remaining “fuses” can be left as default.

The software for this article can be downloaded from the magazine’s website: radiocon.nethouse.ru in the “HEX files” section.

Firmware proshivka-ampermetr-10a-attiny13

Rating
( 1 rating, average 5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]