Pulse counters electronic 4-digit circuit. We use the calculator as a pulse counter for different devices. Description of operation of the CD4026 counter

Operating principle

As an initial state, a zero level was adopted at all trigger outputs (Q 1 - Q 3), i.e., the digital code 000. In this case, the highest bit is the output Q 3 . To transfer all flip-flops to the zero state, the inputs of the R flip-flops are combined and the required voltage level is applied to them (i.e., a pulse that resets the flip-flops). This is essentially a reset. Clock pulses arrive at input C, which increase the digital code by one, i.e., after the arrival of the first pulse, the first trigger switches to state 1 (code 001), after the arrival of the second pulse, the second trigger switches to state 1, and the first to state 0 (code 010), then the third, etc. As a result, such a device can count up to 7 (code 111), since 2 3 – 1 = 7. When all the outputs of the triggers are set to ones, they say that the counter is overflowed. After the arrival of the next (ninth) pulse, the counter will reset to zero and everything will start from the beginning. In the graphs, changes in trigger states occur with a certain delay t h. At the third digit the delay is already tripled. The delay that increases with the number of bits is a disadvantage of counters with serial transfer, which, despite their simplicity, limits their use in devices with a small number of bits.

Classification of meters

Counters are devices for counting the number of pulses (commands) received at their input, storing and storing the counting result, and issuing this result. The main parameter of the counter is the counting module (capacity) Kc. This value is equal to the number of stable states of the counter. After the arrival of the Kc pulses, the counter returns to its original state. For binary counters Kс = 2 m, where m is the number of counter bits.

In addition to Kc, important characteristics of the meter are the maximum counting frequency fmax and the settling time tset, which characterize the speed of the meter.

Tst is the duration of the transition process of switching the counter to a new state: tset = mttr, where m is the number of digits, and ttr is the trigger switching time.

Fmax is the maximum frequency of input pulses at which pulse loss does not occur.

By type of operation:

– Summing;

– Subtractive;

– Reversible.

In a summing counter, the arrival of each input pulse increases the counting result by one, in a subtractive counter it decreases by one; In reversing counters, both summation and subtraction can occur.

By structural organization:

– consistent;

– parallel;

– series-parallel.

In a serial counter, the input pulse is supplied only to the input of the first digit; the output pulse of the preceding digit is supplied to the inputs of each subsequent digit.

In a parallel counter, with the arrival of the next counting pulse, switching of triggers upon transition to a new state occurs simultaneously.

The series-parallel circuit includes both of the previous options.

In order of state changes:

– with a natural order of counting;

– with an arbitrary counting order.

Modulo counting:

– binary;

– non-binary.

The counting module of a binary counter is Kc=2, and the counting module of a non-binary counter is Kc= 2m, where m is the number of counter bits.

Summing serial counter

Fig.1. Summing serial 3-bit counter.

The triggers of this counter are triggered by the falling edge of the counting pulse. The input of the high digit of the counter is connected to the direct output (Q) of the low adjacent digit. The timing diagram of the operation of such a counter is shown in Fig. 2. At the initial moment of time, the states of all flip-flops are equal to log.0, respectively, at their direct outputs there is log.0. This is achieved by means of a short-term log.0 applied to the inputs of asynchronous setting of flip-flops to log.0. The general state of the counter can be characterized by a binary number (000). During counting, logic 1 is maintained at the inputs of asynchronous trigger installation in log.1. After the arrival of the trailing edge of the first pulse, the 0-bit switches to the opposite state - log.1. The leading edge of the counting pulse appears at the 1-bit input. Counter status (001). After the falling edge of the second pulse arrives at the input of the counter, the 0-bit switches to the opposite state - log.0, and the falling edge of the counting pulse appears at the input of the 1-bit, which switches the 1-bit to log.1. The general status of the counter is (010). The next falling edge at the 0-bit input will set it to logic 1 (011), etc. Thus, the counter accumulates the number of input pulses arriving at its input. When 8 pulses arrive at its input, the counter returns to its original state (000), which means the counting coefficient (CFC) of this counter is 8.

Rice. 2. Timing diagram of a serial adding counter.

Subtractive serial counter

The triggers of this counter are triggered by the falling edge. To implement the subtraction operation, the counting input of the high-order digit is connected to the inverse output of the adjacent low-order digit. The triggers are preliminarily set to log.1 (111). The operation of this counter is shown in the timing diagram in Fig. 4.

Rice. 1 Serial subtractive counter

