Digitized Audio Analog Volume

by jandb86 in Circuits > Arduino

1930 Views, 15 Favorites, 0 Comments

Digitized Audio Analog Volume

00_Overview.jpg

Maybe this kind of break-out circuit can be utilized for making other complex and more useful devices or equipment.

The potentiometer is a typical analog control device through changing resistance values.

Therefore many audio devices such as amplifiers use it for controlling audio output volume.

When turning the wiper (moving contact above the resistance strip), the output terminal’s resistance value becomes lower.

For old generations, this analog fashion of device control is quite familiar.

When using a knob having a scale mark (the orange strip in the picture above), we can crudely estimate how much change is made by turning the wiper terminal of the potentiometer.

But sometimes we need to know the exact resistance value to correctly control certain devices or equipment.

That’s why I'd tried to make this breakout circuit to show the exact present resistance level by means of the number on the 7-segment display.

Let’s look at more detail of the digitized but still analog potentiometer circuit.

Schematics

01_schematics_LED.jpg
02_Pre_amplifier.jpg

The schematic of the digitized audio analog volume (from hereinafter as DAV) is not complicated.

The whole circuit consists of only three components with Arduino pro-mini, a dual gang 20K potentiometer, and a common cathode 7-segment display.

The potentiometer should be a dual gang type (physically identical two variable resistance units are packaged as a single potentiometer) for supporting digital volume level display and acting as an analog audio level attenuator at the same time.

The individual variable resistance (VR) unit inside a dual gang type potentiometer is physically isolated.

Otherwise, digital noise produced by one VR unit is infiltrating into the analog audio VR unit side.

When you look at the other schematics, the DAV is connected to the pre-amplifier of the Sound Level Meter circuit.

The analog side VR unit of dual gang potentiometer replacing 20K volume control VR part of pre-amplifier.

Parts

03_7_segment.jpg
04_Arduino.jpg

For minimizing size of the DAV circuit, the 7-segment display and Arduino pro-mini mounted on the small size of universal PCB with male pin-header and female pin-header socket.

Also pin-header and DuPont wires are used for connecting Arduino and 7-segment display.

The following parts are used for making the DAV circuit.

 

-         Arduino pro-mini 5V 16MHz

-         Common cathode 7-segment display (Green color)

-         Dual gang 20K potentiometer

-         Pin-header (male and female sockets and terminals)

-         Universal PCB, DuPont wires

-         LM7805, 0.33uF film capacitor and 0.1uF ceramic capacitor

 

As pre-amplifier circuit is operating with 12V power supply, LM7805 voltage regulator is used for supplying fixed 5V voltage power to the DAV circuit.

For simplifying the explanation of the DAV circuit, this LM7805 circuit part is excluded from the schematics.

Usage of the DAV Circuit

05_Usage.jpg
06_SLM.jpg

As the DAV is the unitary function of the break-out circuit, it can be included in another circuit as a part.

Therefore, it is integrated into the Sound Level Meter (SLM) circuit to control the input sound level.

Please look at the details of the SLM circuit in the Instructable below.

 

https://www.instructables.com/Sound-Level-Meter-With-3-Color-LED-8x8-Matrix/

 

The two VR units included in the dual gang potentiometer are divided to be assigned to the DAV circuit and another is integrated into the pre-amplifier circuit of SLM.

As the two VR units are completely isolated, no digital noise created by the DAV circuit is interfering with the pre-amplifier circuit.

The DAV can control the input sound level and show the VR resistance level at the same time.

This DAV usage can be one of example among many possible other applications.

Sketch Program

07_Sketch.jpg
08_flow_chart.jpg

When the program is started, digital PIN 2 to 9 of Arduino is configured as the output port.

PIN 2 is wired to A part of the LED of the 7-segment and the PIN 9 is mapped to DP LED of the 7-segment display.

Then resistance is read from the A0 analog port as shown in the flowchart picture above.

The Analogread(A0) command reads current resistance between 0 to 1024.

For mapping resistance value to 0~9 of 7-segment volume levels, I divided each level as 102.4 as shown on the left side of the flow-chart picture.

But actually, the resistance strip (where the wiper is contacted) of the potentiometer is made as a logarithmic scale as shown on the right bottom side of the flow-chart picture.

Initially, the resistance value slowly changed and rapidly decreased from the 2/3 portion of the resistance strip.

This logarithmic resistance strip making is a kind of safety measure to protect against the possible hazard.

Let’s assume a potentiometer is used in a power amplifier.

When if the resistance level is decreased very rapidly at the initial stage (Initially turning the volume clockwise), a very loud output sound can be produced to hurt your eardrum.

Therefore, the actual potentiometer decreases resistance slowly at about 2/3 of the turning position and rapid changes in the remained 1/3 volume position.

Anyway, the read resistance value is mapped to the present volume level and displayed on the 7-segment display.

Please refer to the following Instructable for details about showing a number on the 7-segment display.

 

https://www.instructables.com/File-Server-With-Current-Meter/

 

The sketch program repeats the reading of the A0 analog port to get resistance value, mapping present resistance to volume level, and displaying volume level of 7-segment continually.

Conclusion

09_Operation.jpg
10_Application.jpg

This is not much significant DIY project that makes something great.

But the DAV can be utilized as a unit functional break-out circuit for some more sophisticated devices or equipment.

Although I integrated the DAV to Sound Level Meter circuit, maybe some more useful applications can be possible.

 

Thank you for reading.