Microcontroller control in ultra Electronic volume control with remote control Power amplifier remote control

The motorized potentiometer is not new for a long time, there are even ready-made devices on sale. The price for it can be said "cosmic" and is beyond the means of many radio amateurs, like me! 🙂
The idea itself is very interesting, because such a connection has many advantages - no interference from adjustments is introduced into the sound, it can be easily connected to the remote control, for remote control, the device itself can be used anywhere, replacing it with a conventional potentiometer!
But in addition to the pros, there are also disadvantages - For direct connection of the potentiometer to the shaft, only a stepper motor is suitable, for the usual one you need a gearbox! During adjustment, the sound of the motor will be heard, the motor must be controlled ...
However, with these disadvantages, there is still a lot of benefits from this type of regulator, and I will tell you further how I implemented it!

It all started with the fact that I had a lot of different motors, stepper and conventional ones:

I had to adapt them somewhere)) I did not touch the steppers, I will need them for other purposes, but I decided to twist the usual ones with a potentiometer to adjust the volume, since I had long wanted to adjust the volume with the remote control, for example, listening to the radio at work or watching a movie on the computer .. 🙂

It will not work to connect the motor directly to the potentiometer, the motor may not have enough strength to rotate the potentiometer shaft, or vice versa, the motor will have so much foolishness that it will turn the shaft completely in a split second! \u003d)
For this I needed a reducer! But it was difficult to make the gearbox on my own, I did not have materials ... Then my imagination went into battle ...
I went to a flea market, bought a cheap Chinese inertial machine for 10 hryvnia, removed a part that I really needed from it and tried to connect it with a potentiometer:

As you can see, the motor was "cut" in the very place where the inertial shaft stood, I removed the gear from it and put it on the motor axis, such a simple design came out!
The first tests were great! The motor precisely turned the knob of the resistor, but it still rotated it comparatively quickly ... That's when I needed a control circuit, but more on it later ...
Then I bit off with nippers unnecessary parts of the axis of such a gearbox and with the help of a file I grinded off one part "under a screwdriver":

The mount turned out to be very strong, the Chinese did not save on material for the axle))
Actually what happened in the end:

The dimensions came out relatively small ... I fixed the gearbox on a piece of PCB with hot melt glue (a cool thing, by the way, very useful for household chores) and the potentiometer was simply soldered to the PCB by the case!
Then I took up the motor control circuit ... I needed an indication of the volume level, since the device would be inside the case, you need to see what position the regulator is in, it would be very bad at night to turn on the amplifier at maximum volume! 🙂

Here is such a schematic came out:

The variant is of course "raw" but in practice everything works very well!
In short, I'll tell you how IT works:
A twelve-step indicator is assembled on transistors, which performs two functions - a volume level indicator (when the volume control key is not pressed) and showing the volume status for a couple of seconds after pressing a key louder or quieter and switching back to the level indication mode!
The motor control circuit itself is assembled on the "555" timer which generates pulses to control the motor, communication with the motor occurs using the "H" bridge, assembled on powerful transistors (which I had and I used, but I only had TIP100 and TIP106) ... The transistors in the bridge which I used:

The driver always generates pulses, but in order to choose which direction to rotate the motor, we need to close one of the pairs of transistors by applying one to any of the inputs (L or R)! If you connect an IR receiver to these inputs, as for example from the article about the past "Amplifier with remote control", then the volume can be adjusted with any remote control! I additionally put two buttons on the body, well, it's not always the same to use the remote control! 🙂
It may be necessary to use an additional amplifier for the input of the level indicator (LINE IN input), since on the mp3 player it did not have enough volume even at maximum to show the level, but from the computer it worked at full ...
Also on the diagram there is an approximate drawing of how this system is connected!
According to how many scheme I assembled from scratch, I decided to do everything with a body kit first ... This is how my "H" bridge and the whole device looked like:

It's scary, of course, I don't argue, but it works \u003d))))
Later I made a printed circuit board for him, which I posted on the forum ... Immediately I say - I did NOT check it, I did it in haste and there may be errors in it! I would be grateful to whoever checks it! 🙂

Despite the terrible appearance, the device works very well, smoothly adjusts the volume, in combination with the remote control it turned out very conveniently!
And finally, I will give a video:
In the video, it may seem that the volume is adjusted sharply, this is due to the fact that I connected the test amplifier (on the TDA8563) directly through the potentiometer to the computer! When connected via a tone block, the adjustment is much smoother!
First, the video shows the indication of the volume status, I close the "Louder" contact and the indication goes into the volume level mode, the LED strip fills, after a couple of seconds when I release the contact, the indication returns to the signal level display mode (VU Meter). I turn on the amplifier, give a signal ... For tests, I used an amplifier on the TDA8563 and a car speaker, which, by vibration, turned everything on the table for me! 🙂

In this article, we will look at an electronic volume control circuit with remote control and digital level indication.

Fig. 1. Front of the device


Fig. 2. Back of the device

The volume is increased by a button or remotely from the remote control (infrared control). Almost any home remote control will work.

The device diagram is shown in Figure 3.

Fig. 3. Electrical schematic diagram