Rice. 2 Timing diagram of a serial subtractive counter

Reversible serial counter

To implement an up/down counter, it is necessary to combine the functions of a adding counter and the functions of a subtracting counter. The diagram of this counter is shown in Fig. 5. The “sum” and “difference” signals are used to control the counting mode. For the summation mode, “sum” = log.1, “0” is short-term log.0; “difference” = log.0, “1” - short-term log.0. In this case, elements DD4.1 and DD4.3 allow the supply of signals from the direct outputs of triggers DD1.1, DD1.2 to the clock inputs of triggers DD1.2, DD2.1 through elements DD5.1 ​​and DD5.2, respectively. In this case, the elements DD4.2 and DD4.4 are closed, there is a log 0 at their outputs, so the action of the inverse outputs does not in any way affect the counting inputs of the flip-flops DD1.2, DD2.1. Thus, the summation operation is implemented. To implement the subtraction operation, log.0 is supplied to the “sum” input, and log.1 to the “difference” input. In this case, elements DD4.2, DD4.4 allow signals from the inverse outputs of triggers DD1.1, DD1.2 to be supplied to the inputs of elements DD5.1, DD5.2, and, accordingly, to the counting inputs of triggers DD1.2, DD2.1. In this case, the elements DD4.1, DD4.3 are closed and the signals from the direct outputs of the triggers DD1.1, DD1.2 do not in any way affect the counting inputs of the triggers DD1.2, DD2.1. Thus, the subtraction operation is implemented.

Rice. 3 Serial up/down 3-bit counter

To implement these counters, you can also use triggers that are triggered by the rising edge of the counting pulses. Then, when summing, a signal from the inverse output of the adjacent low-order bit must be supplied to the counting input of the highest digit, and when subtracting, vice versa, the counting input must be connected to the direct output.

The disadvantage of a serial counter is that as the bit depth increases, the installation time (tset) of this counter increases proportionally. The advantage is ease of implementation.

Rice. 3 – Reversing counter

There are two inputs for counting pulses: “+1” – for increase, “-1” – for decrease. The corresponding input (+1 or -1) is connected to input C. This can be done using an OR circuit if you insert it in front of the first flip-flop (the output of the element is to the input of the first flip-flop, the inputs are to buses +1 and -1). The weird stuff between the triggers (DD2 and DD4) is called the AND-OR element. This element is composed of two AND elements and one OR element, combined in one housing. First, the input signals on this element are logically multiplied, then the result is logically added.

The number of inputs of the AND-OR element corresponds to the number of the digit, i.e. if the third digit, then three inputs, the fourth - four, etc. The logic circuit is a two-position switch controlled by the direct or inverse output of the previous trigger. At log. 1 at the direct output, the counter counts pulses from the “+1” bus (if they arrive, of course), with a log. 1 on the inverse output – from the “-1” bus. The AND elements (DD6.1 and DD6.2) form the transfer signals. At output >7, the signal is generated when code 111 (number 7) and the presence of a clock pulse on bus +1, at the output<0 сигнал формируется при коде 000 и наличии тактового импульса на шине -1.

All this, of course, is interesting, but it looks more beautiful in microcircuit design:

Rice. 4 Four-bit binary counter

Here is a typical preset meter. CT2 means that the counter is binary; if it is decimal, then CT10 is set; if it is binary-decimal, it is CT2/10. Inputs D0 – D3 are called information inputs and are used to write any binary state to the counter. This state will be displayed at its outputs and the countdown will begin from it. In other words, these are preset inputs, or simply presets. Input V is used to enable code recording on inputs D0 – D3, or, as they say, enable preset. This input may also be designated by other letters. Preliminary recording into the counter is made when a write enable signal is sent at the moment the pulse arrives at input C. Input C is clocked. Impulses are pushed here. The triangle means that the counter is triggered by the fall of the pulse. If the triangle is rotated 180 degrees, i.e. with its back towards the letter C, then it is triggered by the edge of the pulse. Input R is used to reset the counter, i.e., when a pulse is applied to this input, logs are set at all counter outputs. 0. The PI input is called carry input. The output p is called the carry output. A signal is generated at this output when the counter overflows (when all outputs are set to logic 1). This signal can be applied to the carry input of the next counter. Then, when the first counter overflows, the second one will switch to the next state. Outputs 1, 2, 4, 8 are simply outputs. They generate a binary code corresponding to the number of pulses received at the input of the counter. If the conclusions have circles, which happens much more often, then they are inverse, i.e. instead of log. 1 is given log. 0 and vice versa. The operation of meters together with other devices will be discussed in more detail later.

Parallel totalizer

The operating principle of this counter is that the input signal containing counting pulses is applied simultaneously to all bits of this counter. And setting the counter to log.0 or log.1 state is controlled by the control circuit. The circuit of this counter is shown in Fig. 6

Rice. 4 Parallel accumulating counter

The counter bits are triggers DD1, DD2, DD3.

Control circuit – element DD4.

The advantage of this counter is its short installation time, which does not depend on the digit capacity of the counter.

The disadvantage is the complexity of the circuit as the counter capacity increases.

Parallel carry counters

To increase performance, a method of simultaneously generating a transfer signal for all bits is used. This is achieved by introducing AND elements, through which clock pulses are sent immediately to the inputs of all bits of the counter.

Rice. 2 – Parallel carry counter and graphs explaining its operation

Everything is clear with the first trigger. A clock pulse will pass to the input of the second trigger only when there is a log at the output of the first trigger. 1 (a feature of the AND circuit), and to the input of the third - when there is a log at the outputs of the first two. 1, etc. The response delay on the third trigger is the same as on the first. Such a counter is called a parallel carry counter. As can be seen from the diagram, as the number of bits increases, the number of logs increases. AND elements, and the higher the rank, the more inputs the element has. This is a disadvantage of such counters.

Development of a schematic diagram

Pulse former

A pulse shaper is a device necessary to eliminate contact bounce that occurs when mechanical contacts are closed, which can lead to improper operation of the circuit.

Figure 9 shows diagrams of pulse formers from mechanical contacts.

Rice. 9 Pulse formers from mechanical contacts.

Display block

LEDs must be used to display the counting result. To carry out such output of information, you can use the simplest scheme. The diagram of the LED display unit is shown in Figure 10.

Rice. 10 LED display unit.

Development of CCS (combination control circuit)

To implement this counter from the TTLSh series of K555 microcircuits, I chose:

two K555TV9 microcircuits (2 JK triggers with installation)

one K555LA4 microcircuit (3 3I-NOT elements)

two K555LA3 microcircuits (4 2I-NOT elements)

one K555LN1 chip (6 inverters)

These chips provide a minimum number of packages on a printed circuit board.

Drawing up a block diagram of the meter

Block diagram is a set of meter blocks that perform some function and ensure normal operation of the meter. Figure 7 shows the block diagram of the meter.

Rice. 7 Block diagram of the meter

The control unit performs the function of sending a signal and controlling triggers.

The counting block is designed to change the state of the counter and save this state.

The display unit displays information for visual perception.

Drawing up a functional diagram of the meter

Functional diagram – internal structure of the meter.

Let's determine the optimal number of triggers for a non-binary counter with a counting coefficient Kc=10.

M = log 2 (Kc) = 4.

M = 4 means to implement a binary decimal counter, 4 flip-flops are needed.

The simplest single-digit pulse counters

The simplest single-digit pulse counter can be a JK flip-flop and a D flip-flop operating in counting mode. It counts input pulses modulo 2 - each pulse switches the trigger to the opposite state. One trigger counts up to two, two connected in series count up to four, n triggers count up to 2n pulses. The counting result is generated in a given code, which can be stored in the counter’s memory or be read by another digital decoder device.

The figure shows the circuit of a three-bit binary pulse counter built on a JK flip-flop ax K155TB1. Mount such a counter on a breadboard panel and connect LED (or transistor - with an incandescent lamp) indicators to the direct outputs of the triggers, as was done before. Apply a series of pulses with a repetition frequency of 1 ... 2 Hz from the test generator to the input C of the first trigger of the counter and plot the operation of the counter using the light signals of the indicators.

If at the initial moment all the triggers of the counter were in the zero state (you can set the button switch SB1 “Set.0”, applying a low level voltage to the input R of the triggers), then upon the decline of the first pulse (Fig. 45.6) the trigger DD1 will switch to single state - a high voltage level will appear at its direct output (Fig. 45, c). The second pulse will switch the DD1 trigger to the zero state, and the DD2-B trigger to the single state (Fig. 45, d). As the third pulse falls, triggers DD1 and DD2 will be in the one state, and trigger DD3 will still be in the zero state. The fourth pulse will switch the first two triggers to the zero state, and the third to the single state (Fig. 45, d). The eighth pulse will switch all triggers to the zero state. When the ninth input pulse falls, the next cycle of operation of the three-digit pulse counter will begin.

Studying the graphs, it is easy to notice that each high digit of the counter differs from the low digit by twice the number of counting pulses. Thus, the period of the pulses at the output of the first trigger is 2 times greater than the period of the input pulses, at the output of the second trigger - 4 times, at the output of the third trigger - 8 times. Speaking in the language of digital technology, such a counter operates in a 1-2-4 weight code. Here, the term “weight” refers to the amount of information received by the counter after setting its triggers to the zero state. In devices and instruments of digital technology, four-digit pulse counters operating in the weight code 1-2-4-8 are most widely used. Frequency dividers count the input pulses to a certain state specified by the counting coefficient, and then form a trigger switching signal to the zero state, again begin counting the input pulses to the specified counting coefficient, etc.

The figure shows the circuit and graphs of the operation of a divider with a counting factor of 5, built on JK flip-flops. Here, the already familiar three-bit binary counter is supplemented with a 2-NOT DD4.1 logic element, which sets the counting factor of 5. It happens like this. During the first four input pulses (after setting the triggers to the zero state using the SB1 “Set 0” button), the device operates as a regular binary pulse counter. In this case, a low voltage level operates at one or both inputs of element DD4.1, so the element is in a single state.

Upon the decline of the fifth pulse, a high voltage level appears at the direct output of the first and third triggers, and therefore at both inputs of the DD4.1 element, switching this logical element to the zero state. At this moment, a short low-level pulse is formed at its output, which is transmitted through the diode VD1 to the R input of all flip-flops and switches them to the initial zero state.

From this moment the next cycle of the counter operation begins. Resistor R1 and diode VD1, introduced into this counter, are necessary in order to prevent the output of element DD4.1 from being shorted to the common wire.

You can check the operation of such a frequency divider by applying pulses with a frequency of 1 ... 2 Hz to the input C of its first trigger, and connecting a light indicator to the output of the DD3 trigger.

In practice, the functions of pulse counters and frequency dividers are performed by specially designed microcircuits with a high degree of integration. In the K155 series, for example, these are counters K155IE1, K155IE2, K155IE4, etc.

In amateur radio developments, the K155IE1 and K155IE2 microcircuits are most widely used. Conventional graphic symbols of these counter microcircuits with the numbering of their outputs are shown in Fig. 47.

The K155IE1 microcircuit (Fig. 47a) is called a ten-day pulse counter, that is, a counter with a counting factor of 10. It contains four triggers connected in series. The output (pin 5) of the microcircuit is the output of its fourth trigger. All flip-flops are set to the zero state by applying a high-level voltage simultaneously to both inputs R (pins 1 and 2), combined according to the AND element circuit (symbol “&”). Counting pulses, which must have a low level, can be applied to inputs C connected together (pins 8 and 9), also combined along I., or to one of them, if at this time the second has a high voltage level. With every tenth input pulse, the counter generates a low-level pulse equal in duration to the input pulse. Microcircuit K155IE2 (Fig. 48b)

Binary-decimal four-digit counter. It also has four flip-flops, but the first one has a separate C1 input (pin 14) and a separate direct output (pin 12). The other three triggers are connected to each other so that they form a divider by 5. When the output of the first trigger (pin 12) is connected to the input C2 (pin 1) of the circuit of the remaining triggers, the microcircuit becomes a divider by 10 (Fig. 48, a), operating in code 1 -2-4-8, which is what the numbers at the outputs of the graphic designation of the microcircuit symbolize. To set the counter triggers to the zero state, a high level voltage is applied to both inputs R0 (pins 2 and 3).

Two combined inputs R0 and four separating outputs of the K155IE2 microcircuit allow you to build frequency dividers with division factors from 2 to 10 without additional elements. For example, if you connect pins 12 and 1, 9 and 2, 8 n 3 (Fig. 48, 6), then the counting factor will be 6, and when connecting pins 12 and 1, 11. 2 and 3 (Fig. 48, c) the counting factor will become 8. This feature of the K155IE2 microcircuit allows it to be used both as a binary pulse counter and as a frequency divider.

A digital pulse counter is a digital unit that counts the pulses arriving at its input. The counting result is generated by the counter in a given code and can be stored for the required time. Counters are built on triggers, and the number of pulses that the counter can count is determined from the expression N = 2 n – 1, where n is the number of triggers, and minus one, because in digital technology 0 is taken as the starting point. Counters are summative when the count goes towards increase, and the subtractive count goes towards decrease. If the counter can switch during operation from summation to subtraction and vice versa, then it is called reversible.

