Spi Kontrol Volumeeee

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Volume 56, Number 5, 2015 221

Audio Mixer Ordered Microcontroller


Romul Copîndean, Rodica Holonec, Florin Drăgan
Faculty of Electric Engineering, Technical University of Cluj-Napoca, Romania

Abstract - In this paper is presented an audio mixer done with Digital Potentiometers ordered an ATmega 328 microcontroller. A
function has been implemented whereby all signal sources to be brought to the same level by pressing a button. Also, the level can
be adjusted separately for each channel.

Keywords – Mixer, microcontroller, digital potentiometer, SPI (Serial Interface Peripheral), Auto Level.
interface. The signals output from digital
1. INTRODUCTION potentiometers are placed in a summing circuit. Finally,
Sound mixer is a device that has at least two or the mixed signals are applied to a power amplifier or
more input signals (microphone, CD player, etc) and recorder.
generates an output signal added. The mixer can adjust It will be used for each channel, two buttons
the level of each input and output signal is applied to an comeback, with which it will increase and decrease the
audio power amplifier or a recorder. volume (UP / DOWN). A return button will activate the
The most common uses are in radio television auto level.
studios, recording studios, live music, karaoke, etc. 2.1. Signal summation circuit
An operator must regulate levels of input sources
continuously to keep output levels accordingly. Since the analog input of a microcontroller only
An audio mixer fitted with the auto-level work accept positive voltage (0 ÷ 5V) it is necessary as load
eases operator in case of spontaneous discussion or voltage amplifier output to be half the supply voltage.
conference held during the shows or during television. This was achieved by applying a voltage to the
non-inverting terminal obtained from a resistive divisor
2. GENERAL PRESENTATION consisting of two equal resistors R [1] .

Next will be presented an audio mixer with two


inputs (see Figure 1), the number of channels can be
extended later.
You can enter the mixer signals from different
sources:
CD player, MP3 player
Microphones
• Transducer musical instruments
Microphones and transducers require
amplification instruments. Two or more digital
potentiometer will control the volume. Potentiometers
control is performed by a microcontroller via SPI serial
Fig. 2 . Signal summation circuit

Fig. 1 Block diagram of the audio mixer

© 2015 – Mediamira Science Publisher. All rights reserved


222 ACTA ELECTROTEHNICA

Output voltage circuit is given by 1: 2.4 Microcontroller ATmega 328


It used an Arduino Uno platform development [5].
VAL V  V − VAL / 2 VCD − VAL / 2 
VO = − R3 ∗ I = AL − R3 ∗  MIC +  (1) Arduino is an open-source physical computing
2 2  R1 R2  platform based on a simple i/o board and a development
environment that implements the Processing/Wiring
language. Arduino can be used to develop stand-alone
2.2 The microphone amplifier interactive objects or can be connected to software on
For the experiments we used a type electrets your computer. Arduino Uno is a microcontroller board
microphone BCM6027 [2], which requires a gain of based on the ATmega328P ], [6]. . It has 14 digital
100. In Figure 3 trackable microphone amplifier input/output pins (of which 6 can be used as PWM
scheme [3]. outputs), 6 analog inputs, a 16 MHz quartz crystal, a
USB connection, a power jack, an ICSP header and a
reset button.
Peripheral Features
• ̶ Two 8-bit Timer/Counters with Separate Pre-
scaler and Compare Mode
• ̶ One 16-bit Timer/Counter with Separate Pre-
scaler,
• ̶ Real Time Counter with Separate Oscillator
• ̶ Six PWM Channels
• ̶ 6-channel 10-bit ADC in PDIP Package
• ̶ Programmable Serial USART
• ̶ Master/Slave SPI Serial Interface
Fig. 3 The microphone amplifier • ̶ Byte-oriented 2-wire Serial Interface I2C
• ̶ On-chip Analog Comparator
It is obvious that amplifier circuit has output • ̶ Interrupt and Wake-up on Pin Change..
voltage variation around VAL / 2. This offset is
necessary because the digital potentiometer input 3. DEVICE’S DESCRIPTION
voltages only accept positive voltage (0 ÷ 5V), [4].
Figure 5 shows the experimental setup can be
2.3 Digital Potentiometer traced to the wiring diagram in Figure 6.

The MCP41010 [4] single-channel digital


potentiometer features 8-bit resolution (256 wiper
steps), and an industry-standard SPI™ serial interface.
The wiper position varies linearly and is controlled via
the SPI interface. The MCP41010 has a resistance value
of 10 kohm. Voltage Range for potentiometer is
0÷VDD [4].
Connect digital potentiometer to microcontroller is
as shown in Figure 4.
For the experiment were MCP41010 use features
two circuits, one for volume control of the microphone,
the other volume CD player.
Fig. 5 Experimental installation

Principle of operation

Digitally controlled mixer is designed around a


microcontroller ATMEGA 328 implemented a
development platform Arduino Uno.
They used two digital potentiometers type MCP
41010, which regulates the signal from a microphone
and a CD player. The signal from the CD is inserted
directly into one of the potentiometers, the output of the
potentiometer is connected to the analog input of the
microcontroller A1. Electret microphone type is used
Fig. 4 Connect digital potentiometer MCP41010 from the and it is amplified signal provided by an LM358
microcontroller [4]
operational amplifier.
Volume 56, Number 5, 2015

