Modular Preamp Design

Thanks Geoff,

The datasheet assumes a 5V power supply independent of the control circuit, but I'm using 3.3v via the ESP32's weaker internal pull-ups. In this circuit, the extra resistors aren't required. It also has a nice side-effect of keeping the button board a little more simple.
 
After a few prototypes, I've updated all the boards except the volume and screen boards.

There's a new input board that removes the output components in favor of an updated input board that supports one (1) single ended input. The input board has an optional daughterboard that clips on top and converts the SE input into a fully differential output. It requires an additional power supply (+/-15V DC) but allows the connection of a single-ended input.

I would really appreciate some feedback on that particular circuit as it's the first time I've attempted this.

The new output board provides both RCA and XLR outputs. It's not strictly required, you could add your own connectors and solder straight to them.

Thanks as always!
 
Control Board

2I26iz8.jpg


The control board is the brains, it connects to the other boards, reads the inputs from the volume and input dials, produces the content for the display and runs the onboard webserver (for configuration). The control board can support up to 128 volume steps and up to 8 inputs on a separate input board. The control board is electrically isolated from all audio paths - this separation keeps the noise from ICs away from the audio components. The microcontroller is the Espressif ESP32, a 32-bit microcontroller with two cores at 240MHz, tons of GPIO, built in WiFi and Bluetooth and more. It's a very powerful controller.

Components
The board is almost entirely through-hole componentry, with the exception of the Espressif ESP32 which is only available as SMT. The ESP32's edge solder points means that it can easily be soldered with a fine-tipped soldering iron or with a heatgun. This board may look complex, but really it's a fairly simple build and should only take 30 minutes or so to put together.

All the components for the board are available from DigiKey and should be available from Mouser and equivalents can be found on LCSC.

Power
The board contains a 5V power supply (relays) and 3v3 regulator (ICs), so all that's required is a 7-9V transformer. Due to the low cost and simplicity, the onboard power supply is preferred.

Optionally, these components can be omitted and an external 5V power supply can be used. To use your own power supply, omit D1, C1, C2, D2, U1 and C3. Connect the 5V power supply where marked on the footprint for U1. I use screw terminals for power connections, but you can use any connector with a 2.54mm spacing footprint.

Display
While the control board can work (with some firmware tweaks) with almost any off-the-shelf OLED, the screen board and firmware are designed for the Newhaven 3.12" 256x64 OLED. This display is available in white, blue and yellow. The board uses standard pin headers, so any display can easily be connected instead, although some firmware changes may be required.

Firmware
The firmware is (currently) written using the Arduino framework. The code is available on GitHub and I will offer binaries as well. The board needs to be programmed once via serial (a simple process). Once the initial firmware is loaded, the firmware can be updated via WiFi without any need for physical access. The firmware supports naming of inputs, setting a maximum volume and startup volume and many other features. Input selection and volume can also be set via the web interface (more details on that later).

Web UI
cvFo5AX.png