Sound level switching is based on CD4017 decimal counter (DD1). This microcircuit has 10 outputs Q0-Q9. After power is applied to the circuit, a logical one is immediately present at the output Q0, the HL1 LED is on, indicating a zero sound level. Resistors R4-R12, which have different resistances, are connected to the rest of the Q1-Q9 outputs.
Let me remind you that the microcircuit at the same time gives out a high-level signal only at one of its outputs, and sequential switching between them occurs when a short pulse is applied to the input (pin 14).
Based on this, the resistances in the group of resistors R4-R12 are selected in descending order (from top to bottom according to the diagram), so that with each switching of the microcircuit, more and more current flows to the base of the transistor VT2, gradually opening the transistor.
A signal from an external ULF or sound source is fed to the collector of this transistor.
So, by switching the counter microcircuit, we, in fact, change the collector-emitter resistance and thereby change the volume of the sound coming to the speaker.
The resistances of the resistors depend on the gain of the transistor (h21e). For example, when using a 2N3904, the resistance of the resistor R4 can be about 3 kOhm, in order to slightly "open" the transistor, while the sound will be at the quietest level. And the resistance R12 should be the smallest of the entire group (about 50 Ohms) to ensure the saturation mode and the maximum collector-emitter bandwidth, respectively, the maximum volume of this regulator.
It is difficult for me to indicate specific ratings for R4-R12, since it still very much depends on the power of the audio signal applied to the transistor, as well as on the power supply. It is best to use multi-turn trimming resistors and adjust the steps "by ear".

At the bottom of the diagram is an indication unit based on the K176ID2 (DD2) decoder. It is designed to control a seven-segment indicator.
A binary code is fed to the inputs of the decoder, therefore an encoder is built on the VD1-VD15 diodes, which converts the decimal signal from CD4017 into a binary code understandable for K176ID2. Such a diode circuit may seem strange and archaic, but it is quite workable. Diodes should be selected with low voltage drop, such as Schottky diodes. But in my case, ordinary silicon 1N4001 was used, they can be seen in Figure 2.
So, the signal from the counter output goes not only to the base of the transistor, but also to the diode converter, turning into a binary code. Next, DD2 will accept a binary code and the required number will be displayed on the seven-segment indicator showing the sound level.
The K176ID2 microcircuit is convenient in that it allows the use of indicators with both a common cathode and a common anode. The scheme uses the second type. Resistor R17 limits the segment current.
Resistors R13-R16 pull down the decoder inputs to minus for stable operation.

Now let's look at the top left side of the diagram. DIP switch SA1 sets the volume control mode. In the upper (according to the diagram) position of the SA1 key, the volume is changed manually by pressing the SB1 tact button. Capacitor C3 eliminates contact bounce. Resistor R2 pulls down the CLK input to minus, preventing false alarms.
After power is applied, the HL1 LED is on, and the indicator shows zero - this is the silent mode (Figure 4, top).


Fig. 4. Displaying levels on the indicator

By pressing the tact button, the speaker volume increases in small jumps from the 1st to the 9th level, the next press again activates the silent mode.

If you set the switch to the lower (according to the diagram) position, then the DD1 input is connected to an infrared remote control circuit based on a TSOP receiver. When an external IR signal arrives at the TSOP receiver, a negative voltage appears at its output, which unlocks the transistor VT1. This transistor is any low-power, PNP structure, for example KT361 or 2N3906.
I recommend choosing an IR receiver (IF1) with an operating frequency of 36 kHz, since it is at this frequency that most remotes (from a TV, DVD, etc.) work. When you press any button on the remote control, the volume will be controlled.

The circuit contains a latching button SB2. As long as it is pressed, the RST reset pin is connected to the power supply minus and the counter will switch. Using this button, you can reset the counter and volume level to zero, and if you leave it in the off position, the reset pin will not be pulled down to minus and the counter not will receive signals from the remote control, and not will respond to pressing the SB1 button.


Fig. 5. Switches, tact button and TSOP receiver with harness are brought to a separate board

I send the audio signal to the regulator transistor from an amplifier on a PAM8403 microcircuit. The VT2 collector is connected to the positive output of one of the amplifier channels (R), and its emitter is connected to the positive terminal of the column (red wire in the photo). The negative terminal of the speaker (black-red) is connected to the negative of the channel in use. The sound source in my case is a mini mp3 player.


Fig. 6. Device connection

Why are trimmer resistors used?
I would like to draw your attention to the photo of the back of the device (Fig. 2). It shows that there are three trimming resistors R4, R5, R6 for 100 kOhm. I implemented only three volume levels because the rest of the resistors (R7-R12) did not fit on the board. Trimming resistors allow you to adjust the volume levels for different sound sources, because they differ in the strength of the audio signal.

Disadvantages of the device.
1) Volume control occurs only up in level, i.e. only louder. You will not be able to subtract immediately, you have to reach the 9th level and then return to the initial level again.
2) Sound quality deteriorates slightly. The greatest distortion is present at quiet levels.
3) Does not control the stereo signal. The introduction of a second transistor for one more channel does not solve the problem, since the emitters of both transistors are combined to negative power, resulting in a "mono" sound.

Improvement of the circuit.
You can use a resistor optocoupler instead of a transistor. A fragment of the circuit is shown in Figure 7.


Fig. 7. A fragment of the same circuit with an optocoupler

A resistor optocoupler consists of a light emitter and a light receiver connected by optical coupling. They are galvanically isolated, which means that the control circuit should not interfere with the audio signal passing through the photoresistor. The photoresistor under the influence of the light of the emitter (LED or the like) will change its resistance and the volume will change. The optocoupler elements are galvanically isolated, which means you can control two or more audio signal channels (Fig. 8).


Fig. 8. Control of two channels with resistor optocouplers

Resistors R4-R12 are selected individually.

The device can be powered from USB 5 Volts. When the voltage rises, the resistance of the current-limiting resistor R17 should be increased so that the seven-segment indicator HG1 does not fail, and the resistance R1 should also be increased to protect the TSOP receiver. But I do not recommend exceeding the supply voltage above 7 Volts.

There is a video for this article, which describes the principle of operation, shows the structure assembled on the board, and a test of this device.

List of radioelements

