Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

5.1 channel preamp
5.1 channel preamp
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Thread Tools Search this Thread
Old 30th August 2019, 05:55 AM   #1
stratus46 is offline stratus46  United States
diyAudio Member
Join Date: Nov 2009
Location: Los Angeles
Default 5.1 channel preamp

This 'preamp' is part of my home made 5.1 audio system. Volume control
uses 3 CS3310 (same as PGA2311) volume control chips, 3 New Japan Radio
NJW 1119A tone controls for Bass, Mid and Treble. 3 OPA2134 opamps are
buffers, summers and LP filter and impedance buffer for the analog feed to the Arduino controller.
This 'preamp' includes a 6 channel power amp based on the T.I. TPA3116
that delivers 20 Watts /channel into 8 ohms. The box is my 5.1 audio for an LG OLED TV.

This is not the exact encoder I'm using but it is functionally the same.

Rotary Encoder + Extras ID: 377 - $4.50 : Adafruit Industries, Unique & fun DIY electronics and kits

This display is exactly what I'm using. For volume only 1 unit can suffice.
With the tone controls it's better with 2 units. BTW I like blue better but
that's just me. They have several colors including white.

Quad Alphanumeric Display - Blue 0.54 Digits w/ I2C Backpack ID: 1912 - $13.95 : Adafruit Industries, Unique & fun DIY electronics and kits

The IR modules are these.

38 kHz Remote TSOP4838 DIP-3 IR Receiver Infrared Radiation Modules XZ | eBay

The 'interface' is nothing more than a blank Arduino shield to mount the connectors.
3 pin for IR, 4 pin for the rotary encoder, 5 pin for the displays and a 10 pin
to talk to the preamp board and get 5 Volt power. The pins just connect to
Arduino Uno pins with no extra semiconductors but a couple of capacitors.

I got a little silly with the controls. The 'mute' function has a 'dim' mode. If you hold
the mute button more than a user settable preset, it goes to a secondary volume.
I usually set it to -15dB. The hold time can be set in 10mS increments up to
500mS to trigger 'dim' mode. It can also do 'fade' as mute. You can select
10 to 100 dB / second in 10 dB steps. Selecting 11 is not 110 dB but plain old instant mute.

Volume DOWN in mute or dim mode will reduce the level to un mute to but stay in mute.
Volume UP in mute mode comes out of mute and increments 1 dB. Mute button while in mute
just ramps back up to the old value. All settings are stored in EEPROM (non volatile).
My version includes a mono mix for a center channel in stereo mode and also low pass filters
the center to feed to the sub woofer. The Arduino gets a buffered center channel feed so
when it finds audio on the center channel it switches back to 5.1 mode.

The shaft encode is not needed but gives local volume control without a remote.
The button portion triggers mute and holding will also enter 'dim' mode.

This 'preamp' includes a 6 channel power amp based on the T.I. TPA3116
that delivers 20 Watts /channel into 8 ohms. The box is my 5.1 audio for an LG OLED TV.

Operationally the 5.1 is active always and uses the cable box remote to changes channels,
volume and inputs exactly like TVs of old before they turned into something that sometimes
need an engineering degree to use.

I know you can buy these thing but it's DIY. It's fun.

The TXT file need its name changed to .INO

Attached Images
File Type: jpg 6 channel preamp bottom P1040085.jpg (65.0 KB, 623 views)
File Type: jpg 6 channel preamp top P1040086.jpg (67.7 KB, 628 views)
File Type: jpg 6 channel preamp P1040483.jpg (79.6 KB, 631 views)
File Type: jpg 6 channel preamp P1040484.jpg (70.9 KB, 626 views)
File Type: jpg 6 channel preamp mounted P1040528.jpg (76.4 KB, 619 views)
File Type: jpg 6 channel preamp P1040511.jpg (71.8 KB, 184 views)
Attached Files
File Type: pdf 6 channel schematic.pdf (186.6 KB, 146 views)
File Type: txt LG_remote51T7.txt (31.1 KB, 43 views)
  Reply With Quote
Old 30th August 2019, 02:16 PM   #2
rsavas is offline rsavas  Canada
diyAudio Member
Join Date: Aug 2012
Location: Georgina, Ontario
Well done,

I know how much work it is, when I made my portable radio/media player, using the TPA3100, before the TPA3116 was out. I still have code to write, I am not so good at it Should be fun reading your code . I think I left it at the IR decoder code. I made a remote encoder too.
My Mom uses the radio all day, she likes the RDS decoding. If you want to add AM/FM radio, I have code to give you.