As the circuit is powered from a single power For the numerical value which is sent digital
supply is necessary to maintain output voltage to ½ of potentiometer, were used two variables of type byte (0
Val = 2,5v.Acesta non-inverting input is accomplished ÷ 255) (VolM and VolB). Pressing these two variables
by connecting a resistive divider consisting of two can be increment or decrement (ValM++,ValM--)
equal resistors (1k) connected to 5V. (Valb++,ValB--).
The signal from the output of the amplifier is It was implemented and a function by pressing a
taken from the 2nd digital potentiometer and applied to button that makes the two sources of signal levels are
analog input A0. equal (Auto Level).
Also the two outputs of digital potentiometers are
placed in an adder, made the second of LM358
operational amplifier available.

4. PROGRAMMING

His use features Arduino programming


environment IDE (Integrated Development
Environment) which allows editing C code [8][9].
Volume control is achieved with four push button.
Two buttons are used to increase the volume and two The routine for controlling digital potentiometers
for volume decrease. Buttons impulses are taken by the is:
microcontroller. Follow the volume control, conducted
by microcontroller based on impulses received from
buttons.
The routine schedule is as follows:

Was used communication protocol SPI (Serial


Interface Peripheral), [7].

Fig. 6 ` Wiring plan, digitally controlled mixer


224 ACTA ELECTROTEHNICA

5. CONCLUSIONS Efficiently Design An Op-Amp Summer Circuit, Analog


Devices Linear Products Group,2013, accessed at 25 sept 2015,
Digital potentiometers have the advantage that http://electronicdesign.com/ideas-design/efficiently-design-op-
amp-summer-circuit
they are not subject to wear. 4. MCP41010, Data sheet, Single/Dual Digital Potentiometer with
The digital volume control features such as SPI ™ Interface, Microchip Technology Inc., Arizona, U.S.A.
equalization obtain signal sources automatically (Auto 2003, accessed at 21apr 2015 de la adresa:
Level). http://ww1.microchip.com/downloads/en/DeviceDoc/11195c.pd
f John Ardizzoni, Efficiently Design An Op-Amp Summer
The program can impose an upper limit signals Circuit, Analog Devices Linear Products Group,2013, accessed
may not exceed a maximum level to avoid distortion. at 25 sept 2015, http://electronicdesign.com/ideas-
The advantage of digital over analog design/efficiently-design-op-amp-summer-circuit
potentiometers is that no predetermined operating 5. Arduino / Genuino UNO, Overview,
https://www.arduino.cc/en/Main/arduinoBoardUno
curve. Depending on the order applied to them may 6. ATmega 328/P, Datasheet, Atmel 8-Bit Microcontroller With
have linear or logarithmic feature. 4/8/16/32kbytes,In-System Programmable Flash, Atmel
The number of input channels can be expanded up Corporation 1600 Technology Drive, San Jose, CA 95110 USA,
http://www.atmel.com/images/Atmel-8271-8-bit-AVR-
to 6 Arduino Uno, or 8 Arduino Nano.
Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-
The embodiment shown can be made of a reduced 328-328P_datasheet_Complete.pdf
number of components and minimum cost. 7. Florin Drăgan, Protocoale de comunicaţie, U.T.Press, ISBN978-
Digitally controlled audio mixer presented in this 973-662-378-3, Cluj-Napoca : 2008
paper can be greatly improved by making its remote 8. ATmega 328/P, Datasheet, Atmel 8-Bit Microcontroller With
4/8/16/32kbytes,In-System Programmable Flash, Atmel
control. Use a module for Arduino Ethernet or Wi-Fi Corporation 1600 Technology Drive, San Jose, CA 95110 USA,
module. Remote controls can be implemented through http://www.atmel.com/images/Atmel-8271-8-bit-AVR-
an application on the mobile phone or tablet, Android Microcontroller-ATmega48A-48PA-88A-88PA-168A-168PA-
or IOS platform. 328-328P_datasheet_Complete.pdf
9. R. Munteanu jr., D. Iudean, C. Muresan, V. Petean „Access
System in Restricted Areas Based on Programmable Logic
REFERENCES Controller and GSM Modem”, The 13th International
Conference on Engineering of Modern Electric Systems, IEEE
1. John Ardizzoni, Efficiently Design An Op-Amp Summer Technically Co-Sponsored conference, #35382, organized in
Circuit, Analog Devices Linear Products Group,2013, accessed cooperation with Romania Section CAS/CS Joint Chapter, 11-
at 25 sept 2015, http://electronicdesign.com/ideas- 12 June 2015, Oradea, Romania
design/efficiently-design-op-amp-summer-circuit
2. BCM6027, Data sheet, Electret Condenser Microphone, Bestar Romul Copîndean
Acoustic Electronics Industry CO, LTD, accessed at 25 sept Faculty of Electrical Engineering, Technical University of
2015, Cluj-Napoca, 26-28, G. Bariţiu st., Cluj-Napoca, Romania
http://www.bestartech.com/PDFs/BeStar_Microphones.pdf [email protected]
3. LM358 Data sheet, , Texas Instruments Incorporated, 2015,
http://www.ti.com/lit/ds/symlink/lm158.pdf John Ardizzoni,

You might also like