Designation A type Denomination number NoteScoreMy notebook
Components for the circuit (fig. 1)
DD1 Special logic

CD4017B

1 Decimal counter Into notepad
DD2 Chip. DecoderK176ID21 Into notepad
VT1 Bipolar transistor

2N3906

1 Any low power PNP Into notepad
VT2 Bipolar transistor

2N3904

1 CAN KT3102 Into notepad
VD1-VD15 Schottky diode

1N5817

15 Into notepad
C1 47 - 100 μF1 Into notepad
C2 Ceramic capacitor0.1 uF1 Into notepad
C3 Electrolytic capacitor1 - 10 μF1 Into notepad
R1 Resistor

100 ohm

1 Into notepad
R2 Resistor20 - 100 kΩ1 Into notepad
R3 Resistor100 - 300 Ohm1 Into notepad
R4-R12 ResistorPick up9 Pick up

Organization volume control in high-quality equipment has always been an important and not an easy question. The potentiometer used for this must have a high channel identity (for paired potentiometers), good wear resistance, and the absence of extraneous sounds (rustling and crackling) during adjustment. Today, conventional variable resistors are being replaced by wafer switches, relay circuits or integrated circuits. With significant cost and complexity, such options, while solving some problems, give rise to others. Therefore, many sound lovers still prefer the "old fashioned" potentiometers.

Having set a goal - to find a high-quality potentiometer for your amplifier, you will certainly and rather quickly come across the company's products ALPS... Indeed, their products are used in expensive devices and have high performance at a reasonable price. ALPS manufactures both conventional and motorized potentiometers. It is the latter that allow you to adjust the volume using remote control... You just need to connect the control circuit.

This article presents a circuit that allows you to remotely control motorized potentiometers. ALPS, as well as switch the five inputs of the amplifier using a standard remote control operating under the RC-5 protocol.

One microcircuit.

Apart from the supply voltage regulator, the circuit contains only one microcircuit - this is an ATmega microcontroller from Atmel, which is responsible for decoding signals of the RC-5 standard, generating signals for controlling the motor and control signals for the input switch relay.

The schematic diagram of the device is shown in the figure:

click-to-zoom

The scheme is quite simple and does not require detailed explanations. Let us dwell only on some important points.

The PD2-PD6 ports via the K3 connector can be used to drive the preamplifier input switcher relay.

The pins of the PC and PB ports are connected in parallel to increase the output current. They are used to control the potentiometer drive through the K1 connector. The maximum motor current according to the ALPS documentation is 150 mA. The maximum current of the microcontroller port according to the Atmel documentation is about 40 mA. By paralleling 6 outputs, we can get a control current of more than 200 mA.

To indicate the rotation of the engine, LED D1 is switched on in parallel. Here it is necessary to use a two-color LED and by the color of the glow it will be clear in which direction the engine is rotating. If desired, it can be displayed on the front panel of the amplifier.

The structure can be powered from a separate transformer, which is connected to the K5 connector. Or by constant voltage from the power supply of the amplifier itself. In this case, voltage is supplied to the board through the K4 connector, and elements B1 and C10-C13 can be omitted.

Design.

The figure shows the location of the elements on the printed circuit boards of the device:

The design is divided into two parts for easy placement in the amplifier cabinet. The motorized potentiometer itself is located on one board. This board is mounted just next to the front panel of the amplifier.

The second board contains the power supply, microcontroller and other elements of the device. It is advisable to place this board in the amplifier case as far as possible from the audio circuits and, if possible, to shield it to reduce the radiated noise.

The receiver of the IR signal must also be placed on the front panel of the amplifier by connecting it to the board with a three-wire cable. With a long loop length, to eliminate unstable and false alarms of the receiver, it is necessary to duplicate the capacitors C2 and C3 by soldering them directly to the receiver terminals.

All connections of the structure are realized with connectors, which are interconnected by loops with the appropriate number of cores.

The potentiometer PCB has contacts for connecting the shield of the signal cable and the shield of the motor control cable, if necessary.

A photo of the finished structure is shown in the figure:

click-to-zoom

Signals for transistor control switches of the input switch relay are removed from the K3 connector. To switch inputs on the remote control, use number buttons 1 ... 5. This way you can directly select the desired input. To switch inputs, the "up / down" channel buttons are used sequentially on the remote control.

Important note.

The author tested his development with a remote control from Philips devices. It is clear that not every home has this well-known brand, so attempts have been made to test the compatibility of other remotes. A universal EuroSky 8 remote control turned up under the arm (in the photo it is black on the right):


This remote was good at controlling various devices in the house, but when it was programmed to work with audio devices, errors were observed when working out auxiliary functions. It turned out that some remotes do not work correctly with the RC-5 standard.

The editorial board of the "Elector" magazine has modernized the software of this device in order to minimize errors when working with various consoles from different manufacturers. The tests carried out with the universal Philips SBC RU 865 remote control showed excellent performance. There shouldn't be any problems with other universal remote controls either.

If you have a remote control tester, use the table below to check if your remote control complies with the RC5 standard:


Here, as an example, the incorrect codes transmitted by the "EuroSky 8" remote control are presented. The right column shows the correct command codes.

The article was prepared based on the materials of the "Elector" magazine.

Happy creativity!
Editor-in-chief of "Radiogazeta".


I made an SE amplifier on the GU-50 and, as usual, the question arose about the volume control. I didn't want to install a conventional joint venture, and it was also problematic to fasten the remote control (remote control). It is expensive to buy a potentiometer from a well-known company APLS, and our dealers do not have them.
Often I saw on the Web the circuits of regulators on resistive dividers, popularly called "Nikitin regulators".
Finally got around to try.

Attenuator circuit