I'll take a further look at your design, thanks for sharing.
  Reply With Quote
Old 31st August 2019, 03:52 PM   #3
Shaz is offline Shaz  United States
diyAudio Member
Join Date: Jul 2003
Location: Colorado
This is great work! Thank you so much for sharing details.

Your feature set is quite extensive. You've inspired me to give this type of project a try. However, I'm interested in building only an 8-channel volume controller using four CS3310 ICs.

I looked into the parts you used and I think my best course of action will be to start with the power supply, Arduino, its peripherals and the software. I can work in parallel to design the volume controller board.

It appears that everything can be powered with a +5V and -5V power supply. It doesn't appear that you are using multiple voltage regulators for the various +5V devices. Are you using any components to help isolate those leads.

I gather that your power supply bridge rectifier, filter caps and voltage regulators reside on your custom board. I don't see a transformer inside your enclosure. What are you using for a transformer? I also assume you're providing a single voltage from an external power supply to your amplifier board.
  Reply With Quote
Old 31st August 2019, 06:19 PM   #4
stratus46 is offline stratus46  United States
diyAudio Member
Join Date: Nov 2009
Location: Los Angeles
The preamp power transformer is a 12 VCT but it would have a little more 'wiggle'
room with a 14 Volt transformer. These guys sell good toroids inexpensively.

AN-0107 - 10VA 7V Transformer - AnTek Products Corp

The power amp uses a 19 Volt 9.5 amp laptop supply.

The CS3310 and PGA2311 data sheets recommend a low source impedance.
In my case the analog signal is coming from an optical input DAC so the source
is already low. You might want to use input buffers like U3 to allow any source
impedance. I my case U3 is to isolate the 10k summing amp from the source
since the CS3310 is also 10 K. I like low impedance but 5K is a little low even
for me, hence U3. The input then is the resistor to ground at the buffer, in my
case 10K.

It isn't clear on the schematic that U3 is a triple 2:1 switch similar to a CD4053.
All analog switches show varying series resistance vs signal level. The 4053
maybe 120 to 180 ohms at 25C. In series with the 10K load would cause some
non-linearities (distortion). The Analog Devices chip shows the same series
resistance change but varies from 3.3 to 4.3 ohms at 25C so an order of
magnitude plus better than a 4053.

Because the center and sub channels have 2 different sources because of the
analog switch, it stores 2 sets of tone control and volume numbers for stereo
vs 5.1, only for center and sub.

At work I'm known as Mr or Dr capacitor for all the 'lytic caps I've replaced
(10,000 plus). On this board the only 'lytics are 2200uF 16 Volt and those are
Organic Polymer. All the 10uF and 100uF caps are SMD ceramics in addition to
the 100n bypass caps. The capacitors in the signal path are 2% film.

The 4 resistors on the regulators are 1% thick film 0805. The rest are 0.5% thin
film 0805 Susumu from Digikey. 11 cents in single lot, 10 cents in 10s but 3.76
cents in 100 lot. I have considerable 'left overs' that cost less than the 'right'

Some tricks for SMD. I use a Metcal soldering iron with an STTC0126 700 degree
fine bent tip. Flux on the board from a flux pen in addition to the 63/37 Multicore
solder. After the parts are soldered but likely a little crooked, a hot air tool set to
the lowest air flow will allow the surface tension of the solder to align the part
without blowing them away. It's neat to see them self align.

Search for "858 hot air" on eBay and you should find lots around $35.

  Reply With Quote
Old 31st August 2019, 09:02 PM   #5
Ken Newton is offline Ken Newton  United States
diyAudio Member
Ken Newton's Avatar
Join Date: Apr 2003
Location: Eastern Pennsylvania
Originally Posted by stratus46 View Post
This 'preamp' is part of my home made 5.1 audio system.
Stratus, your schematic seems to indicate that you do not use an dedicated channel steering surround decoder of some kind. Instead, you have what looks to be non-steering purely analog surround generation. Your schematic shows inputs for front Left and Right channels, plus surround Left and Right channels. However, where do those surround channel inputs come from. Is it from some kind of external surround decoder?

I ask because the usual impediment to a DIY surround preamp or DAC is the need for a channel steering type surround decoder. I'm also wondering how your non-steering solution subjectively compares to an channel steering decoder based solution?

Last edited by Ken Newton; 31st August 2019 at 09:11 PM.
  Reply With Quote
Old 31st August 2019, 09:50 PM   #6
stratus46 is offline stratus46  United States
diyAudio Member
Join Date: Nov 2009
Location: Los Angeles
Originally Posted by Ken Newton View Post
Stratus, your schematic seems to indicate that you do not use an dedicated channel steering surround decoder of some kind. <snip>
I use one of these set to 'pass' mode though the one I have has a 3 position switch marked 2.0, 5.1, and 'pass'.

Search eBay for optical analog 5.1

5.1ch Digital Audio Decoder Optical Coaxial Toslink to Analog 6 output Converter 784099939143 | eBay

It works correctly with all the over the air networks, our cable service and streaming like Prime and Netflix,
HTPC and the BluRay player.

The TV optical out feeds the DAC. The inputs to the TV are cable box, Roku box, HTPC and Blu-ray. The PC
required a Dr HDMI in between. The TV EDID reports it has 2 channels of audio but it will pass through 5.1
if fed to it. The BluRay had to be set to pass it, also true for the Roku box. The Roku box quirk is the first
time you set it to 'auto' to pass DTS but does not pass 5.1. There is a 'night time' mode mode for earphones
that forces it to stereo. When you exit night time mode it then passes 5.1.

The Dr HDMI tells the PC (Win 7 pro) it can pass 5.1 out the HDMI connector. When go into sound setup you
get the options beyond stereo. It will NOT encode 5.1 from 6 channels but it WILL pass through pre-encoded
audio. VLC CLAIMS to be able to pass 5.1 but I have never gotten to work so I use MPC-HC which will pass
through the 5.1 and works correctly with the KeySpan RF remote.

Yes the LG TV is 'smart' and can do Amazon and Netflix but I don't like the user controls on the LG remote so
I use a Roku box.

IOW the DAC does the hard work for me and all I need to do is control volume and tone.


Last edited by stratus46; 31st August 2019 at 09:56 PM.
  Reply With Quote
Old 1st November 2019, 05:53 PM   #7
os77 is offline os77
diyAudio Member
Join Date: Dec 2010
Location: France - Gujan-Mestras
Smile Help about 5.1 project

