Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

EE Design >Stereo Pre-amplifier System with Digital Control
| Home | Contact |

Features
Stereo Power Amplifier / Pre-amplifier with 350mW output at 8 ohms
Digital Volume control
Digital Treble and Bass control
Stereo or Mono operation selectable
Stereo Enhance Mode, 3D Sound
Software Muting
Dual 7-segment LED display
Manual pushbutton control
Infrared Remote Control (SIRC)

Additional add-on/upgradeable features:

(By adding another LM4832 into its I2C bus, with address 0x02 defined to the pre-amp unit.)

Digital Center Channel Volume Control (L+R mix)
Digital Subwoofer Volume Control (L+R mix)

top page

Design Objectives
The idea is to design a compact amplifier systems with digital interface and tone control functions. The design should be simple and cost effective while maintaining the sound quality at optimal performance. The selection of the components to be integrated into the final design are carefully picked.


top page

Design Concept & Illustration
System Block Diagram

top page

System Operation & Description
The LM4832 is controlled by the PIC16F628(A), pre-programmed microcontroller (MCU). The Microchip PIC16F628(A) is selected due to its low-cost and easy code migration to other mid-range or 16F series PIC microcontrollers. In Circuit Serial Programming (ICSP) is implemented for the development of this project. The Microchip ICD2 is used to program the PIC16F628A chip. No external oscillator is required in the design. Its internal oscillator is good enough to read the serial port at 9600 Bps and perform other serial and I2C data transfer function.

The PIC16F628(A) controls the LM4832 chip using an I2C interface. With the I2C interface, 30 steps of Volume can be implemented with 2dB/step resolution. Tone control functions are also built-in, with +/- 12dB control on both Bass & Treble. There are 12 steps of tone control with 2dB resolution. User can also force the amplifier to function in both “Mono” and “Stereo” operation mode. The LM4832 has also a National 3D sound which enhances the stereo channel to optimize stereo channel separation, when the speakers are placed too near to each other.

During system power up, the microcontroller will read its internal EEPROM for Volume, Tone and other setting parameters. Later, the 2-digit 7-segment display will perform a blank test, to visibly check for faulty LED segments. The volume settings will be displayed after that. By default, the amplifier is un-muted.

Now, the system is ready to accept user input, weather it is from a remote control or keypad. With the remote control interface, user could control the [Volume-], [Volume+], [Bass-], [Bass+], [Treble-], [Treble+], [Stereo/Mono operation], [Stereo Enhance On/Off] and [Mute] functions. However, due to limitation to eight buttons (using only one 74HC165) for keypad, the Mute function is omitted. Every time user changes the settings, the program will save the updated data into its internal EEPROM, so that the data can be retrieved at later times if the system is turned off then on again.

When the user pushes the remote control or keypad, the 7-segment will display the respective settings for the current changing value. Let’s say when user pushes the [Bass+] button, the Bass setting will be incremented, and the 7-segment display will blink once, to indicate acceptance of an input. The 7-segment display will now display the Bass settings. If there are no changes or activity on changing the Bass settings for approximately 2 seconds, the display will display back the default Volume settings. The same operation applies when changing the Treble settings.

Note: With additional LM4832 chip, the Center channel and subwoofer output can be controlled using the IR remote control. The second LM4832 chip (address 0x02) is configured as mono operation, with independent Left and Right channel control. This enables both Center channel (LEFT) and Subwoofer Output (RIGHT) to have 30 steps of volume control.

top page

Circuit Description
Basically the MCU is connected to the IRC-80S remote control decoder chip thru a serial interface. The interrupt pin from the IRC-80S remote control decoder (SIRC) is also used to interrupt the MCU when a valid data is ready to be read from the serial output pin. The IRC-80S chip is configured as a non-inverting toggle outputs for output pin OUT1 to output pin OUT7. The outputs are default to be logic zero (0V), during system power on.

SIRC Decoder Interface
SIRC (Sony Infra-red remote control) Decoder Interface


Various devices can be triggered by this eight multi-purpose control pins. For example, you can connect the outputs to a relay driver board to control a Projector, to turn off/on a Power Amplifier or Subwoofer system, to turn off the lamp near the TV screen and presentation hall etc. The IRC-80S key ‘1’ to key ‘8’ are dedicated for toggling these outputs.

LM4832 Boomer Amplifier Interface
LM4832 Boomer Amplifier Interface (Note address on schematic diagram is 0x00)


The MCU control the LM4832 Boomer Audio Power Amplifier using a simple I2C interface. Two I/O lines from the MCU will supply the Data and Clock to the LM4832. Key ‘9’ up to Key ‘H’ from the IRC-80S decoder are recognized by the MCU and are dedicated for controlling the LM4832 amplifier chip. The function associated to each key are as follow:

Key ‘9’ – [Volume-]
Key ‘A’ – [Volume+]
Key ‘B’ – [Bass-]
Key ‘C’ – [Bass+]
Key ‘D’ – [Treble-]
Key ‘E’ – [Treble+]
Key ‘F’ – [Stereo Enhanced ON/OFF]
Key ‘G’ – [Stereo/Mono operation]
Key ‘H’ – [Mute]

Key ‘I’ – [Ctr Volume-]
Key ‘J’ – [Ctr Volume+]
Key ‘K’ – [Sub Volume-]
Key ‘L’ – [Sub Volume+]

top page

To enable user to be visible to the settings, a simple 2-digit common anode 7-segment display is implemented in the design. The individual 7-segment LED are multiplexed together such that segment ‘a’ is connected to segment ‘a’ of the other LED, segment ‘b’ is connected to segment ‘b’ of the other LED etc. The digits are selected from both the common anode CA1 and CA2. They are scanned in alternate duration and periodically so that our human eye can see as if both digits are lit up at the same time.

Display Interface
Display Interface


The 7-segment LED interface is driven serially by using a 74AC164 shift register IC. The ‘AC’ or Advance CMOS type is being selected due to its capability of sourcing and sinking 25mA of current that ensures consistent and proper LED driving. The MCU will initially shift the MSD (Most significant digit) eight bits of data to the A-B inputs of the 74AC164 IC, and then the MCU will select CA1 when eight valid bits are valid on the parallel outputs of the shift register IC. The first digit has been displayed. The LSD (Least significant digit) eight bits will then shifted to the A-B inputs of the 74AC164 IC and then the MCU will select CA2 when eight valid bits are valid on the parallel outputs of the shift register IC. The second digit is now displayed. The delay timing between switching on each digit is calibrated such that there is no flickering on the display and both the MSD and LSD displays clearly and correctly.

When both digits have been displayed, the MCU will start reading and checking for keypad and IR remote control activity. If there are no activities or response from these inputs, the 7-segment display will perform another display cycle. The cycle repeats until the MCU detect an input.

Keypad Interface
Keypad Interface


The keypad interface is also driven serially, using the same principle as the 7-segment LED driver. However, now the 74HC165 IC is being used. The parallel inputs are converted to serial data and shifted serially out to the MCU. Eight tactile switches are connected to the eight digital inputs. The MCU will initially set high (Logic 1) on the PL pin of the 74HC165 IC. The parallel data from the eight inputs will be read and loaded into the 74HC165’s internal data registers. Then, the MCU will set low (Logic 0) on the PL pin. The first serial data bit will appear at the data output pin. The MCU will start clocking and reading the first bit then the second bit and until all eight valid bits are completely read. The MCU will then compare to check which key has been pushed.

The power supply section is not shown on the schematic. Basically the circuit only requires a single well regulated 5V supply. Estimate a reasonable value supply capacitor for buffering the power amplifier. Please take care on the grounding when designing the PCB for the amplifier section.

top page

The whole pre-amp unit. The main controller PCB, Display & Keypad PCB with IR sensor, 2 LM4832 preamp PCBs and the input attenuator PCB
The whole pre-amp unit. The main controller PCB, Display & Keypad PCB with IR sensor, 2 LM4832 preamp PCBs and the input attenuator PCB


Single pre-amp PCB with volume and tone control function capabilities
Single pre-amp PCB with volume and tone control function capabilities


2 pre-amp PCB with different device address giving additional outputs
2 pre-amp PCB with different device address giving additional outputs

top page

The pre-amp unit attenuated by an input attenuator (picture left) making sure the input signal doesnt exceed 2.5V peak-to-peak
The pre-amp unit attenuated by an input attenuator (picture left) making sure the input signal doesnt exceed 2.5V peak-to-peak


The dual-digit 7-segment display, keypad and IR receiver
The dual-digit 7-segment display, keypad and IR receiver


The main control board with a MCU and a IR (SIRC) decoder IC (Not inserted!)
The main control board with a MCU and a IR (SIRC) decoder IC (Not inserted!)

top page

Upgrades & Comments
The speaker outputs can be connected to a high power amplifier system for better audio experience. If only two small speakers are used and driven directly by the LM4832's speaker outputs, an active subwoofer system can be added to enhance the overall audio bass response.

The audio signal to the input of the LM4832 is limited to +/-2.5V voltage swing. Therefore, make sure the amplifier's audio signal input is not driven above specification or the output signal will clip. If your input signal is clipping (distorted), try to attenuate (reduce input signal) the input signal by using a potentiometer for input attenuation.

By adding another LM4832 pre-amp unit (with address 0x02, it is not shown on the schematic), the Center channel and Subwoofer channel can be obtained. Both channels can be attenuated by using the remote control. The outputs are taken directly from the outputs of the first LM4832 pre-amp unit (with address 0x01). Check the new hex file for this upgrade feature!

top page

Related Design Files & Materials
Schematic Diagram (.GIF)
Schematic Diagram (.PDF)
IRC-80S Datasheet
LM4832 Datasheet
PIC16F628A Datasheet

top page


| Home | Top Page | Contact |


Copyright Notice: This article, including all text, documents and schematic diagrams, are the intellectual property of Vincent Wong, and is Copyright (c) 2005. Reproduction or re-publication by any means whatsoever, whether it is electrical & electronic, mechanical or electro-mechanical, is strictly prohibited under International Copyright laws. The author (Vincent Wong) grants the reader the right to use this information for personal use only. Commercial use is prohibited without express written authorisation from Vincent Wong.

Copyright of Vincent Wong. All Rights Reserved.