The circuits presented in various sources had an adjustment step of 1 or 2 dB, and a maximum signal attenuation of 63 or 127 dB.

I decided to make an intermediate version with a step of 1.5 dB and an attenuation of 94.5 dB. The resistance of 10 kOhm for a tube amplifier is not enough, I counted it to 33 kOhm. It turned out 6 steps with resistors of the following ratings.

On various sites offering regulator designers, it is written about the criticality of the resistors used in the divider. It is strongly recommended to use the 0.5% row, at least 1%. I have enough resistors and I just selected the closest to the calculated ones, paying special attention to the symmetry between the channels. Example: according to the calculations, a resistor of 9.638 kOhm is needed, picked up 9.653 and 9.654 (for 2 channels).

The requirements for the relay are also not feeble. I took a relay from an old mini PBX, a 24 volt Alcatel relay with 2 contact groups.
Well, they just are.

The functions of my control unit

In terms of functionality, the volume control has evolved into a control unit with the following capabilities:
- IR remote control
- Volume control
- Power on / off amplifier
- Switching 4 inputs
- switching 2 speaker systems
- Switching indicator mode (output voltage / anode current)
- Delay the inclusion of anode voltage
- Forced on / off the anode voltage from the remote control

BU scheme

When developing the circuit, I wanted to make the relay control static, without high-frequency circuits. For this, registers are used, and the indication circuit has already been used in my previous designs. The microcontroller approached the resources PIC12F675.

I wrote the program in assembler from scratch, without other people's sidebars. The operation of the device is quite simple, we measure the voltage at the analog inputs (AN0, AN1), and depending on their value, we turn on the necessary relays. At the same time we listen to the digital port GP3 \u200b\u200bfor the presence of a parcel from the IR remote control. We set the data to the GP2 output, and strobe through the GP4 and GP5 ports to the desired pair of registers.
Each time a bit is changed, write 2 bytes in sequence. Chains R25, C8, R28 filter high-frequency interference when writing to registers. Recording time 192 μS.

BU design and details

The device is structurally divided into two parts.
The display unit, on which the controller is installed, is located on the front panel.

The relay module is located near the inputs.

Printed circuit boards are made by LUT technology. On the divider board, the top foil layer is left as a shield.

In the design, you can use a relay for a different voltage, respectively connecting to another power supply. Transistors can be replaced with similar ones, but it must be taken into account that a diode is built into the KT972. Registers IR23 can be of the 155, 1533, 555 series, imported 74S374 or, if the board is changed, IR8 of the 155 series, etc. The peculiarity of IR23 is its high load capacity.
I used a KRT-30 IR receiver. You can use any other brands, the main thing is that the modulation frequency of the remote control matches the frequency of the receiver, otherwise the range of the remote control can be greatly reduced.

Power Supply may differ from the one indicated. My standby voltage of 15V is stabilized at 12V, it is also used to power the display unit, and 24V is taken from the main transformer of the UZCH. The relay for turning on the amplifier is designed for 12V and is powered by the power supply on duty.

Separately, I will say about the power supply of the divider and input selector relay: it must be well stabilized, so a relay for a higher voltage is better suited (less current consumption).

The switch of the selector of inputs, outputs in the diagram is shown under the biscuit switch, you can also use a variable resistor (similar to the volume control).

Regulator operation

After turning on the power switch, the amplifier is in standby mode, the indicator shows "-".
To turn it on, turn the volume knob or change the position of the input selector, the indicator displays the attenuation value in dB "32" (for example, it corresponds to the position of the volume control).
The anode voltage relay switches on after about 70 sec. Then we adjust the volume, switch the inputs, i.e. manage as we wish.

The following functions are available from the remote control:
0 - power on / off
1 - volume [+]
2 - volume [-]
3 - switching inputs on the ring [+]
4 - switching outputs
5 - switching indicator mode
6 - switching inputs on the ring [-]
7 - mute button
8 - turn off / on the anode
9 - not used

Remote control training

Constant use of the previous design revealed a lack of attachment to a particular remote control, so here I made a learner remote control.
You can use the consoles of the popular NEC protocols, RC-6, RC-5.

With the device turned off completely, we bring the volume to the maximum attenuation, and the switch to the 2/4 (maximum) position.
Turn on the device, within 3 seconds, press any key on the remote control.
If the remote control fits, then the indicator lights up "H0" - it is suggested to select the first key (from the list above), press.
The block receives the code, "H1" is displayed on the indicators, etc. Digit - function number from the list. Unnecessary functions can be filled with any buttons already in use.

If within 3 seconds after switching on the key on the remote control is not pressed or the remote control does not fit according to the protocol, then the device goes into standby mode.

When the amplifier is turned on, the initial settings (volume, inputs, outputs) are taken from the position of the knobs on the front panel.
When programming, you can safely press the buttons for 1 second or more (repetition is not processed).
If desired, having read the data of the controller's non-volatile memory by the programmer, we will see the key codes - the two most significant bits of the device code.

Simplified version

For those who only need a volume control, here is a simplified diagram.

You can program two remote control buttons without an indicator. We transfer SA1 to the open state, the volume control to the maximum attenuation position, turn on the power, press any button on the remote control for 3 seconds.
If the remote control is suitable, then when switching SA1, all relays remain off (maximum attenuation).
We program the buttons themselves, press 1 time any unused button, and then
1 - volume [+]
2 - volume [-]
Now turn off the device, or press any key on the remote control 7 times. All buttons are programmed.

results

The work of the regulator completely satisfied me, the volume is adjusted smoothly and in small steps. In the headphones, you can hear the switching of the relay (a weak rustle only at the moment of regulation), in the AC the regulation is practically inaudible.
The indicator shows attenuation in decibels, which is very practical.
The measurements showed a completely linear frequency response, no distortion of the signal shape, the attenuation error over the entire control range does not exceed 0.25 dB, the channel asymmetry is extremely small.
The device succeeded.