Hello Stratus46,
I am interested in the complete outline of your project.
I made a 6-channel volume control with 3 x PGA2310, based on a Chinese kit.
My purpose is not the 5.1 but the volume control of the 6 outputs of my active crossover, so it's the same purpose.
I developed the input/output inteface balanced, but the computer part of the kit is pitiful. This is why I would like, if you agree, to have the interconnection schematic between the Arduino card, your analog part and the corresponding software.
I understand many things, but some one remain unclear: PIN_SW?, Why the outputs of the encoder Bourns are wired on analog inputs arduino? which input is used to program the parameters (Ex: dB / Second)? how did you find the VOL + and VOL- codes for Samsung and LG remote controls? I hope to use a NAD remote IR control, but I don't know her codes for VOLULE +/- tec...
If you can help me it will be with pleasure.
France (please excude my bad English
  Reply With Quote
Old 2nd November 2019, 07:22 AM   #8
stratus46 is offline stratus46  United States
diyAudio Member
Join Date: Nov 2009
Location: Los Angeles
First of all your English is 1000 time better than my French.

You might find it easier to treat the PGA chips separately rather than daisy chaining them.
That would mean sending 16 bits 3 times using 3 chip selects instead of sending the same
48 bits sequentially and only 1 chip select. Your choice as it's only a minor code change.

When I first tried a shaft encoder on an Arduino the example code from Arduino Playground
used the analog inputs which I just copied and everything worked. Since there are no
conflicts I just left it as it was.

The dB/second is for MUTE mode. The PGA2310 works in 1/2 dB per step. For TV use I really
don't need that fine a resolution so I just multiply by 2 to get 1/dB per step and then limit the
control range from 0 to 99. This simplifies the display using 4 character units. The MUTE mode
ramps the volume up and down. That rate in in dB / second which I limit to 10s I.E. 10, 20,
30, 40, 50, 60, 70, 80, 90, 100 and 'instant'.

Since you can't really tell the step size by listening 10-50 dB / step in in 1 dB per update, 60 to 100
is in 2 dB per update an 'instant mode just sets the rate to 100. This allows time to send status to
the serial monitor screen.

To get the remote codes I started with IRecvDump by Ken Shiriff on GitHub but evolved to this
very simple sketch

#include <IRremote.h>
#include <IRremoteInt.h>
#include <ir_Lego_PF_BitStreamEncoder.h>

int RECV_PIN = 6;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
irrecv.enableIRIn(); // Start the receiver

void loop()
if (irrecv.decode(&results))
{if(results.value != 4294967295)
irrecv.resume(); // Receive the next value

You then copy the received value from the serial monitor screen and replace the number
in my sketch.

You don't need the tone control code so you can just delete it but since you don't have the
hardware, it could just send the data to nowhere.

Have you built an Arduino test system for this? I have the unit I built for the 2 channel version.
It's nothing more than a blank shield board with the connectors to the other parts. 3 pin
connector for the IR sensor, 4 pin for the shaft encoder a 5 pin for the Adafruit displays and
a 10 pin to the preamp board. There are a couple of bypass caps and pullup resistors for
shaft encoder. No semiconductors. Once you have the test system you can use the serial monitor.
You'll find a pretty complete messaging system to help debugging and testing. That board will
run the little sketch for identifying the codes. I've used this for Sony, Samsung and LG remotes.
The one possible problem could come from a different modulating frequency of the IR. Most but
not all remotes use 38KHz but there are other frequencies. All this means is you might need a
different IR module for the NAD

I'm hoping you're OK with Arduino code.

Good luck

  Reply With Quote
Old 2nd November 2019, 06:34 PM   #9
os77 is offline os77
diyAudio Member
Join Date: Dec 2010
Location: France - Gujan-Mestras
Wink Help about 5.1 project

Waaoh! thanks you for these very concrete explanations.
I have compiled your code and I order now a UNO card and displays, which I will perhaps change later for a 2x16 display.
I think I understand how to find the 3 or 4 IR codes I need from my remote (preamp NAD C160) with your explanations.

For alphanumeric displays I understood how to connect them, pin A4 (I2c SDA) and pin A5 (I2c clk), tutorials are quite explicit.

So, there are 3 points that remain obscure:

-1- Warning at compilation (not blocking I guess): a constant "ABCD" -> char * seems forbidden
example: show4left ("Dim"); warning: ISO C ++ forbids converting a constant string to 'char *' [-Wwrite-strings]
I am not a specialist of C language, my latest experiences date from the PASCAL language on digital VAX (around the year 1995 ...), but I think that with little time : I will find a Warning around.
The Arduino environment seems pretty cool to use.

-2- the SPI assignment for the PGA2310 is fixed for the UNO card:
SDI = pin11
CLK = pin13

but the assignment is different in the code:
PGA_SDI = pin8
PGA_CLK = pin9
I did not understand how it can work?

-3- I do not understand what to solder (back of displays) to differentiate the right display and the left

I hope I do not overuse your time, in France helping other people is not a natural thing...

PS: Google does a lot for my english
  Reply With Quote
Old 3rd November 2019, 02:40 AM   #10
stratus46 is offline stratus46  United States
diyAudio Member
Join Date: Nov 2009
Location: Los Angeles
A couple of things. The pin 11 and 13 got into the comments at the top of the file. Those go all the way
back to the 2 channel version started on October of 2016 when we first got the LG OLED TV. That was
also a Chinese module that included a controller and remote that was proprietary. Because I couldn't
get into the code to change it I simply went to the Arduino. The pin 11 and 13 were never used in any
version and were always pins 8 and 9 from the very first. Nothing like letting others read your code to
find the errors.

As for the compile issue I used Arduino 1.8.9 for most of it. I just went to 1.8.10 recently and all is OK
so I'm not sure how you're getting that error. At least in the US it's
Arduino - Home.

Then go to download software and 1.8.10 is the latest.

On the back of the IC displays are address jumpers A0, A1 and A2. The left display (secondary) gets
the A0 jumper soldered to change its address to 1.
The first 2 lines in setup
alpha41.begin(0x70); // pass in the display i2c address

With 3 address jumpers you should be able to use 8 IC items though I've only used 2.

As for helping out, many in the US and UK are quite generous with their time.

Hope this helps


Last edited by stratus46; 3rd November 2019 at 02:47 AM.
  Reply With Quote


5.1 channel preampHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing gain channel preamp tube(s) Palomino V50 for better clean channel tone? tubeFrank Instruments and Amps 2 22nd March 2012 11:54 AM
Cause of weak Preamp channel orbanator7577 Analog Line Level 13 11th February 2012 06:45 AM
7 channel Preamp jupiterjune Pass Labs 4 26th February 2011 05:29 AM
6-channel DSP preamp HorseWisperer Class D 3 29th December 2010 07:46 AM
6 Channel Preamp Project DC Dave Chip Amps 7 6th December 2005 02:00 AM

New To Site? Need Help?

All times are GMT. The time now is 07:58 AM.

Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio