Sevegment indicator 4 discharge discharge. Sevegment indicator. Conclusion to fractional indicators, Float format

Surely you have already seen the indicators - "eights". This is a seven-segment LED indicator that serves to display numbers from 0 to 9, as well as a decimal point ( DP. - Decimal Point) or comma.

Structurally, such a product is an assembly of LEDs. Each assembly LED illuminates its sign.

Depending on the model, the assembly may consist of 1 - 4 seven groups. For example, the ALS333B1 indicator consists of one seven group, which is capable of displaying only one digit from 0 to 9.

But the LED indicator KEM-5162AS already has two seven groups. It is two-bit. Further, different LED seven seven indicators are shown in the photo.

There are also indicators with 4 seven groups - four-dimensional (in the photo - FYQ-5641BSR-11). They can be used in homemade electronic clocks.

How are seven indicators in diagrams designate?

Since the seven-step indicator is a combined electronic device, the image of it in the schemes differs little from its appearance.

It is worth only to pay attention to the fact that each conclusion corresponds to a specific signage to which it is connected. There is also one or more conclusions of the common cathode or anode - depending on the device model.

Features of seven indicators.

Despite the seeming simplicity of this detail and she has features.

Firstly, LED seven-step indicators are with a common anode and with a common cathode. This feature should be taken into account when purchasing it for a homemade design or instrument.

Here, for example, the bondage of the 4th bit already acquainted to us FYQ-5641BSR-11.

As you can see, the anodes of the LEDs of each figure are combined and derived to separate output. Cathodes of the LEDs that belong to the alternationlet (for example, G.) are connected together. From what scheme of the compounds has an indicator (with a common anode or cathode) depends a lot. If you look at the concepts of devices using seven-step indicators, it will become clear why it is so important.

In addition to small indicators there are large and even very large. They can be seen in public places, usually in the form of wall clocks, thermometers, informers.

To increase the size of the numbers on the scoreboard and at the same time save a sufficient brightness of each segment, several LEDs are used sequentially. Here is an example of such an indicator - it fits on the palm. it FYS-23011-BUB-21.

One of its segment consists of 4 LEDs included in series.

To light one of the segments (A, B, C, D, E, F, or G), it is necessary to submit a voltage of 11.2 volts on it (2.8V per LED). It is possible and less, for example, 10V, but the brightness will also decrease. The exception is a decimal point (DP), its segment consists of two LEDs. It takes only 5-5,6 volts for it.

Also in nature there are two-color indicators. They are embedded, for example, red and green LEDs. It turns out that the housing is built as two indicators, but with LEDs of different color of the glow. If you submit voltage on both chains of LEDs, you can get a yellow color of the glow of segments. Here is a diagram of compounds of one of these two-color indicators (SBA-15-11EGWA).

If you switch the conclusions 1 ( Red ) and 5 ( Green. ) On "+" power through key transistors, then you can change the color of the glow of the displayed numbers from red to the green. And if you simultaneously connect the conclusions 1 and 5, then the color of the circuit will be orange. This is how you can indulge with the indicators.

Management of seven indicators.

To manage semissegment indicators in digital devices use shear registers and decoders. For example, a widespread decoder for controlling indicators of the ALS333 series and ALS324 - microcircuit K514I2 or K176I2. Here is an example.

And for the management of modern imported indicators, the shift registers are commonly used 74hc595. In theory, you can manage the scoremen and directly from the microcontroller outputs. But this scheme is rarely used, since this requires quite a lot of conclusions of the microcontroller itself. Therefore, the shear registers are used for this purpose. In addition, the current consumed by the LEDs of the alignment may be greater than the current that can provide an ordinary output of the microcontroller.

To control large seven indicators, such as, FYS-23011-BUB-21 are used by specialized drivers, such as a microcircuit MBI5026..

What is inside the seven indicator?

Well, a little delicious. Any electronics will not be such if it were not interested in the "insides" of radio components. That's what inside the ALS324B1 indicator.

Black squares on the ground are crystals of LEDs. Immediately you can see the gold jumpers that connect the crystal with one of the conclusions. Unfortunately, this indicator will not work, because these most jumpers were torn off. But we can see what is hidden behind the decorative panel board.

This article continues the cycle of my publication about the organization of dynamic indication on microcontrollers PIC and LED indicators. Here are the links to previous publications:

The table of operation of the proposed algorithm (an indicator with a shared cathode is used, in the first column, the outlines of the register connected to the indicator discharges) according to the connection scheme below.

In each of the interrupts with an interval of 2 ms (in this case, the TMR0 timer) is prepared one stage of the dynamic indication (di) according to the algorithm, which consists of five phases of register control and indicator.

The 2nd phase: a positive difference in the output 12 of the register (ST_CP) records the zero state of the register in the output latch. Hereinafter, before the start of the indication, the indicator is repaid with zero potential in segments.

The 3rd phase: By control of register conclusions 14 (DS - data) and 11 (SH_CP - clock), the code for managing segments is recorded.

4th Phase: Positive Diffade on the output 12 of the register data from the register is recorded in the output latch, and, due to positive levels, the indicator remains redeemed on the discharge.

The 5th phase: here the desired code is sent to the indicator discovers here, and the indication itself occurs.

If one 4-bit indicator is involved in the scheme, then it should be with approx. If you want to manage 8 discharges, then 8 MK ports are used, while the remaining 4 ports simply control the discharges (in phase 4 there must be a high level). It is worth noting that in this case it is possible to use indicators both from OK and with OA, connecting to the register, respectively, segments or discharges (for the reasons below, di in the first case it is preferable to organize a standing, and in the second is a bonnetal).

For this technique, you can connect two four-digit indicators to Mark PIC16F676 using one shift register, while remaining for use of the whole four free ports. For example, for such an connection, people used alignment in some ports of MK functions of di and analog inputs (in my opinion, an extremely dubious solution), which led to a significant complication of the scheme and to some restrictions, as the authors and warn. Using my connection scheme, everything would have decided simply and beautifully - the inputs separately, the indication separately, plus two more ports (including MCLR) for the buttons.

To test this control method, the following simple scheme is proposed on Mark PIC12F629 and the FYQ3641A indicator, which gives the indicator alternately word "test" and number 1234.

It is decided to apply a regular di (one segment is included at each moment, and there is a code on the discharge conclusions, where in each discharge: 0 - if this segment should be burned and 1 - otherwise), in which peak currents shift to the register . Why? There are two reasons for this: the first is the maximum load capacity of 74HC595 35 mA outputs against 25 mA for PIC controllers; The second and home - close to the limit current through the output port of MK theoretically can raise the output potential to the level of switching the register inputs, which would lead to errors in operation. And so, in the ports of the MK, currents of 6-7 mA and at the outputs, the potentials are obviously not exceeding TTL levels.

As mentioned above, the interval interval is 2 ms, which corresponds to the frequency of updating the indicator in 64 Hz and its glow is quite comfortably perceived by the eye.

This method of di, among other things, halved to reduce the number of current-limitary resistors (R2-R5).

The device is assembled on the so-called "beam-free" dummy.

The indicator can be replaced by any of the 3641A series.

The scheme is powered by a stabilized source, a voltage of 5 V. I used a special board-stabilizer, intended for use in conjunction with the above-mentioned dealer.

The MK management program is written in the SI language and is excelled in the environment.

Code in Mikroc, project, hex file in the application.

To use this method of connecting in commercial development, please contact me.

List of radio elements

Designation A type Nominal number NoteScoreMy notebook
DD1. MK Pic 8-bit

Pic12f629.

1 In notebook
DD2. Register74hc5951 In notebook
Hl IndicatorFYQ3641.1 In notebook
R1 Resistor

30 com

1 In notebook
R2. Resistor

430 Oh.

1 In notebook
R3 Resistor

430 Oh.

1

New articles

● Project 7: Matrix 4-bit from 7-segment indicators. We make dynamic indication

In this experiment, we will look at the work of Arduino with a 4-bit seven-segment matrix. We obtain an idea of \u200b\u200bthe dynamic indication that allows you to use ARDUINO outputs when the information is output into several seven-segment indicators.

Required components:

The 4-bit matrix of seven-segment indicators consists of four seven indicators and is intended for simultaneous output to the matrix 4 digits, it is also possible to output a decimal point. A 4-bit matrix circuit on 7-segment indicators is shown in Fig. 7.1.

Fig. 7.1. Scheme 4-bit matrix on 7-segment indicators

To display the numbers, it is necessary to light the desired LEDs on the A-G and DP contacts and select the desired Low feed matrix to withdraw 6, 8, 9 or 12.
Connect the contacts of the matrix to the Arduino board and we will display the numbers to the various categories of the matrix. To connect, we will need 12 Arduino conclusions. Connection diagram for connecting a 4-bit matrix to the Arduino board is shown in Fig. 7.2. When connecting the contacts, 510 Ohm restrictive resistors are used.

Fig. 7.2. Connection diagram 4-bit matrix to Arduino

We write the test of the sequential output of numbers (0-9) to an arbitrary register of the matrix. To select a random value from the range, we will use the RANDOM () function. In the numbers array, the values \u200b\u200bcorresponding to the data are stored for displaying numbers 0-9 (the eldest discharge of the byte corresponds to the indicator segment label, and the younger - segment G), in the PINS array - the contact values \u200b\u200bfor AG and DP segments, in the Pindigits array - contact values \u200b\u200bfor contacts for contacts Selection of the discharge of the matrix. Sketch content is shown in Listing 7.1.

// Variable for storing the current digit value INT NUMBER \u003d 0; // Sevegmental Indicator int digit \u003d 0; void setup ()(for (int i \u003d 0; i<8 ;i++) pinMode(pins[i],OUTPUT); for (int i=0 ;i<4 ;i++) {pinMode(pindigits[i],OUTPUT); digitalWrite(pindigits[i],HIGH); } } void loop ()(Number \u003d (Number + 1)% 10; Shownumber (Number); // DS FOR (int i \u003d 0; i<4 ;i++) digitalWrite(pindigits[i],HIGH); digit=random(0 ,4 ); digitalWrite(pindigits,LOW); delay(3000 ); } void Shownumber ( iNT NUM)(for (int i \u003d 0; i<7 ;i++) { if (bitRead(numbers,7 -i)==HIGH) // Welcome segment // Extend segment DigitalWrite (Pins [i], Low); ))
Connection order:

1. Connect the seven indicator according to the scheme in Fig. 7.3.
2. We load in the Arduino fee Skatch from Listing 7.2.

// List of Arduino conclusions for connecting to discharges A-G // Sevegmental Indicator INT PINS \u003d (9, 13, 4, 6, 7, 10, 3, 5); // Values \u200b\u200bfor output numbers 0-9 BYTE Numbers \u003d (B11111100, B01100000, B11011010, B11110010, B01100110, B10110110, B10111110, B11100000, B11111110, B11110110); // variable for storing and processing the current value INT NUMBER \u003d 0; INT NUMBER1 \u003d 0; INT NUMBER2 \u003d 0; // Sevegmental Indicator int pindigits \u003d (2, 8, 11, 12); // variable for storing the current discharge int digit \u003d 0; // for measuring 100 ms Unsigned long Millis1 \u003d 0; // Mode 1 - Stopwatch works Mode \u003d 0; Const int button \u003d 14; // Contact 14 (A0) to connect the button int Tekbutton \u003d Low; // Variable for saving the current button status int prevButton \u003d Low; // Variable to save the previous state // To the BOOLEAN LEDON \u003d FALSE; // Current LED Status (Enabled / Off) void setup (){ // Configure the contact button as the entrance Pinmode (Button, Input); // Configure contacts as outputs for (int i \u003d 0; i<8 ;i++) pinMode(pins[i],OUTPUT); for (int i=0 ;i<4 ;i++) {pinMode(pindigits[i],OUTPUT); digitalWrite(pindigits[i],HIGH); } } void loop ()(TekButton \u003d Debounce (PrevButton); if (prevButton \u003d\u003d LOW && TEKBUTTON \u003d\u003d HIGH) // If pressing ... (Mode \u003d 1 -Mode; // Change mode if (Mode \u003d\u003d 1) Number \u003d 0; ) if (Millis () - Millis1\u003e \u003d 100 && Mode \u003d\u003d 1) (Millis1 \u003d Millis1 + 100; Number \u003d Number + 1; if (Number \u003d\u003d 1000) Number \u003d 0;) Number1 \u003d NUMBER; for (int i \u003d 0; i<4 ;i++) { number2=number1%10 ; number1=number1/10 ; showNumber(number2,i); for (int j=0 ;j<4 ;j++) digitalWrite(pindigits[j],HIGH); digitalWrite(pindigits[i],LOW); delay(1 ); } } // Function Output Figures on the Sevegment Indicator void Shownumber ( iNT NUM, INT DIG)(for (int i \u003d 0; i<8 ;i++) { if (bitRead(numbers,7 -i)==HIGH) // Welcome segment DigitalWrite (PINS [I], HIGH); ELSE. // Extend segment DigitalWrite (Pins [i], Low); ) if (Dig \u003d\u003d 1) // decimal point for the second category DigitalWrite (Pins, High); ) // Function smoothing the rat. Accepts in quality // argument Previous condition of the button and gives the actual one. boolean Debounce ( boolean Last)(Boolean Current \u003d Digitalread (Button); // count the button status, If (Last! \u003d Current) // if changed ... (D. elay ( 5 ) ; // z dem 5 m with Current \u003d Digitalread (Button); // Read the button status RETURN CURRENT; // Return the button to the button } }

3. Press the button to start or stop the stopwatch.

Connecting a seven-step indicator to Arduino is an excellent entry-level project that allows you to get acquainted with the Arduino board closer. But quite just carried out. Therefore, we will somewhat complicate the task and connect the four-bit seven indicator.



In this case, we will use the module of the four-digit LED indicator with a shared cathode.


Each segment in the indicator module is multiplexed, that is, it separates one anode point of connection with other segments of its discharge. And each of the four discharges in the module has its own connection point with a shared cathode. This allows each digit to turn on or off independently. In addition, this method of multiplexing allows the microcontroller to use only eleven or twelve conclusions instead of thirty-two.



The LED indicator segments require the connection of current-limiting resistors when nutrition from 5 V on the logical output. The resistor value is usually taken between 330 and 470. The use of transistors is also recommended to provide additional current, since each conclusion of the microcontroller can produce a maximum of 40 mA. If you include all the discharge segments (digit 8), then the current consumed will exceed this limit. The figure below shows a diagram of connecting a four-bit seven-state indicator using transistors of current-limiting resistors.



The following are the indicator circuits to the Arduino conclusion. Here used bipolar NPN transistors BC547. Potentiometer 10 com connected to the input of the board A0 allows you to change the value displayed on the indicator from 0 to 1023.




On the Arduino board, D2-D8 digital outputs are designed to control the segments from "a" to "G", and the digital outputs of D9-D12 are used to control discharges from D0 to D3. It should be noted that in this example the point is not used, but in the sketch below, it is possible to use it. Arduino board D13 is reserved to control the point segment.



Below is a code that allows you to control the four-digit segment indicator using the Arduino board. In it, the Numeral array sets the numbers from 0 to 9 in binary form. This sketch supports both the general cathode indicators (by default) and the indicators with the general anode (for this you need to rush one line at the end of the sketch).


// Bits representing segments with a by g (and points) for numbers 0-9 const int numeral \u003d (// abcdefg / dp b11111100, // 0 b01100000, // 1 B11011010, // 2 B11110010, // 3 B01100110, // 4 B10110110, // 5 B00111110, // 6 B11100000, // 7 B11111110, // 8 B11100110, // 9); // Conclusions for the point and each segment // DP, G, F, E, D, C, B, A Const int segmentpins \u003d (13,8,6,5,5,4,3,2); Const int nbrdigits \u003d 4; // Number of discharges of the LED indicator // Discharges 0 1 2 3 Const int Digitpins \u003d (9,10,11,12); void setup () (for (int i \u003d 0; i< 8; i++) { pinMode(segmentPins[i], OUTPUT); // устанавливаем выводы для сегментов и точки на выход } for(int i=0; i < nbrDigits; i++) { pinMode(digitPins[i], OUTPUT); } } void loop() { int value = analogRead(0); showNumber(value); } void showNumber(int number) { if(number == 0) { showDigit(0, nbrDigits-1) ; // отображаем 0 в правом разряде } else { // отображаем значение, соответствующее каждой цифре // крайняя левая цифра 0, правая на единицу меньше, чем число позиций for(int digit = nbrDigits-1; digit >\u003d 0; Digit--) (IF (Number\u003e 0) (ShowDigit (Number% 10, Digit); Number \u003d Number / 10;)))) // Displays the specified number on this discharge of the 7-segment indicator Void Showdigit (int Number, int Digit) (DigitalWrite (Digitpins, High); for (int segment \u003d 1; segment< 8; segment++) { boolean isBitSet = bitRead(numeral, segment); // isBitSet будет истинным, если данный бит будет 1 // isBitSet = ! isBitSet; // опционально // раскомментируйте опциональную строчку выше для индикатора с общим анодом digitalWrite(segmentPins, isBitSet); } delay(5); digitalWrite(digitPins, LOW); }


Connection diagram of a single-digit seven indicator
Connection diagram of a multi-digit seven indicator

Digital information display device. This is the most simple implementation of an indicator that can display Arabic numbers. To display letters, more complex multi-segment and matrix indicators are used.