The web UI runs on the ESP32 and provides a way to control the volume, select an input, name the inputs (so you don't just get INPUT1, etc. on the screen) and set system settings. You can also update the firmware from the web UI, so you can update the firmware without access to the lid.

VNOif86.png

R5nJ49B.png
 
I'm glad you asked!

I've been working hard on this; I've disovered I designed in some elements that weren't needed (mute relays), oversized a few capacitors and missed a few things (like a power LED!). My current set of prototype boards works with a few hacks and last night I ordered what I hope is a set of final boards.

Yesterday, I ran my first full audio test and it passed with flying colors! It's passive components only at this point since the SE>Balanced and Balanced>SE boards aren't here yet, but the design is a well known one and I'm not expecting any issues. I've also put together a small dual-rail PSU for the SE>Balanced and Balanced>SE boards. These are designed as optional plug-in daughter-boards for the input and output boards

I'll upload (what I believe is) the final set of boards this weekend. I've ordered them from JLCPCB - without the input boards (mine are fine) and with expedited shipping, I spend something like $59 on PCBs. The input boards are larger, so expect to add around $10 to the total. That'll give you five of everything (minimum quantities) so expect spares!

The software design is also coming on nicely, all systems now work correctly, you can update the firmware remotely and you can control the system from a web-browser. I'm working on some tweaks (like being able to name your inputs).

I've also created Projects on Mouser that I'll share so you can simply hit "Order" and get the parts you need (this will also give you pricing).

Next up is to stuff the final set of boards and then start designing a case for this!

E487q0m.jpg
 
I've updated the first post with the latest boards and I've included BOMs in the Google Drive folder (link in the first post). I've also included BOMs that I've saved at Mouser so you can see how much this will cost, although if you're not in the US then you can use the BOM in Google Drive to order from your own supplier!

Cheers,
Phill
 
There's one thing I could use some help with, if there are any volunteers...

The output board features a pair of XLR connectors and a pair of RCA connectors for single-ended outputs. I would like it to be possible to use both the balanced and single-ended outputs at the same time, for example connecting both a power amplifier and subwoofer.

The current output board will need some modifications to support this, which I can do.

I would like to put this design onto an optional daughterboard for the output board, which can be installed to provide both outputs if desired. I would like the output board to work with both the single-ended and balanced input boards, so I need a design that can support both single-ended and balanced inputs (this would be either/or) and then provide single-ended and balanced outputs that can be used at the same time.

I'm no expert in this domain, and could do with some help to get started. Any suggestions? I'm looking for something that uses the lowest number of components, preferably not using SMD.

Any help would be appreciated!
 
Mark, I also just noticed your comment about a remote control. I haven't provisioned for an IR remote since the ESP32 supports Bluetooth (and BLE) so can be paired with a remote of your choice (as long as it supports Bluetooth). That's something I need to bake into the firmware yet, but it's certainly possible.
 
More progress!

The software for the Advanced Control Board is coming along nicely, you can select inputs and set volume (that was already working) but not you can name the inputs through the web interface as well as setting volume and selecting inputs. You can also assign an icon to an input which I'll be adding to the display as well at some point. A few other options are working too, like dimming the screen 10s after your last adjustment (this is good for screen life and stops the glare). I'm also working on being able to add it to your own wifi - at the moment it runs as a hotspot you have to connect to.

From a hardware perspective, I have the final Balanced Input Board and Advanced Control Boards built. I trimmed down the volume board, so I'm waiting for my final PCBs to arrive as well as the last set of components for that board. I needed to order a few PCBs so I could build the power boards for my new DAC anyway so I just added these to the order.

Lastly, as you might notice, there's a new board. I realized that not everyone requires a bluetooth/wifi enabled preamp and, to be fair, the ESP32 isn't the easiest to solder. I've added a new Basic Control Board that simplifies the power requirements (no more 3.3V) and uses Atmel's ATMega328PU chip instead. It's an eaiser build, is compatible with the other boards except the button and display boards (but don't worry, there's a new display board that works with both). It uses a simple pot to set volume (still using the Volume Boards) and a button to select the input and has provisions for an IR receiver for remote control. This makes it a more simple build. I've got my prototype working (except the IR input) and the boards on order, so I'll let you know how it works out!
 
OK, so it turns out that the AliExpress displays, even though they advertise 5V tolerance, don't really support it. Even if they step down the 5V to 3.3V (which most don't) to power the display the logic will still be 5V. While it technically works, it can be unreliable and can reduce the life of the display (and controller) according to the chip manufacturer.

So after some careful thinking (and drawing up some board designs where the display contains a regulator and logic convertor) I've decided it's simpler to just include a 3.3V regulator on the basic board as well. It only adds a few dollars at best and it's a far more stable design that maintains simplicity on all the other boards. I'm also considering connecting all the pins on the Basic Board to the Display board, so the same controls could be used, or a pot. This will take some careful programming on the board, as you'll need to be able to select which! New Basic Control Board designs coming up.