From standard functional units of digital technology, it is not difficult to assemble an electronic stopwatch counter, similar to those produced for school physics classrooms. These devices use the pulse-counting method of time measurement, which consists in measuring the number of pulses whose repetition period is known. Such devices contain the following main components: a counting pulse generator, a control circuit (in the simplest case, its role is played by the “Start” button), a binary decimal counter, decoders and indicators. The last three nodes form a conversion decade, modeling one decimal place. It should be noted that measuring time using the pulse-counting method is accompanied by an inevitable error equal to a counting unit. This is due to the fact that the device will record the same number of pulses and, therefore, show the same time if the counting is stopped immediately after the arrival of the last pulse or just before the arrival of the previous pulse. In this case, the error will take the greatest value, equal to the time between two adjacent

Rice. 172. Recalculation decade

impulses. If you reduce the pulse repetition period and introduce additional counter digits, you can increase the measurement accuracy by the required number.

One decade of a stopwatch counter is shown in Figure 172. It consists of a binary-decimal counter on a decoder and an indicator on a neon lamp. To power the indicator, high voltage is required, therefore, according to safety regulations, the device must be used by a supervisor. The circuit uses a decoder specifically designed to work with a high-voltage indicator. Instead of a lamp, you can use lamps of other types: designed for a supply voltage of 200 V and an indication current. The microcircuit consists of a trigger with a counting input (input and a trigger divider by 5 (input). When connecting the output of a counting trigger (output 1) with the input of the divider, a binary-decimal counter. It responds to the falling edge of a positive pulse or to a negative voltage step applied to the input. In the legend, the counting edge is sometimes shown as an arrow directed towards the IC if it responds to a positive voltage step, or an arrow directed away from the IC if it reacts to a negative voltage drop.

To control the operation of the counting decade, three buttons and a switch are used. Before the counting of the decade begins

is set to zero using the “Set” button. O”, in this case a logical 1 is supplied to the counter inputs. Then the switch selects the source of the counting pulses - it can be either a trigger or a multivibrator. In the “counting mechanical closures” mode, when the button is pressed and released sequentially, binary-decimal counting occurs and the indicator lights up sequentially, numbers 1, 2, 3, etc. until number 9, then number 0 lights up and the counting is repeated. In the pulse counting mode, the input of the counter receives pulses from a multivibrator assembled according to the already known circuit in Fig. 168). To measure time in seconds, the pulse frequency must be 1 Hz. It is set by a variable resistor and a capacitance equal to

To obtain a multi-bit binary-decimal counter, they are switched on sequentially, i.e. the output of the first is connected to the input of the second, the output of the second is connected to the input of the third, etc. To set the multi-bit counter to the zero state, the inputs are combined and connected to the “Set” button. 0".

If, for example, the device is intended to be used in physics lessons, then time must be measured in a fairly wide range - from 0.001 to 100 s. To do this, the generator must have a frequency and the counter must consist of five decimal places. In this case, the digital indicator readings will look like this: 00.000; 00.001; 00.002, etc. up to 99.999 s.

The scope of application of a training counter-stopwatch can be significantly expanded if two additional devices are introduced into it - a non-contact control unit and a time delay unit. The first block must provide automatic and inertia-free switching on and off of the device. To do this, you can use the already known photo relay circuit (Fig. 76), selecting the desired sensitivity and matching the voltage of the power supplies. The control circuit must have two photosensors - one is used to turn on and the other to turn off the stopwatch counter at the moments when the rays intersect with a moving body. Knowing the distance between the photo sensors and the stopwatch readings, it is easy to calculate the speed of the body. The add-on unit uses two photocurrent amplifiers. Their output signals control the operation of a counting trigger, one of the outputs of which is connected to the stopwatch input through a transistor switch.

Other examples of the use of electronic meters can also be given. For example, a machine that simulates a game of dice consists of the already discussed decade of

And a neon lamp controlled by multivibrator pulses (see Fig. 168, 172). Players take turns pressing the button that interrupts the count. The one whose indicator shows the higher number wins. The moment the counter stops, as well as the moment the cube with points from 1 to 6 stops, is determined by random reasons, therefore the counting decade together with the multivibrator is an electronic random number sensor. Let's give more examples of its use in various gaming situations.

When checking the reaction speed of players, a resistor sets a certain frequency of operation of the multivibrator and the speed at which the indicator numbers change (see Fig. 168 and 172). Participants in the game are asked to press the multivibrator button each time the indicator shows a certain, pre-selected number. The higher the switching frequency, the more difficult it is to fulfill this condition. The slowest ones are eliminated first; the winner is the player with the best reaction. In another, more difficult version of the game, you need to continue pressing the button at a pace set by the judge after the indicator disappears. To do this, close it with a mechanical curtain or turn it off with a button

A counting decade together with a multivibrator is especially convenient to use in games if its power supply is made autonomous, that is, not connected to the network. In this case, a seven-segment LED indicator controlled by an integrated circuit decoder is used. We are already familiar with this microcircuit and indicator (Fig. 150, 163). The multivibrator and counter circuits remain unchanged. The circuit of a random number sensor operating from a 5 V source is shown in Figure 173.

An example of a more complex device that operates on the basis of an electric meter is a time delay unit, or timer. Figure 174 shows a schematic diagram of a timer that allows you to turn on various loads for a time from 0 to 999 s. It consists of a three-digit decimal counter assembled on a microcircuit of three decoders on a multivibrator chip and a control circuit on a microcircuit, as well as a microcircuit. The source of counting pulses is a multivibrator tuned to a frequency of 1 Hz. Its pulses are fed to the input of a three-digit decimal counter. Binary codes from each digit are fed to decoders. At their outputs, zero signals appear sequentially as they arrive at the inputs

Rice. 173. Recalculation decade with LED indicator

corresponding binary codes. Setting the required time delay is carried out by switches connecting the outputs of the decoder with the elements of the microcircuit. The inputs of the elements And are connected in pairs to obtain an element. The switch sets units of seconds, the switch tens of seconds and the switch hundreds of seconds. If, for example, the switches are connected to pins 2, 3 and 7 of the decoder, then there will be three 0s at the inputs of the OR-NOT element only at the moment when the counter records 237 pulses or a period of time equal to 237 seconds has passed since the start of counting. In this case, a 1 signal will appear at the output of the OR-NOT element. Until this moment, for all binary codes of the counter, the output of the logical element was a zero signal.

The timer control circuit works as follows. The “Stop” button is first pressed; as a result, the RS trigger assembled on the microcircuit is set to the zero state. From the direct output, the zero voltage level is supplied to a 1/77 transistor, in the emitter circuit of which the electromagnetic relay winding is connected. The transistor and relay are off. At the same time, a high level appears at inverse output 6, which serves as a reset signal for the counter. When you press the “Start” button, the RS trigger goes into the single state, and 3 appears on the direct output. high voltage level, sufficient to open the 1/77 transistor and operate the relay. Its contacts close the load power supply circuit. Simultaneously

(click to view scan)

the zero voltage level removed from the inverse output of the trigger “opens” the counter. The counter operates until output signals corresponding to the dialed number appear at the decoder outputs. In this case, as already mentioned, a single signal appears at the output, which is fed through the inverter to the input of the trigger. It is set to the zero state and, accordingly, the transistor, electromagnetic relay and load are turned off. The counter is set to zero.

The timer will show the current time in seconds if LEDs are connected to the decoder outputs. Time counting will become more convenient if the binary decimal codes of the counters are supplied to decoders working in conjunction with seven-segment indicators

This device is designed to count the number of revolutions of the shaft of a mechanical device. In addition to simple counting with indication on the LED display in decimal numbers, the counter provides information about the number of revolutions in a binary ten-bit code, which can be used when designing an automatic device. The counter consists of an optical speed sensor, which is an optocoupler consisting of a constantly glowing IR LED and a photodiode, between which there is a disk of opaque material in which a sector is cut out. The disk is attached to the shaft of a mechanical device, the number of revolutions of which must be counted. And, a combination of two counters - a three-digit decimal counter with output to seven-segment LED indicators, and a ten-digit binary counter. The counters operate synchronously, but independently of each other. The HL1 LED emits a continuous light stream, which enters the photodiode through a slot in the measuring disk. When the disk rotates, impulses are generated, and since there is only one slot in the disk, the number of these impulses is equal to the number of revolutions of the disk. The Schmitt trigger on D1.1 and D1.2 converts voltage pulses on R2, caused by a change in the photocurrent through the photodiode, into logic level pulses suitable for perception by counters of the K176 and K561 series. The number of pulses (number of disk revolutions) is simultaneously counted by two counters - a three-decade decimal counter on chips D2-D4 and a binary counter on D5. Information about the number of revolutions is displayed on a digital display, composed of three seven-segment LED indicators H1-H3, and in the form of a ten-bit binary code, which is removed from the outputs of the counter D5. Resetting all counters to zero at the moment the power is turned on occurs simultaneously, which is facilitated by the presence of element D1.3. If you need a zero button, it can be connected in parallel with capacitor C1. If you need the reset signal to come from an external device or logic circuit, you need to replace the K561LE5 microcircuit with K561LA7, and disconnect its pin 13 from pin 12 and C1. Now zeroing can be done by applying a logical zero from an external logical node to pin 13 of D1.3. The circuit can use other seven-segment LED indicators similar to ALS324. If the indicators have a common cathode, you need to apply zero, not one, to pins 6 D2-D4. K561 microcircuits can be replaced with analogues of the K176, K1561 series or imported analogues. LED - any IR LED (from the remote control of the equipment). Photodiode - any of those used in remote control systems of TVs of the USCT type. The setting consists of setting the sensitivity of the photodiode by selecting the value of R2.

Radioconstructor No. 2 2003 p. 24

Like flip-flops, counters do not necessarily need to be assembled manually from logical elements - today’s industry produces a wide variety of counters already assembled in microcircuit packages. In this article, I will not dwell on each counter chip separately (this is not necessary, and it will take too much time), but will simply briefly outline what you can count on when solving certain problems in digital circuitry. For those who are interested in specific types of counter chips, I can send them to my far from complete reference book for TTL and CMOS chips.

So, based on the experience gained in the previous conversation, we found out one of the main parameters of the counter - bit depth. In order for the counter to count up to 16 (including zero - this is also a number), we needed 4 digits. Adding each subsequent digit will exactly double the counter's capabilities. Thus, a five-bit counter can count up to 32, and a six-bit counter can count up to 64. For computer technology, the optimal bit depth is a multiple of four. This is not a golden rule, but still most counters, decoders, buffers, etc. four (up to 16) or eight-bit (up to 256) are built.

But since digital circuitry is not limited to computers alone, counters with very different counting coefficients are often required: 3, 10, 12, 6, etc. For example, to build circuits for minute counters, we need a 60 counter, and it is easy to obtain by connecting a 10 counter and a 6 counter in series. We may also need a larger capacity. For these cases, for example, the CMOS series has a ready-made 14-bit counter (K564IE16), which consists of 14 D-flip-flops connected in series and each output except the 2nd and 3rd is connected to a separate pin. Apply pulses to the input, count and read, if necessary, the counter readings in binary numbers:

K564IE16

To facilitate the construction of counters of the required capacity, some microcircuits may contain several separate counters. Let's take a look at K155IE2 - binary decimal counter(in Russian - “counter up to 10, displaying information in binary code”):

The microcircuit contains 4 D-flip-flops, and 1 flip-flop (single-digit counter - divider by 2) is assembled separately - has its own input (14) and its own output (12). The remaining 3 flip-flops are assembled in such a way that they divide the input frequency by 5. For them, the input is pin 1, outputs 9, 8,11. If we need a counter up to 10, then we simply connect pins 1 and 12, apply counting pulses to pin 14, and from pins 12, 9, 8, 11 we remove the binary code, which will increase to 10, after which the counters will be reset and the cycle will repeat. The K155IE2 composite counter is no exception. A similar composition has, for example, K155IE4 (counter up to 2+6) or K155IE5 (counter up to 2+8):

Almost all counters have inputs for forced reset to “0”, and some have inputs for setting them to the maximum value. And finally, I just have to say that some counters can count both back and forth! These are so-called reversible counters, which can switch for counting both to increase (+1) and decrease (-1). It can, for example, BCD up/down counter K155IE6:

When pulses are applied to input +1, the counter will count forward, pulses at input -1 will decrease the counter readings. If, as the readings increase, the counter overflows (pulse 11), then before returning to zero, it will output a “transfer” signal to pin 12, which can be applied to the next counter to increase the capacity. Pin 13 has the same purpose, but a pulse will appear on it when the count passes through zero when counting in the opposite direction.

Please note that in addition to reset inputs, the K155IE6 microcircuit has inputs for writing an arbitrary number to it (pins 15, 1, 10, 9). To do this, it is enough to set any number 0 - 10 in binary notation at these inputs and apply a write pulse to input C.

Everyone knows why a microcalculator exists, but it turns out that in addition to mathematical calculations, it is capable of much more. Please note that if you press the “1” button, then “+” and then press “=”, then with each press of the “=” button the number on the display will increase by one. Why not a digital counter?