As his name says, consists of seven elements of the indication (segments), which are included and switched separately. Including them in different combinations, you can make simplified images of Arabic numbers.
Segments are denoted by letters from a to g; The eighth segment - decimal point (Decimal Point, DP), designed to display fractional numbers.
Occasionally on the seven indicator display letters.

There are different colors, usually it is white, red, green, yellow and blue. In addition, they can be of different sizes.

Also, the LED indicator may be single-digit (as in the figure above) and multi-digit. Mainly in practice, one-, two-, three- and four-digit LED indicators are used:

Besides ten digits, seven-step indicators are able to display letters. But only a few letters have an intuitive seven-mentioned presentation.
In Latineta: title a, b, c, e, f, g, h, i, j, l, n, o, p, s, u, y, z, s, s, u, y, z, line a, b, c, d, e, g , H, I, N, O, Q, R, T, U.
In Cyrillic: A, B, B, G, G, E, and, N, O, O, P, P, P, C, C, P, P, C, C, O, H, s (two discharge), b, e / s.
Therefore, seven-segment indicators are used only to display the simplest messages.

In total, the seven-segment LED can display 128 characters:

In the usual LED indicator, nine conclusions: one goes to the cathodes of all segments, and the other eight is to the anode of each of the segments. This scheme is called "Scheme with shared cathode", there are also schemes with a common anode (Then the opposite). Often do not alone, and two common outputs at different parts of the base - it simplifies the wiring, without increasing the dimensions. There are also the so-called "universal", but I personally did not come across such. In addition, there are indicators with a built-in shift register, due to which the number of microcontroller ports involved is much reduced, but they are much more expensive and in practice are rarely applied. And since the immense does not argue, then we will not consider such indicators (but there are still indicators with a much large number of segments, matrix).

Multi-digit LED indicators Often it is operated by a dynamic principle: the conclusions of the segments of all discharges are connected together. To display information on such an indicator, the control chip must cyclically supply the current to the general conclusions of all discharges, while the conclusions of the current segments are supplied depending on whether this segment is lit in this discharge.

Connecting a single-digit seven indicator to a microcontroller

The scheme below shows how Connects a single-bit seven indicator to the microcontroller.
It should be borne in mind that if the indicator is Common cathode, then its general conclusion is connected to "Earth"and the ignition of the segments occurs logical unit on the port output.
If the indicator S. Common anodethen on its overall wire is served "a plus" voltage, and the ignition of the segments occurs by transferring the port output to the state logical zero.

The display of the display in a single-digit LED indicator is carried out in the conclusions of the port of the microcontroller of the binary code of the corresponding digit of the corresponding logical level (for indicators with OK - logical units, for indicators with OA - logical zeros).

Cotorographer resistors may be present in the scheme, and may not be present. It all depends on the supply voltage, which is fed to the indicator and the technical characteristics of the indicators. If, for example, the voltage supplied to the segments is 5 volt, and they are calculated on the operating voltage of 2 volts, then the current-limit resistors must be installed (in order to limit the current through them for increased supply voltage and not burn not only the indicator, but also the port of the microcontroller).
Calculate the denomination of current-limit resistors is very easy, according to grandfather's formula Omar.
For example, the indicator features are as follows (take from datashet):
- Operating voltage - 2 volts
- working current - 10 mA (\u003d 0.01 a)
- supply voltage 5 volts
Formula for calculation:
R \u003d U / I (all values \u200b\u200bin this formula must be in Omah, volts and amperes)
R \u003d (supply voltage - operating voltage) / operating current
R \u003d (5-2) /0.01 \u003d 300 ohm

Connection diagram of multi-digit seven-digit LED indicator Basically the same as when connecting a single-digit indicator. The only one is added control transistors in the cathodes (anodes) of the indicators:

The diagram does not shown, but there is a resistor to be included between the transistors of the transistors and the conveyors of the port of the microcontroller, the resistance of which depends on the type of transistor (the ratings of the resistors are calculated, but you can also try to apply resistors with a face value 5-10 com).

Discharge indication is carried out dynamic:
- Binary code is set to the appropriate digit on the outputs of the port of RV for 1 discharge, then the logical level is fed to the control transistor of the first discharge
- Binary code is set to the corresponding digit on the outputs of the port of RV for 2 discharge, then the logical level is fed to the second-digit control transistor.
- Binary code is set to the corresponding digit on the outputs of the port of RV for 3 discharge, then the logical level is fed to the third discharge control transistor.
- So in a circle
It should be considered:
- for indicators with OK Applied control transistor structure NPN. (manages a logical unit)
- for indicator with OA - Transistor structure PNP. (controlled by logical zero)