@geoffcooper... More than happy for some input Geoff. I'll ping you back.
 
OK, so there's a new Advanced Control Board (I think this will be the final version) and a Basic Control Board.

The new Advanced Control Board has a slightly different power circuit. The 3.3V and 5V lines are now separate - previously the 3.3V regulator was fed from the 5V regulator. This makes the system more power efficient and means we can use a better 5V regulator (lower quiescent, etc.) since the ESP32 and other chips are not drawing power from the 5V regulator. It also includes provisions for an IR port that's broken out at the NHD Display Board.

The Basic Control Board uses the same power circuit as the Advanced board and now features connections to all the same ports, so we should be able to use the rotary encoders as in the Advanced Board. I'm still planning a board with a pot (for simplicity) but now it can be used with either control board (yay!)

Finally, there's a new NHD Display Board. It's basically the same, but now has the IR breakout for a remote (compatible with both boards) and is the same size as the actual display, so it can be securely mounted to the back of the display.

I'm ordering them all now, so should be building in a week or so. I don't forsee any issues or changes with either board, so I think these will be the final designs now. Which is good, because all these revisions are costing me a fortune!

I've also added links on the first post to the code on GitHub. I'll be creating binaries pretty soon, so you can simply upload them to the boards without needing to be a code developer. I'll include instructions on how to flash both boards. The BOM for each board includes the programmer needed for that board.
 
OK, so @geoffcooper and I have been talking over email, and have a proposed change to the design. Geoff pointed out that the current design means you can't integrate other modules as well as I had hoped, and he's right. It's not as extensible as I wanted, so it's hard to make your own modules.

Shift to i2c for control
The basic idea is to move the GPIO expanders to the peripheral boards (input board, relay volume board, etc.). This greatly simplifies the control boards, since they're now basically MCU + power supply. Both control boards will provide i2c output via a dedicated header. Each peripheral board will then have an "in" and "out" link, allowing you to chain the boards together. The i2c IDs will be set using jumpers. This also has a nice side-effect of actually making the boards smaller, so they'll fit in smaller enclosures.

Another benefit here would be the easy adoption of PGA-based volume boards. These can also be modular (like the current Relay Volume Board). Two or more can be used together by simply setting the same i2c address on both boards.

Use a 16x2 LCD for the Basic Control Board
The ATMega328p really struggles to drive the large SSD1322 OLED, it's a complex display with 16,384 pixels and requires a lot of memory to draw pages. While the ATMega *can* drive the display, it consumes many cycles which impedes input (like changing the volume). Using a more simple display for this board will make it much faster. It also runs over i2c, so it can be daisy-chained with the other modules!

Switching power supply
The current power supply design has a few flaws; for example, even when the preamp is put into "sleep", the peripheral boards are all still powered. Having the MCU control the 5V power supply will power off all the boards and, hopefully, stop the output. Which brings me to...

Non-latching relays for Input Boards
I discovered this one last night. The use of latching relays throughout the design means that when you power off the system... you still get sound. This is because the relays are all still set. I don't plan to change the Relay Volume Board, but I will be changing the Input Boards for non-latching relays. This means that unplugging or "sleeping" the preamp will turn off the sound.

So, now I'm after a little input. Are there any objections to such design changes? I don't expect any of these to impact audio quality, especially since the audio paths and power paths never cross with the current passive modules.

EDIT
Oh, and in case you're wondering about my own progress, I'm currently waiting for my chassis to arrive. My boards use the old design (where the GPIO expanders are on the main board) but I'll probably swap them out over time. I've invested heavily in relays and I'm at pains to replace them *again* just now...! The great thing about a modular design is that I can swap them over time!
 
Last edited:

PRR

Member
Joined 2003
Paid Member
> The ATMega328p really struggles to drive the large SSD1322 OLED

It's a $2 chip. Buy one to turn the knobs/switches, a second one to paint the display. The interface is presumably a very slow and low-priority interface. Set the volume/relays, then send a few bytes to update the display.