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.

ESP32 driven PGA2320 preamp/IO switcher
ESP32 driven PGA2320 preamp/IO switcher
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
Reply
 
Thread Tools Search this Thread
Old 15th March 2020, 08:03 AM   #1
zdr is offline zdr  Belgium
diyAudio Member
 
zdr's Avatar
 
Join Date: Nov 2005
Location: Brussels, Beograd
Default ESP32 driven PGA2320 preamp/IO switcher

Before starting the project, first I would like to check if similar thing already exists, and secondly, if it makes sense at all...

I plan to base it on LDR Pre MkII code:

LDR Pre MkII - LDR volume control and I/O switching

which means 2.42" OLED display, dual rotary encoders, IR remote, 4 input channels and 2 output channels switched by relays, only PGA2320 instead of LDRs. Additional features available from ESP32 would include web interface for channel switching and volume control, and potentially even A2DP BT audio streaming.

Why PG2320 instead of LDRs? It's simpler to use, much lower distortion and coloration, which some might prefer as opposed to LDRs. I heard PGA2320 in M3Si and I liked it a lot.
__________________
Custom DIY PCBs, BOM and LDR Firmware:
https://sites.google.com/view/dacgear/
  Reply With Quote
Old 15th March 2020, 07:26 PM   #2
sgrossklass is offline sgrossklass  Germany
diyAudio Member
 
Join Date: Nov 2004
Location: Germany
Sounds straightforward enough. PGA2320 based preamp projects have been around for a while but yours may be the first ESP32 based one.

The devil is probably going to be in the details - choosing a gain structure and associated circuitry that is getting the most out of the PGA (hint: you can probably do with a 9 dB or so attenuation at the output - sparing an additional relay would enable a high output setting if needed), getting the layout and wiring right, and getting the network connection into the outside world (WiFi inside a metal case is going to be of little use so connectors for external antennas may be required, plus the potential for ground loops introduced via Ethernet cable shield, which could be a real can of worms).

IMHO any new, modern preamp design in this day and age should also include a balanced output (output gain perhaps the common +6 dB over unbalanced) and at least one such input (input gain -6 dB). Observe AES48-2005 pin 1 wiring practices. Circuitry wise, you could go either for dedicated balanced receivers and transmitters (e.g. THAT12xx series) or something with discrete opamps. The former are generally proprietary but compact and easy to apply (and some very high performance, too), while the latter give you more flexibility in parts choice but the builder will have to hand-match components.

Now with Ethernet cable shield and balanced I/O you have multiple possibilities for the case to be earthed. (You might as well consider going IEC Class I altogether at this point.) This would get you in trouble with any unbalanced connections from an IEC Class I device such as a typical PC.
You could do as Bruno Putzeys suggested and use balanced receivers on all inputs (plus ground-compensated output drivers for the balanced outputs), but then what do you do with rogue sources whose power supply mains filter has a tendency to pull signal ground towards 1/2 mains frequency?
Practical designs might have 1 kOhm || 10-100 nF from RCA ground to (chassis) ground, which could be used to also address the potential RF problems introduced when RCA connectors have to be kept isolated from the chassis. It doesn't exactly do practical CMRR any favors though. I imagine builders won't be too enthused when they have to install insulated RCA jacks with RF bypass caps to chassis either.

This might all sound like a massive can of worms, but in fact it's one that is already open as-is. The old hi-fi design philosophy of using unbalanced connections and just floating all devices so they don't disagree on ground levels is becoming more and more untenable in this age of computing devices and networking everywhere. One might as well tackle the bull by the horns.

If you basically just want this as an upgrade for your existing design while accepting the drawbacks of traditional hi-fi, your main problem would be addressing the networking-related issues: Find an Ethernet jack with a shield at least well-insulated from surrounding chassis (it may still be nice to have available for an RF connection via pF-nF), find out what to do with the WiFi antenna(s).

A multilayer board could probably be bulletproofed to the point where a metal chassis is not even required, but how common are wood or plastic cases for such projects? Not to mention that the choice of case may also affect PCB design choices such as grounding layout (the case back is often used as a star ground, for example). I'm afraid a holistic design approach is very much necessary!
  Reply With Quote
Old 16th March 2020, 07:09 AM   #3
zdr is offline zdr  Belgium
diyAudio Member
 
zdr's Avatar
 
Join Date: Nov 2005
Location: Brussels, Beograd
Wait, how did we enter ethernet story? I was not planning on using ethernet, there is no such interface in ESP32 and no point when there is WiFi
__________________
Custom DIY PCBs, BOM and LDR Firmware:
https://sites.google.com/view/dacgear/
  Reply With Quote
Old 16th March 2020, 11:32 PM   #4
sgrossklass is offline sgrossklass  Germany
diyAudio Member
 
Join Date: Nov 2004
Location: Germany
You still need to get the RF out of the case though. Googling ESP32 boards, I don't see any with antenna jacks, but maybe there are some. Reading again, and it appears that Ethernet still requires adding an external PHY but no more than that.
  Reply With Quote
Old 17th March 2020, 11:49 AM   #5
Thorp is offline Thorp
diyAudio Member
 
Join Date: Jan 2013
Pay attention to the radio part of ESP32.


I used ESP32 with PGA2311 in one of my USB DAC project. I have made my own PCB, except for the ESP32 adapter plate, which I have bought from Aliexpress, the white PCB in the pictures below.
The USB to I2S chip, XMOS, has a few I/O pins connected to some ESP32 I/O pins. They are like F0...F3 pins from Amanero board. Every time one of these pins goes high, to tell ESP32 that it is 24.xxx related sample rate (48kHz, 96kHz, etc), the web server freezes (web based remote control). It took me a while to figure out that it is an issue related to WiFi antenna. After I spent 2 days checking the software, I have found that there is no issue in 1 meter range, near my router, so there is a problem because of the poor design of that white PCB adapter for ESP32: in a certain combination of the ESP32 I/O pins state, its PCB antenna dramatically loses the signal strength, because of the PCB traces below of it that shouldn't be there.
Attached Images
File Type: jpg dac1.jpg (927.0 KB, 218 views)
File Type: jpg dac2.jpg (581.5 KB, 222 views)
File Type: png dac3.png (213.2 KB, 239 views)
  Reply With Quote
Old 17th March 2020, 12:16 PM   #6
ubergeeknz is offline ubergeeknz  New Zealand
diyAudio Member
 
Join Date: Aug 2018
Buying an ESP32 module recently for a project and did some reading as the modules had been revised since I last looked.

There are now 2 ESP32 modules available - WROOM-32D and WROOM-32U

Specifically, D has an improved RF antenna built in, U has a socket for an external antenna. They also improved the RF circuitry inside the chip itself. The modules are pin and binary compatible with the older WROOM-32 module.

Hope that helps.
  Reply With Quote
Old 17th March 2020, 12:56 PM   #7
Neil Davis is offline Neil Davis  United States
diyAudio Member
 
Join Date: Dec 2004
Location: Reston, Virginia
ESP32 driven PGA2320 preamp/IO switcher
Quote:
Originally Posted by zdr View Post
Before starting the project, first I would like to check if similar thing already exists, and secondly, if it makes sense at all...
Many years ago I made an 8-channel preamp with 2 PGA4311 chips, and eventually used that circuitry to make a volume-compensated relay switch box. You can switch between speakers using relays and each switch position has the volume controlled by the PGA4311.

Recently, one of the two boxes I made broke--the spring tension on the flex cable to the LCD caused that connector to fail, so I made a new CPU board using the Heltec ESP32 WiFi module. The updated display is a Nextion 3.2"module, which fit OK in the front panel opening after a bit of cutting on the inner chassis. There isn't an antenna connector on the Heltec module, but you can solder an antenna wire to the printed "F" antenna printed on the board. I used one of these, and it improved the ESP32 signal strength by about 6dB. I epoxied that antenna to the outside of the chassis--it looks nice and works great.

One of the two boxes I made is mostly finished. You can navigate through the menu with the rotary encoders or IR controller. A new feature is Bluetooth control via a simple cell phone app. I'm just using the MIT App Inventor tools for the cell phone app and I'm hoping that the IOS tools will get released soon--already got the Android version working OK.

One problem I ran into is that there are some issues using the Arduino remote control library and the EEPROM library. Read through this if you are using that combination and want to save yourself some grief.

To answer your questions: yes, a similar thing already exists, and yes, it makes good sense to go this route. Cell phone control is a lot nicer than those cheezy remotes, and the ESP32 is a powerful and fun chip to work with. It's also got enough resources to implement the MQTT client. I've got that running on a different project, but decided on Classic Bluetooth for this upgrade.

Another thing to be careful about: the Heltec ESP WiFikit V1 and V2 chips use a somewhat different pinout for the voltages, and the V2 chip generates a lot of smoke if you put it in a V1 socket.

Here's a pic dated 2008 of one of the original boxes. I can take pictures of the updated version if there is any interest.
Attached Images
File Type: jpg Relaybox2.jpg (84.6 KB, 219 views)
  Reply With Quote
Old 19th March 2020, 02:31 PM   #8
zdr is offline zdr  Belgium
diyAudio Member
 
zdr's Avatar
 
Join Date: Nov 2005
Location: Brussels, Beograd
Thanks. I have started porting the code to ESP32, encoder part is done. Adjustments.jpg
__________________
Custom DIY PCBs, BOM and LDR Firmware:
https://sites.google.com/view/dacgear/
  Reply With Quote
Old 6th April 2020, 09:29 AM   #9
zdr is offline zdr  Belgium
diyAudio Member
 
zdr's Avatar
 
Join Date: Nov 2005
Location: Brussels, Beograd
I was disappointed to see a lack of eeprom in ESP32, since my solution uses it extensively. So I revisited the idea with Arduino + PGA2311, until I figure out how to resolve ESP32 issues.
Attached Images
File Type: png PGA Arduino.png (487.4 KB, 116 views)
__________________
Custom DIY PCBs, BOM and LDR Firmware:
https://sites.google.com/view/dacgear/
  Reply With Quote
Old 7th April 2020, 07:52 PM   #10
zdr is offline zdr  Belgium
diyAudio Member
 
zdr's Avatar
 
Join Date: Nov 2005
Location: Brussels, Beograd
Final version, boards ordered.
Attached Images
File Type: png PGA PRE.png (907.5 KB, 45 views)
__________________
Custom DIY PCBs, BOM and LDR Firmware:
https://sites.google.com/view/dacgear/
  Reply With Quote

Reply


ESP32 driven PGA2320 preamp/IO switcherHide 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
ESP32 i2s Audio Widget with LAN sgpu Digital Line Level 2 10th June 2018 04:23 PM
Looking for a PGA2320 PCB maximillian Analog Line Level 7 8th June 2012 01:28 PM
PGA2310 vs. PGA2320 error401 Chip Amps 3 29th December 2011 08:51 AM
PGA2320: control issue AudioWizard Parts 10 2nd June 2010 08:50 PM
PGA2320: anyone? AudioWizard Parts 2 20th July 2005 03:39 PM


New To Site? Need Help?

All times are GMT. The time now is 06:18 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
Wiki