Files

In the archives there are files: diagrams, printed circuit boards (for a complete circuit), MK firmware (NEC protocol), MK firmware (RC-6 protocol), additional materials.

A bit of history

This design appeared after I assembled the famous OM 2.5 amplifier. Naturally, the question arose of choosing a volume control, protection and other service functions. Of course, I also wanted to have a digital input and remote control, but this seemed like a completely inaccessible space. I had never done any programming of controllers or designing electronic circuits before. However, as they say, the road will be mastered by the one walking, and the Atmega16 controller with the PGA2311 volume control microcircuit settled on the breadboard. As a result, I was so carried away by the process that it was very difficult to finish the project. While there was free memory and controller legs, ideas for expanding functions and adding new modules appeared. Boards for all modules were originally wired in DipTrace and manufactured by ourselves using a photoresist. Then I tried to order some of the boards in production. Therefore, in the photo there is a prefabricated hodgepodge of blue homemade and green factory boards. So, in this article I tried to describe what I ended up with.

System functions.

  • Soft start, delay adjustable from 0 to 30 sec.
  • Delay for turning on the AC, adjustable from 0 to 30 sec.
  • Remote control NEC standard with remote control from the menu system
  • AC switching using protection cards: zones A / B (button, remote control), left / right (remote control) or simply on / off.
  • Input selector control for 4 inputs (buttons, remote control)
  • Volume and balance control using the PGA23XX microcircuit or Nikitin's relay RG (encoder, remote control)
  • Matyushkin tone control with relay control of LF and HF (encoder, remote control)
  • Control - transfer of commands to stop / start / rewind / tracks (remote control)
  • Thermal control on a digital sensor LM75, one or two channels, shutdown when overheating, turning on fans
  • On / Off Buttons, Speaker Toggle, Four Input Selector and Mute Buttons
  • Adjusting the brightness of the screen backlight (remote control)
  • Screensavers: blanking, level indicator and spectrum analyzer

System composition and configuration.

The system consists of a controller with a 4x20 character display installed on the front panel and several executive modules. The display is installed in parallel to the controller board on four racks and is connected to it with PLS-PBS connectors, resulting in a fairly compact "sandwich" 12 mm high. All connections are made around the perimeter of the controller board using angled XH connectors.

The modules carry out the necessary adjustments / switching and are installed in the amplifier case, taking into account the minimization of the length of the signal circuits:

  • Volume control based on PGA23XX with an input selector for 4 inputs and a connector for a USB-DAC PCM2705
  • Nikitin's volume control
  • Input selector for 4 inputs (for use with Nikitin's RG)
  • Matyushkin tone control with relay control of bass and treble
  • AC protection against constant voltage with switching two zones A / B
  • Thermo sensors
  • Standby power supply unit with input filter and soft start control

The configuration of the modules used is determined by a dip switch on the controller board. It is read when power is applied to the controller and determines the algorithm for the further operation of the system:

The volume controls, tone block and input selector are connected to the SPI controller bus in series; for this, the modules have Control IN and Control Out connectors. When using RG Nikitin, two such modules can be connected to adjust the balance. This allows you to flexibly configure the control system for a specific device. The range and step of volume control for PGA23xx and RG Nikitin can differ significantly, therefore they are set in the system setup menu. Important - the firmware does not check the entered values \u200b\u200bfor adequacy, therefore, you should not set the maximum volume of + 32db for Nikitin's WG. All possible options for connecting modules to the SPI bus:

  • controller -\u003e
  • controller -\u003e TB Matyushkin -\u003e RG on PGA23XX with input selector and DAC
  • controller -\u003e RG Nikitin -\u003e input selector
  • controller -\u003e RG Nikitin -\u003e RG Nikitin -\u003e input selector
  • controller -\u003e TB Matyushkina -\u003e RG Nikitin -\u003e input selector
  • controller -\u003e TB Matyushkina -\u003e RG Nikitin -\u003e RG Nikitin -\u003e input selector

Thermo sensors are connected to the controller via the I2C bus. Their presence and quantity is also set by a dip-switch. There are three options - thermal control is disabled, one sensor or two sensors are used for each amplifier channel. If the thermal control is on, you can set the maximum temperature at which the device will turn off. The temperatures of airflow on and off are also adjusted. When using two thermo-sensors, it is possible to organize an independent blowing of each channel.

Indication.

All information is displayed on a 4x20 character display on the well-known HD44780 controller. The first line indicates the state of the AC switch. The same line displays the temperature of the radiators, obtained from the thermo-sensors, when it exceeds the temperature for switching on the blowing. The second line displays the RG attenuation in decibels. The third line is the state of balance. When adjusting the bass or treble, their status is also displayed in this line instead of balance. The last line displays the names of the inputs and the current input.

Another indication organ is the LED. It glows when the system is connected to the network and in standby mode. When turned on, it goes out and indicates by blinking the receipt of commands from the remote control.

If no controls are used for a certain period of time, the screen may switch to screen saver mode. The simplest is to dim the screen backlight. If you connect an input or output audio signal to the corresponding inputs of the controller, you can use the screensavers “Level Meter” or “Spectrum Analyzer” based on Fourier transform.

Control.

For control, use is made of non-latching buttons that close the corresponding controller inputs to ground, an encoder with a button, and a remote control with NEC protocol. The encoder controls the volume control. When you press its button, the encoder sequentially switches to adjust the balance / bass tone / treble tone. The symbols corresponding to the current mode flash on the screen. Only a minimal set of commands is implemented on the buttons and the encoder, the full functionality of 26 commands is available only from the remote control. Some functions, such as changing the volume, support receiving autorepeat commands from the remote control (when the remote control button is held down). For functions such as On / Off, autorepeat is intentionally disabled - to repeat the command, press the remote control button again.

The minimum required kit for starting and configuring the system is a power button, an encoder and a remote control. When the controller is powered up, it will be in standby mode. A long press on the power button (from 2 seconds) switches the controller to the setting mode. In this case, only the screen turns on, the soft start relays remain off. Moving through the setup menu and changing parameter values \u200b\u200bis carried out by rotating the encoder. To select menu items, enter editing and confirm a selection, press the encoder button.

You can simply enter the remote control command codes in the corresponding setup submenu if you know them. But it's easier to read them from the existing remote control. To do this, you need to enter the code editing of the desired command and press the corresponding button on the remote control. If the controller was able to accept the command, it will blink the standby LED and enter the code in the edit field. To confirm the code, all that remains is to press the encoder. All configurable parameters and commands are shown in the table below:

System General system settings
Lcd Brigtness Display brightness, 0-16
Speaker Delay Delay for turning on the AC, 0-30 sec.
SS Delay Duration of Soft start, 0-30 sec.
ScreenSaver Screensaver: off-disabled, LcdOff-reducing the brightness of the screen, Level-level indicator, Spektr-spectrum analyzer
SaverDelay Screensaver activation time: 5-100 sec.
Volume Adjust volume and balance controls.
Volume Min Minimum volume: -94db - -64db
Volume Max Maximum volume: -32db - -32db
Volume Step Volume control step: 1-4db
Balance Balance adjustment range: 4-16db
Selector Selecting Input Names Displayed on Screen
In1 Login name 1
In2 Login name 2
In3 Login name 3
In4 Login name 4
TermoControl Setting up thermal control
Power OFF Shutdown temperature: 60-90 degrees
Cooler ON
Cooler OFF Blow off temperature: 40-70 degrees
Remote Remote control codes
System Console system code common to all commands
On On / Off
Enter Analogue of pressing the encoder button
Vol + Increase the volume
Vol- Decrease volume
BalLeft Balance left
BalRight Balance right
Bass + Boost Bass
Bass- Reduce bass
Treb + Increase HF
Treb- Reduce bass
In1 Input selection 1
In2 Input selection 2
In3 Input selection 3
In4 Input selection 4
In + Next entrance
In- Previous Login
SpeakerNext Next speaker. Switching is done depending on the configuration, On-\u003e Off or A-\u003e B-\u003e Off
SpeakerPrev Previous AC. Switching is done depending on the configuration, Off-\u003e On or Off-\u003e B-\u003e A
Speaker L / R Speaker switch right / left / both
DacPlayPause HID command for USB DAC - play / pause
DacStop HID command for USB DAC - stop
DacNext HID command for USB DAC - next track (short press) / fast forward (long press)
DacPrev HID command for USB DAC - previous track (short press) / rewind (long press)
Bright + Increase display brightness
Bright- Decrease display brightness
Mute Decrease volume temporarily to Volume

Controller circuit

Power is supplied through a protective diode D1 and a 5V stabilizer U1. Keys Q1 and Q2 control the soft start relay. R9 adjusts the contrast of the display, for a blue backlit screen on the third leg of the X9 connector, set the voltage to about 0.85-0.9V. Q3 is a PWM key for dimming the display backlight.

All buttons and the S1 configuration dip switch are connected to the controller via the I2C bus using the PCF8574 port extenders (U3, U4). Pressing any button causes interruption on the PB2 leg of Atmegi and, as a result, interrogation of U3 for the code of the pressed button. The encoder (x6) and IR receiver (PH1) are also connected to the controller's legs, which support external interrupts - PD2 and PD3.

The operational amplifier U5 is used to feed the analog signal of the left and right channels to the ADC inputs. Based on the data received from the ADC, the functions of the level indicator and spectrum analyzer are implemented. The ADC inputs operate with a signal in the range of 0-5V, so the audio signal needs to be amplified / attenuated to an amplitude of 2.5V and a DC component of 2.5V should be added. The gain is determined by R15 / R19 and R16 / R20. R17 and R18 provide the required 2.5v offset. U5 must be Rail to Rail on input and output and operate on 5v supply. When tuning with resistors R13, R14, it is necessary to achieve the maximum possible amplitude of the analog signal on PA6, PA7 (U2) without signs of a clip.

Firmware, Fuses, Modeling

The X2 connector is used for firmware. When flashing the controller, be sure to disconnect any modules from the X3 connector. After flashing the program, the file with Eeprom data is necessarily uploaded. When installing fuses, you must turn off the JTAG debugger (JTAGEN) and set the frequency to 8 MHz (CKSEL0, CKSEL1, CKSEL2, CKSEL3), everything else is default.

Attached to the article is a model of the controller in Proteus 8. With its help you can get acquainted with the controller, test functions, indications, control signals without assembling the device. I could not find the model of the digital thermometer LM75, so another similar sensor and firmware are used taking into account this replacement. To emulate the NEC remote control, a simple model and firmware was made, I found the encoder emulator model in an open project. The firmware of these models is included with the Proteus file.

Thermo sensor


Thermo-sensors are pressed against the radiators by the side with the microcircuit. On the other side of the board, jumpers set the addresses of the sensors on the I 2 C bus. The address of the left channel is 000, the address of the right one is 001. If one sensor is used, the address of the left channel is set. An important limitation is that the OS blower turn-on outputs are low-current, they can pass current up to 100 μA. This must be taken into account when connecting keys to the controller that control the fans.


Nikitin's volume control

The scheme used is inverse to the original - with the relays turned off, the weakening of the regulator is maximum. The shift register U1 receives data from the controller (X9) with volume. Its outputs are reinforced with Darlington switches with protective diodes U2, since register 74HC595 cannot supply the required current to all relays. In addition, thanks to the ULN2003A, it is possible to use relays not necessarily 5V. The relay coils can be powered from the controller board, but it is better to power them from a separate source, for this, the X11 connector is provided. If relays with more than 5V windings are used, external power is the only option. The choice of the power supply is set by jumpers J1 and J2.

When all relays are installed, attenuation up to -128 db and regulation step - 1db are provided. If the attenuation of -64db is sufficient, the K7 relay can be omitted. In this case, the output signal is taken from connectors X6, X8. It is possible to increase the regulation step up to 2db, for this it is enough not to install relay K1 and apply the input signal to connectors X2, X4.

Resistors R15 and R16 are needed to match the output impedance of the regulator with the input impedance of the amplifier. R15 is set if -64db output is used, R16 - for -128db output. The resistor rating is determined based on the output resistance of the RG 10 kOhm and the value of the input load resistance. If an input selector is not used, resistors R20, R21, R22 must be installed to connect the digital and analog ground. If there is an input selector, it is better to connect the grounds on its board.

The control circuit of the input selector is similar to that of Nikitin's RG, but with some simplifications. Since only one relay is on at any time, the current in register U1 is sufficient, and it was decided to abandon the ULN2003. Therefore, only 5V relays can be used in the input selector. When using conventional relays, jumper J1 is soldered. Jumper J2 is made for future experiments with bistable relays.

Nikitin's WG can be installed on the input selector. In this case, the analog inputs / outputs and the control bus are connected using PLS-PBS connectors. For this, the selector has two outputs per channel, corresponding to Nikitin's RG inputs with a regulation step of 1db and 2db. R1, R2, R3 connect analog and digital ground. A jumper on the J3 board allows you to connect the ground to the device case through a plated mounting hole on the board.

In the original TB Matyushkin circuit, high frequencies are regulated by a variable resistor. This did not fit into my design concept, so the resistor was replaced with a relay divider. But it was necessary to reduce the number of relays so that the adjustment of the LF, HF and the inclusion of the direct could fit into the 7 feet of ULN2003. The switching circuit for three relays, instead of four, I borrowed on. To minimize the board, we used Epcos 63v lavsan capacitors with a foot pitch of 5mm.

The relay switching control circuit is completely analogous to Nikitin's RG. The only addition is the X4 Direct output for an external tone control relay. The Direct relay turns on when all voices are set to 0. The controller does not yet have an additional Direct turn-on command, but it is not difficult to add it.



This is the first module from which the development of the controller began. PGA2311 (U2) for control consists of two eight-bit shift registers connected in series. Each register controls the volume of its channel. The microcircuit has a data output, to which another regular register U3 was connected. It controls four input relays. The remaining four legs of the register through a divider by 3V transmit USB DAC commands - play / pause, stop, rewind right / left, prev / next. track. This makes it possible to control the playback of playlists on the computer from the amplifier's remote control, which is quite convenient. The analog and digital power supply is separate and is carried out from three stabilizers - U4, U5, U6. Diode bridges and filters are installed on the board, you just need to connect a transformer. Instead of PGA2311, the PGA2310 microcircuit can be used, for this it is enough to replace the stabilizers U4 and U5 with similar ones with an output voltage of 12V. An important feature is that digital and analog power must be supplied synchronously. The design of the module assumes installation on the rear wall of the amplifier.

Instead of the first analog input, you can install a USB DAC PCM2706. I posted all the materials on it on. In this case, instead of the X1 RS-813 connector, a connector for 3 RS-613 inputs is installed. An additional filter for the DAC is made on the operational amplifier U1. In addition, it boosts the DAC output to a standard 1.2v.

Measurements

The quality of the modules after assembly was checked using measurements by the program. An EMU-0404 was used as a sound card. Thanks to this, I was able to find and fix some errors in the PCB layout. I will not clutter up the article with pictures with measurement results, they are attached to the project files. In general, we can say that the noise and harmonics of the modules are on the verge of the measuring capabilities of the EMU-0404.

List of radioelements

Designation A type Denomination number NoteScoreMy notebook
Controller
U1 Linear regulator

LM7805

1 Into notepad
U2 MK AVR 8-bit

ATmega16

1 Into notepad
U3, U4 I2C interface IC

PCF8574A

2 Into notepad
U5 Operational amplifier

LMC6482QML

1 Into notepad
Q1, Q2 Bipolar transistor

MMBT3904

1 Into notepad
Q3 Bipolar transistor

BC807

1 Into notepad
R1, R2 Resistor

1.8 k Ohm

1 SMD 1206 Into notepad
R3, R4, R5, R17, R18, R19, R20, R21, R22 Resistor

10 kΩ

9 SMD 1206 Into notepad
R6, R8 Resistor

100 ohm

2 SMD 1206 Into notepad
R9 Trimmer resistor

10 kΩ

1 3296x Into notepad
R10, R11 Resistor

4.7 k Ohm

2 SMD 1206 Into notepad
R12 Resistor

10 ohm

1 SMD 1206 Into notepad
R13, R14 Trimmer resistor

47 k Ohm

2 3296x Into notepad
R15, R16 Resistor

5.1 k Ohm

2 SMD 1206 Into notepad
C1, C2, C3, C4, C5, C6, C7 Capacitor10 uf7 SMD 1206 Into notepad
D1 DiodeSMA40071 SMA Into notepad
PH1 IR receiverTSOP348381 38 MHz 2.5 mm, 1-Out, 2-Gnd, 3-Vs Into notepad
S1 DIP switchDS1040-08RT1 Into notepad
X1, X6 Angle connectorS4B-XH-A2 XH 2.5 mm, 4 pins Into notepad
X2 Pin plugPLS-6R1 2.54mm 1x6 Into notepad
X3, X11, X12 Angle connectorS5B-XH-A3 XH 2.5 mm, 5 pins Into notepad
X4, X5, X7, X10, X13 Angle connectorS3B-XH-A5 XH 2.5 mm, 3 pins Into notepad
X8 Pin plugPLS-9R1 2.54mm 1x9 Into notepad
X9 Card slotPBS-161 2.54mm 1x16 Into notepad
DisplayWH20041 HD44780 Into notepad
Thermo sensor
U1 temperature sensor

LM75AD

1 Into notepad
C1 Capacitor10 uf1 SMD Into notepad
R1 Resistor

100 kΩ

1 SMD 1206 Into notepad
U1 Shift register

SN74HC595

1 Into notepad
U2 Composite transistor

ULN2003

1 Into notepad
R1 Resistor

1.1 k Ohm

2 SMD 1206 Into notepad
R2 Resistor

82 k Ohm

2 SMD 1206 Into notepad
R3 Resistor

2 kΩ

2 SMD 1206 Into notepad
R4 Resistor

36 kΩ

2 SMD 1206 Into notepad
R5 Resistor

3.6 k Ohm

2 SMD 1206 Into notepad
R6 Resistor

16 kΩ

2 SMD 1206 Into notepad
R7 Resistor

6.2 k Ohm

2 SMD 1206 Into notepad
R8 Resistor

6.8 k Ohm

2 SMD 1206 Into notepad
R9 Resistor

8.2 k Ohm

2 SMD 1206 Into notepad
R10 Resistor

1.8 k Ohm

2 SMD 1206 Into notepad
R11 Resistor

9.1 k Ohm

2 SMD 1206 Into notepad
R12 Resistor

240 Ohm

2 SMD 1206 Into notepad
R13 Resistor

10 kΩ

2 SMD 1206 Into notepad
R14 Resistor

6.2 Ohm

2 SMD 1206 Into notepad
R15 Resistor* 2 SMD 1206 Into notepad
R16 Resistor* 2 SMD 1206 Into notepad
R17 Resistor

100 kΩ

1 SMD 1206 Into notepad
R18, R19 Resistor

0 ohm

2 SMD 1206 Into notepad
R20, R21, R22 Resistor

15 ohm

3 SMD 1206 Into notepad
C1 Capacitor10 uf1 SMD 1206 Into notepad
K1, K2, K3, K4, K5, K6, K7 RelayG6H-2F7 TQ2SA or similar Into notepad
X1, X2, X3, X4, X5, X6, X7, X8, X11 ConnectorB2B-XH-A5 XH 2.5 mm, 2 pins Into notepad
X9, X10 ConnectorB5B-XH-A2 XH 2.5 mm, 5 pins Into notepad
U1 Shift register

SN74HC595

1 Into notepad
D1, D2, D3, D4 Rectifier diode

PMLL4148L

4 Into notepad
R1, R2, R3 Resistor

10 ohm

3 SMD 1206 Into notepad
C1 Capacitor10 uf1 SMD1206 Into notepad
K1, K2, K3, K4 RelayG6H-2F4 TQ2SA 5v or similar Into notepad
X1, X2, X3, X4 ConnectorPBS-23 2.54mm 1x2 Into notepad
X5 ConnectorPBS-51 2.54mm 1x5 Into notepad
U1 Shift register

SN74HC595

1 Into notepad
U2 Composite transistor

ULN2003

1 Into notepad
R1 Resistor

100 kΩ

1 SMD 1206 Into notepad
R2, Rl20, Rr20 Resistor

0 ohm

3 SMD 1206 Into notepad
R3, R4, R5 Resistor

10 ohm

3 SMD 1206 Into notepad
Rl1, Rr1 Resistor

7.5 k Ohm

2 SMD 1206 Into notepad
Rl2, Rr2 Resistor

680 Ohm

2 SMD 1206 Into notepad
Rl3, Rr3 Resistor

940 Ohm

2 SMD 1206 Into notepad
Rl4, Rr4 Resistor

6.8 k Ohm

2 SMD 1206 Into notepad
Rl5, Rr5 Resistor

820 Ohm

2 SMD 1206 Into notepad
Rl6, Rr6 Resistor

1.3 k Ohm

2 SMD 1206 Into notepad
Rl7, Rr7 Resistor

2.7 k Ohm

2 SMD 1206 Into notepad
Rl8, Rr8 Resistor

10 kΩ

2 SMD 1206 Into notepad
Rl9, Rr9 Resistor

1.5 k Ohm

2 SMD 1206 Into notepad
Rl10, Rr10 Resistor

1.8 k Ohm

2 SMD 1206 Into notepad
Rl11, Rr11 Resistor

3 kΩ

2 SMD 1206 Into notepad
Rl12, Rr12 Resistor

14 kΩ

2 SMD 1206 Into notepad
Rl13, Rr13 Resistor

1 kΩ

2 SMD 1206 Into notepad
Rl14, Rr14 Resistor

4.7 k Ohm

2 3296W Into notepad
Rl15, Rl16, Rl17, Rr15, Rr16, Rr17 Resistor

16 kΩ

6 SMD 1206 Into notepad
Rl18, Rr18 Resistor

36 kΩ

2 SMD 1206 Into notepad
Rl19, Rr19 Resistor

12 kΩ

2 SMD 1206 Into notepad
C1 Capacitor10 uf1 SMD 1206
Did you like the article? To share with friends: