• Peak level indicator - identifying troughs and peaks without redrawing. Peaks and troughs indicator or how to profit from stupidity

    About a year ago I got the idea to assemble a 12-220 volt voltage converter. A transformer was needed for implementation. The search led to the garage, where the Solntsev amplifier, which I had assembled about 20 years ago, was found. Simply removing the transformer and thus destroying the amplifier did not raise the hand. The idea was born to revive him. In the process of revitalizing the amplifier, many things have changed. Including power output indicator. The circuit of the previous indicator was cumbersome, assembled on K155LA3, etc. Even the Internet didn’t help find her. But another very simple, but no less effective output power indicator circuit was found.

    LED indicator circuit

    This scheme is quite well described on the Internet. Here I will only briefly tell (retell) about her work. The output power indicator is assembled on the LM3915 chip. Ten LEDs are connected to the powerful outputs of the microcircuit comparators. The output current of the comparators is stabilized, so there is no need for quenching resistors. The supply voltage of the microcircuit can be within 6...20 V. The indicator responds to instantaneous values sound voltage. The microcircuit's divider is designed so that each subsequent LED turns on when the input signal voltage increases v2 times (by 3 dB), which is convenient for controlling the power of the UMZCH.

    The signal is taken directly from the load - acoustic UMZCH systems- through the divider R*/10k. The range of powers indicated in the diagram 0.2-0.4-0.8-1.6-3-6-12-25-50-100 W corresponds to reality if the resistor resistance R* = 5.6 kOhm for Rн = 2 Ohm, R*= 10 kOhm for Rn=4 Ohm, R*= 18 kOhm for Rn=8 Ohm and R*=30 kOhm for Rn=16 Ohm. LM3915 makes it possible to easily change display modes. It is enough just to apply voltage to pin 9 of the LM3915 IC, and it will switch from one indication mode to another. Contacts 1 and 2 are used for this. If they are connected, the IC will switch to the “Luminous Column” indication mode; if left free, it will go to “Running Dot”. If the indicator will be used with a UMZCH with a different maximum output power, then you only need to select the resistance of the resistor R* so that the LED connected to pin 10 of the IC lights up at maximum power UMZCH.

    As you can see, the circuit is simple and does not require complex setup. Due to the wide range of supply voltages, I used one pulse arm for its operation. bipolar block UMZCH power supply+15 volts. At the signal input, instead of selecting individual resistors R*, I installed variable resistance with a nominal value of 20 kOhm, which made the indicator universal for acoustics of different impedances.

    To change the display modes, I provided for installing a jumper or a latching button. In the final I closed it with a jumper.

    Many people remember well how at the dawn of the 80s, tape decks (Japanese) had recording level indicators with peak displays. Having such an indicator at your disposal was the dream of many radio amateurs and music lovers, but assembling it yourself at that time was simply not realistic.
    With the advent of microcontrollers, circuitry has changed dramatically, and now the peak indicator circuit does not look more complicated than the circuit a simple transistor radio from the 80s.
    We present to your attention a peak signal level indicator on the PIC16F88 microcontroller, mono, LEDs or LEDs are used as indicators LED matrices. The inputs of the left and right channels are combined in it. Or for the second channel it is necessary to make another similar indicator. The number of LEDs in the indicator (matrix) is 40 pcs. An indicator would look good, for example, on such matrices (10 LEDs each).

    4 such matrices are needed per channel. Choose the color of the glow to suit your taste. You can use single-color ones, or you can put the last one, for example, yellow or red) if the first ones are green).
    Or, for example, there are also such matrices of 20 LEDs. You need 2 of them per channel.



    Watch a demo video of how the peak indicator works. Here it operates in indication mode with peaks in a falling mode, the scale is logarithmic (resistors R11-R14 are missing, or the jumpers are removed).


    The indicator can also work in linear mode, with and without peak indication, also in running dot mode with and without peak indication. The peak indication itself operates in two modes - normal and falling. Normal - these peaks burn for 0.5 seconds and go out, falling - these peaks burn for 0.5 seconds and fall down (if the signal level is at at the moment became below the level that was 0.5 sec. back).
    The indicator diagram is shown below. The LEDs are used at a current of 3 mA, if you install more powerful LEDs at a current of 20 mA, then resistors R1-R8 must be replaced with resistors of 22-33 Ohms. R11-R14 are set depending on the required operating mode of the indicator. To quickly switch modes, you can install switched jumpers (“jumpers”) at the points of their connection with the common wire.

    Processor configuration (installation of fuses, fuses)

    CP:OFF, CCP1:RB0, DEBUG:OFF, WRT_PROTECT:OFF, CPD:OFF, LVP:OFF, BODEN:ON, MCLR:OFF, PWRTE:OFF, WDT:ON, OSC:INTRC_IO, IESO:OFF, FCMEN: OFF.



    The modes in which the indicator can operate are shown in the table below. They can be combined by installing or removing jumpers (resistors). Resistor R1 changes the sensitivity of the indicator, changes the voltage at pin 2 of the microcontroller, and the lower the voltage at the pin, the higher the sensitivity. The optimal voltage at the output is 200-250 mV.

    Table 1.Selecting display modes.

    Resistor
    jumper

    Absent

    Present

    Running line

    running point

    Logarithmic scale

    Linear scale

    With peak indication

    No peak indication

    Falling peaks

    Simple peaks


    Below in the archive there is a diagram, drawings of a printed circuit board, and microcontroller firmware.

    Figure 1.

    We present to your attention a two-channel (stereo) level indicator with a peak detector from Ondrej Slovak. This indicator was developed on the PIC16F88 microcontroller; it can also be assembled on the PIC16F1827 microcontroller and on the PIC16F819 microcontroller. The peak indicator firmware for all these types of microcontrollers is in the attachment (archived). The circuits are similar, only the firmware differs. We will consider a circuit with a PIC16F88 microcontroller.
    Levels and peaks are displayed in the indicator on two LED scales (rulers) of 16 LEDs each, 2 x 16.
    The modes in which the indicator can operate are shown in the table below; they are the same as in the previous diagram (indicator). They can be combined and combined by installing or removing jumpers. Resistor R1 changes the sensitivity of the indicator, changes the voltage at pin 2 of the microcontroller, and the lower the voltage at pin 2, the higher the sensitivity of the indicator. The optimal output voltage is within 200-250 mV.

    Table 1.Selecting display modes.

    The indicator scale operates in two display modes: linear and logarithmic (below in the figure). The linear scale is programmed in the program code, but the values ​​of the logarithmic scale can be changed at your discretion, or even made inverse logarithmic. This data is “hardwired” into EEPROM and can be changed.


    Figure 2.

    We'll look at how to change the EEPROM data values ​​yourself below.
    Figure 3 shows a “snapshot” of the EEPROM codes of the ISPROG program.


    Figure 3.

    At the top of the table, the lines circled in red are the (logarithmic) “ignition” values ​​of each LED (16 values), which correspond to the value of the logarithmic scale in Figure No. 2. This hexadecimal values vertical scale (from 2 to 248). You can build your own scale, for example an inverse logarithmic scale, and enter your values ​​in these cells.
    Further below we will analyze it in parts;
    03 - The first value is the LED glow time, the default is 12 ms (1 = 4.096 ms, that is, 03 = (4.096*3) = 12.228 ms)
    08 - This is the time the last LED is lit, default is 33 ms.
    08 - This is the decay rate of the peaks, the default is 33 ms.
    7A - This is the peak persistence time, the default is 500 ms. (7A = 122 * 4.096)
    64 - This is a correction for the brightness of the LEDs. For LEDs with a glow current of 2 mA - the value is 64, for LEDs with a glow current of 20 mA - set to 08.

    Watch a demo video of how the peak indicator works. Here it operates in display mode with peaks in falling mode, the scale is logarithmic (jumpers removed).

    The indicator diagram is shown below in Figure 4. The LEDs are used for a current of 3 mA, if you install more powerful LEDs, for a current of 20 mA, then resistors R1-R8 must be replaced with resistors of 22-33 Ohms, you can install SMD resistors on the board. To quickly switch operating modes of the indicator, switched jumpers (“jumpers”) are installed on the board.

    Configuration of the PIC16F88 processor (installation of fuses, fuses).
    CP:OFF, CCPMux:RB0, Debugger:OFF, WRT:Writable, CPD:OFF, LVP:OFF, BOREN:ON, MCLRE:I/O, PWRTE:Disabled, WDTE:ON, OSC:INTRC-I/O, IESO:OFF, FCMEN:OFF

    Configuration of the PIC16F1827 processor (installation of fuses, fuses).
    FOSC:INTOSC, WDTE:ON, PWRTE:OFF, MCLRE:OFF, CP:OFF, CPD:OFF, BOREN:ON, CLKOUTEN:OFF, IESO:OFF, FCMEN:OFF, WRT:OFF, PLLEN:OFF, STVREN: OFF, BORV:HI, LVP:ON

    Attached in the archive, there are also the initial parts of the asm codes for these processors, which indicate the processor configurations.

    *When designing and setting up his developments on microcontrollers, the author uses the PRESTO USB programmer and, accordingly, the accompanying software software ASIX company - ASIX UP program. Processor configurations are specified for this program.
    I repeated this design using the ExtraPic programmer and the icprog program. I did not install or control processor configurations. Immediately after the firmware, the circuits started working (I also mean the first circuit for 40 LEDs), I repeated it several times - everything started working immediately after the firmware.


    Figure 4.

    The indicator is assembled on a printed circuit board measuring 84 x 27 mm. Photo of the printed circuit board below in Figure No. 5. On the board there are resistors R1-R8 smd.


    Figure 5.

    Below, Figure 6 shows jumpers soldered on the board between the LED lines.


    Figure 6.

    Appearance collected indicator. The board contains flat LEDs, resistors R1 - R8 of the smd type, soldered to reverse side boards, from the side of the tracks.


    Figure 7.

    The printed circuit board of the indicator (in Sprint-Layout format is available in the archive) with the arrangement of elements is shown in Figure No. 8. The board does not indicate jumpers between the lines of LEDs, since they are located one above the other. The jumpers are soldered to places indicated by numbers 1 - 7, and first jumper No. 1 is installed in place 1-1, then jumper 2 is installed in place 2-2, etc.

    Figure 8.

    Below in the archive there is a diagram, drawings of a printed circuit board in Sprint-Layout format, firmware for microcontrollers PIC16F88, PIC16F1827, also added to the archive PCB in Sprint-Layout format with increased distance between rows of LEDs and designed for the installation of round LEDs, also firmware for the PIC16F819 microcontroller.

    If anyone has any questions about the design of the indicator, please ask.


    Sound indicators. Part two.

    Part 2. Discrete meters.

    Now the time has come to fulfill the promise. In this part of the article, we will consider devices that record only two signal level states: he is, or he's not there.

    1. Peak indicators.

    This type of indicator traces its origins back to the times of widespread use of magnetic recording. There, the main purpose of the device was to register exceeding the maximum recording level - “0” dB. A little later, this type of indicators began to be used in power amplifiers, and some speaker systems. In amplifiers, the peak indicator signaled that the limited signal level was exceeded (clip detector, or, more simply, a signal limit recorder), and in speakers it signaled that the supplied power was exceeded. So there is a place for such a detector today.
    The operating logic of the peak detector is indecently simple: as long as the input signal does not exceed a certain value, the LED at the device output does not light up. As soon as the AC voltage exceeds set level- the LED flashes. All that remains is to set this level, and the peak detector is ready for use.
    At the moment, there are a huge number of circuit implementations of such devices. First, let's look at the simplest one, shown in Fig.1.

    As can be seen from the diagram, everything is built on one transistor. Rectified by diode VD1 and “smoothed” by capacitor C1 alternating voltage supplied to the base of transistor VT1. If this voltage is lower than the voltage at the emitter, then the transistor is closed and the LED does not light. When the input voltage at the base exceeds 4 volts, the transistor opens and the LED lights up. It follows that the opening voltage of the transistor can be selected by selecting the zener diode VD2. By the way, the stabilizing circuit R3, VD2 can be replaced with a conventional resistive divider, but in this case the stability of the device reading will decrease, since the reference voltage will “float” a little. In any case, I recommend taking the total resistance of this divider in the range of 0.3 - 2 kOhm. Resistance R2 is used to perform the final calibration of the indicator.
    Figure 2 shows another of the simplest indicators. Its parameters are similar to the first one, but it is assembled on two CMOS logic inverters. The device response threshold is determined internal device microcircuits and is about 2 volts for K561LN1. IN original condition, when the input signal level is less than the threshold, a logical zero is present at the input of the first inverter. Therefore, the output of the inverters will also be zero, and R6 will be shorted to ground. The VD5 LED will not light up. When the input signal exceeds the threshold level, the inverters switch, and the output appears high level and the LED will light up.
    The advantages of the above schemes are their simplicity and, with low requirements for measurement accuracy, they are quite functional. The main drawback is the “not clear” operation of the LED, which is expressed in a change in brightness when the input voltage level approaches the operation threshold. To partially eliminate this drawback, in the circuit shown in Figure 2, two inverters are used in series.

    A further improvement to the circuit with transistors was the circuit presented in Figure 3. We see that another transistor VT2 and resistor R7 have been introduced. Actually, this is what should eliminate the unclear operation of the previous device. At the moment of switching, when transistor VT2 begins to open, its collector current flows in two directions: to the LED, and to the base of transistor VT1 through resistor R7. This speeds up the transfer of transistor VT1 to saturation and accordingly reduces the switching time.
    A more advanced device is presented in Figure 4. The peak detector is built on the basis of a comparator - a signal comparison device and is characterized by a small number of attached elements. The indicator works as follows: two voltages are supplied to the comparator inputs, inverting and non-inverting. For inverting - the reference, specified by the dividers R11, R12, and for non-inverting - received from the detector. As long as the voltage at the non-inverting input does not exceed the reference voltage (voltage at the inverting input), the comparator is in the off state. That is, at the output of the op-amp there is low level, LED2 indicator does not light up. As soon as the input voltages are equal (the voltage at the non-inverting input is equal to the reference), the comparator “switches” in a stepwise manner. A high level will appear at the output and current will flow through the LED. Is this scheme good? Yes, it’s not even bad, but it has its own characteristics.
    1. Bipolar power supply. May create some difficulties when implemented in devices with “single-polar” power supply. But.
    2. Bipolar power supply allows you to effectively compare signals near the “zero” level. That is, we get a device with a very large measurement range.
    Again, due to the use of bipolar power supply, the output voltage of the op-amp changes abruptly from +Usupply to -Usupply. This is not always convenient. This is why diode VD2 is installed in series with the LED in the figure. Its purpose is to protect the LED from changing the switching polarity when negative voltage is supplied from the output of the op-amp to the LED.

    It is fundamentally unimportant to which input the reference and control voltage is applied. Only the logic of the LED operation will be mirrored.

    All sorts of things: As noted above, due to the large measurement range, using this scheme it is possible to make a “silence indicator” (“pause indicator”). The LED will light up when there is a signal and go off when the signal will disappear. What's the use of this? Well, for example, a comparator, as a sensor, can be connected to a device with a time delay, and it, in turn, will disconnect the amplifier from the network.

    Promote quality characteristics and reliability is possible if you use not an operational amplifier as a comparator, but a specialized device. The most common and accessible of the Soviet microcircuits of this kind was the K554 CA3A. This is a device originally designed for use as a comparator. In terms of internal circuitry, the device is similar to an operational amplifier, but differs from it mainly in the presence of an additional stage at the output for pairing the comparator output levels with the logical levels “0” and “1” digital devices(TTL and CMOS logic). Physically, the output stage is a transistor, which allows you to turn it on according to a circuit with common emitter(with a collector load), and according to the emitter follower circuit. Those who want to get acquainted with this device in more detail should read the literature, but I will add one more feature on my own: this device can be powered either from a bipolar power supply, preserving all the benefits of such a connection, or from a unipolar power supply. Which undoubtedly adds advantages to this device. Unfortunately, with a unipolar power supply, the lower limit of the comparing signals starts not from “zero”, but from 0.5V. This slightly reduces the measurement range, but in most cases this is not necessary.

    In conclusion, let's consider a peak detector built on specialized chip K157HP1.
    Basic technical data of the microcircuit:

    Supply voltage

    Current consumption

    Output current to indicators

    Output reference voltage

    ARUZ system response threshold

    Output current of the ARUZ system

    Power dissipation

    Discriminator voltage

    The microcircuit was developed in a line intended for magnetic recording equipment, but it can also be successfully used as separate device. Inside the case there are three functionally independent units: two peak discriminators with LED current amplifiers and a unit that generates voltage to control the ARUZ elements. Of course, we don't need the latter.
    Figure 5 shows circuit diagram peak detector built on the basis of K157ХП1.

    As you can see, the diagram is very simple and contains a minimum number of parts. The only thing that can be said is about electrolytic capacitors. Their capacity determines the display time constant.
    The next step in the development of peak indicators was an increase in the number controlled levels. In addition to the main indicator, they began to install another one (less often two). Their purpose is to signal that a value is approaching a threshold value. Typically the range was set within -3 - -6 dB. Installed in speaker systems, such indicators indicated the supplied power. Structurally, such devices consisted of several circuits connected to one measured point. Each cell of such an indicator is calibrated to the corresponding voltage or power value.

    The subsequent development of the schemes discussed above was discrete level indicators. They have already allowed to control everything sound range. At the moment, these are the most advanced devices, and we will look at them in the next article.

    As usual, we add up the questions.

    What do you think of this article?

    Indicator on LM3915

    LM3915 integrated circuit is specially designed to build LED indicator level and allows you to visually assess the level and change sound signal in the form of a light “column”, “ruler” or a luminous point moving on a conventional scale. The successful design of the LM3915 chip has ensured its worthy place in LED indicator circuits. The wizard invites you to assemble a sound indicator using LM3915 and 10 LEDs. Below is detailed instructions for assembling a sound indicator circuit with your own hands with photos and video illustrations. Even a novice electronics engineer can assemble a sound indicator.

    How to assemble an LED level indicator on LM3915 with your own hands

    The design of the LM3915 microcircuit consists of ten similar types enclosed in a package operational amplifiers comparators. The direct inputs of the amplifiers are connected through a line of resistive dividers selected so that the LEDs in the amplifier load are turned on according to a logarithmic dependence. The return inputs of the amplifiers receive input signal, which is generated by the buffer amplifier (pin 5). The design of the microcircuit also includes an integrated stabilizer (pins 3, 7, 8), as well as a key for setting the operating mode of the indicator (pin 9). The microcircuit has a wide supply voltage range from 3 to 25 Volts. The reference voltage value is set in the range from 1.2 to 12 Volts by external resistors. The indicator scale corresponds to a signal level of 30 dB in 3 dB steps. The output current is adjustable from 1 to 30 mA.

    Assembly of the indicator is simplified by purchasing a set of parts in the online store using the link https: //ali.pub/2c62ph . The kit includes a board, a microcircuit, LEDs and all the necessary wiring (resistors, capacitors and connectors).

    Set of parts “Sound level indicator for LM3915”

    Details of the “Sound Level Indicator for LM3915” kit

    The sound indicator circuit on the LM3915 is shown in the photo.

    Operating principle. A supply voltage of 12 Volts is supplied to the third pin of the LM3915. It is also supplied to the LEDs through the limiting resistor R2. Resistors R1 and R8 equalize the brightness of the red LEDs on the scale. Also, a voltage of 12 Volts is supplied to the jumper for controlling the operating mode of the indicator (pin 9). When the jumper is closed, the circuit ensures that only one LED lights up, corresponding to the signal level. When the jumper is open, the circuit operates in the “column” effect mode, the input signal level is proportional to the height of the illuminated column or the length of the line. The divider assembled on R3, R4 and R7 limits the input signal level. Fine tuning of the divider is carried out by multi-turn tuning resistance R4. Divider R9 R6 sets the offset for top level slide rule of the microcircuit resistance (pin 6). The lower level of the resistance slide rule (pin 4) is connected to the common wire. Resistor R5 (pin 7) increases the reference voltage and affects the brightness of the LEDs. R5 sets the current through the LEDs and is calculated by the formula: R5=12.5/Iled, where Iled is the current of one LED, A. The sound level indicator works as follows. At the moment when the input signal overcomes the lower level threshold plus the resistance at the direct input of the first comparator, the first LED (pin 1) will light up. A further increase in the sound signal will lead to the comparators being activated one by one, which will be indicated by the corresponding LED. According to the instructions, in order to avoid damage to the microcircuit, you should not exceed the 20 mA limit for the current supplied to the LEDs.

    Assembling the beep indicator

    We check the availability and ratings of parts.
    Resistances: R1, R5 R8 – 1 kOhm; R2 – 100 Ohm; R3 – 10 kOhm; R4 – 50 kOhm, any trimmer; R6 – 2.2 kOhm (560 Ohm); R7 – 10 Ohm; R9 – 20 kOhm. Capacitors C1, C2 – 0.1 µF. We decipher the resistor values ​​according to color code. See photo.

    To assemble the circuit you will need a low-power soldering iron, soldering flux, solder and side cutters. The assembly sequence may be different.

    1. We install the resistors on the board according to the nominal value and solder them, and also, according to the key drawn on the board, we install and solder the bed for the microcircuit.
    2. Similarly, we solder a variable resistor, capacitors, and connection sockets.

      Option 2 for installing LEDs on the level indicator board on LM3915

    3. We check the correct assembly and soldering, and correct errors if necessary.
    4. We insert the microcircuit into the crib using the key drawn on the board.
    5. We supply 12 Volts from the power supply.
    6. We send a signal from the telephone output of any gadget. If all parts are installed correctly and are in good working order, the circuit will work. Watch the video. The audio signal level at the input is set by trimming resistor R4. Watch the video.

    Placing the LM3915 chip on the crib comes in handy. The microcircuit has relatives LM3914 and LM3916 with linear and stretched scales. The microcircuits are absolutely identical in pinouts. Therefore, on the basis of this circuit, you can easily assemble a voltage, power indicator, or an indicator for monitoring any parameter.

    A set of parts for assembling an LED audio signal level indicator on the LM3915 can be purchased from the following link http://ali.pub/2z6xyo . If you want to seriously practice soldering simple structures, the Master recommends purchasing a set of 9 sets, which will greatly save your shipping costs. Here is the link to purchase http://ali.pub/2bkb42 . The master collected all the sets and they started working.

    Success and growth of skills in soldering.