If two wires are soldered to the “=” button, they can be used as a counter input, for example, a turns counter for a winding machine. And after all, the counter can also be reversible; to do this, you must first dial a number on the display, for example, the number of turns of the coil, and then press the “-” button and the “1” button. Now, each time you press “=” the number will decrease by one.

However, a sensor is needed. The simplest option is the reed switch (Fig. 1). We connect the reed switch with wires parallel to the “=” button, the reed switch itself stands on the stationary part of the winding machine, and we fix the magnet on the movable one, so that during one revolution of the coil the magnet passes near the reed switch once, causing it to close.

That's all. You need to wind the coil, do “1+” and then with each turn, that is, with each turn the display readings will increase by one. You need to unwind the coil - enter the number of turns of the coil on the microcalculator display, and make “-1”, then with each revolution of unwinding the coil, the display readings will decrease by one.

Fig.1. Scheme of connecting the reed switch to the calculator.

And, suppose you need to measure a large distance, for example, the length of a road, the size of a plot of land, the length of a route. We take a regular bike. That's right - we attach a non-metallic bracket with a reed switch to the fork, and we attach the magnet to one of the spokes of the bicycle wheel. Then, we measure the circumference of the wheel, and express it in meters, for example, the circumference of the wheel is 1.45 meters, so we dial “1.45+”, after which with each revolution of the wheel the display readings will increase by 1.45 meters, and as a result, the display will show the distance traveled by the bike in meters.

If you have a faulty Chinese quartz alarm clock (usually their mechanism is not very durable, but the electronic board is very reliable), you can take a board from it and, according to the circuit shown in Figure 2, make a stopwatch out of it and a calculator.

Power is supplied to the alarm clock board through a parametric stabilizer on the HL1 LED (the LED must have a direct voltage of 1.4-1.7V, for example, red AL307) and resistor R2.

The pulses are generated from the control pulses of the stepper motor of the clock mechanism (the coils must be disconnected, the board is used independently). These pulses are fed through the diodes VD1 and VD2 to the base of the transistor VT1. The alarm board supply voltage is only 1.6V, while the pulse levels at the outputs for the stepper motor are even lower.

For the circuit to work properly, diodes with a low level of forward voltage, such as VAT85, or germanium are required.

These pulses are fed to the transistor key at VT1 and VT2. The collector circuit VT2 includes the winding of a low-power relay K1, the contacts of which are connected in parallel to the “=” button of the microcalculator. When there is +5V power, the contacts of relay K1 will close at a frequency of 1 Hz.

To start the stopwatch, you must first perform the “1+” action, then turn on the power to the pulse shaper circuit using switch S1. Now, with every second, the display readings will increase by one.

To stop counting, simply turn off the power to the pulse shaper using switch S1.

To have a count for reduction, you must first enter the initial number of seconds on the microcalculator display, and then do the “-1” action and turn on the power to the pulse shaper with switch S1. Now, with every second, the display readings will decrease by one, and from them it will be possible to judge how much time is left until a certain event.

Fig.2. Scheme for turning a Chinese hanger into a stopwatch.

Fig.3. Circuit diagram of an IR beam intersection counter using a calculator.

If you use an infrared photo sensor that works at the intersection of the beam, you can adapt the microcalculator to count some objects, for example, boxes moving along a conveyor belt, or by installing the sensor in the aisle, count people entering the room.

A schematic diagram of an IR reflection sensor for working with a microcalculator is shown in Figure 3.

The IR signal generator is made on an A1 chip of type “555” (integrated timer). It is a pulse generator with a frequency of 38 kHz, at the output of which an infrared LED is switched on. The generation frequency depends on the C1-R1 circuit; when setting up by selecting resistor R1, you need to set the frequency at the output of the microcircuit (pin 3) to close to 38 kHz. The HL1 LED is placed on one side of the passage, putting an opaque tube on it, which must be precisely aimed at the photodetector.

The photodetector is made on the HF1 chip - this is a standard integrated photodetector of the TSOP4838 type for remote control systems for TVs and other home appliances. When a beam from HL1 hits this photodetector, its output is zero. In the absence of a beam - one.

Thus, there is nothing between HL1 and HF1 - the contacts of relay K1 are open, and at the moment of the passage of any object, the relay contacts are closed. If you perform the “1+” action on the microcalculator, then with each passage of an object between HL1 and HF1, the microcalculator display readings will increase by one, and from them you can judge how many boxes were shipped or how many people entered.

Kryukov M.B. RK-2016-01.