Published December 14, 2025 © GPL3+
PT2258 paired wih ESP8266 to get the maximum from a tone controller, PCB and code with video setup is shared in this tutorial.
IntermediateFull instructions provided2 hours**13
Things used in this project
Story
In the past, I have uploaded many tutorials on how to design a perfect preamplifier. And in the race for the best one, I am developing some new preamps this time, …
Published December 14, 2025 © GPL3+
PT2258 paired wih ESP8266 to get the maximum from a tone controller, PCB and code with video setup is shared in this tutorial.
IntermediateFull instructions provided2 hours**13
Things used in this project
Story
In the past, I have uploaded many tutorials on how to design a perfect preamplifier. And in the race for the best one, I am developing some new preamps this time, all of which are based on a single IC. The interesting thing is that we can control these preamps through a web server through WIFI. Today, we have here, PT2258, a 6-channel electronic volume controller IC, designed for the new generation of AV Multi-Channel Audio Systems.
So this is an all-digital system in which we got an I2C Control Interface, an attenuation range of 0 to -79dB at 1dB/step, low noise, and high channel separation. This is very interesting because now we do not need those big circuits and potentiometers to adjust volume through any microcontroller.
Housed in 20 pins, DIP or SOP, PT2258’s pin assignments and application circuit are optimised for easy PCB Layout and cost-saving advantages. Although the system may have some disadvantages because everything is based on an IC and some external components, the flexibility to work with this system decreases on the hobbyist end. The PCBs are fabricated from NEXTPCB, they have done the perfect job.
This type of IC is used in surround sound-type things, where we need to adjust the volume of more than two channels. Some of the listed features of PT2258 are:
- Least External Components
- Attenuation Range: 0 to -79dB at 1dB/step
- Operating Voltage: 5 to 9 V
- Low Noise, S/N Ratio>100dB (A-weighting)
- High Channel Separation
- I2C Bus Control Interface
- Selectable Address
- 6-Channel Outputs
Components Required:
- PT2258
- ESP12E/ESP8266
- 47uf/10uf electrolytic capacitors
- 10K/100K resistors
- 3.3V AMS1117 regulator
- Some pin headers
- 5V power source
Circuit diagram:
I have taken the reference from the circuit given in the datasheet. Here, you can see that the IC has 6 channels. We need 6 inputs and 6 outputs. If there is no signal, the input is referenced to ground by a 100K resistor, and a 10 μF coupling capacitor is also present, which behaves like a filter with the resistor arrangements. Because the circuit is fixed, the only controlling input to the IC is the I2C bus, allowing us to connect any microcontroller.
Now, here is the circuit diagram I used for the IC. Since we have only one I2C bus, the ESP8266 supports this protocol, and it has Wi-Fi, so we can utilise these features. There are a lot of revisions you will find on the internet using the same code and libraries for this DSP. But now with this microcontroller and web server, we have eliminated a lot of components. No need to print the data on screen, and no need for external push buttons. However, there is always an option to do this because most of the microcontroller’s GPIOs are available.
PCB Design:
I want to keep the system minimal, the reason is that there are analogue and digital parts that are on the same circuit board, and the data is travelling through SCL and SDA lines. The audio is not such a high frequency, but we should follow proper guidelines. The best thing is to route these digital signals away from any analogue signal and surround them with ground planes.
For the assembly, because I have used mainly the THT components, which can be soldered by hand, moreover, only the ESP8266 is the one using SMD pads, where you may get some issues. Still, I always recommend soldering the SMD first, then moving to the THTs, and finally to the header part. In this way, with minimum time and effort, you can solder this board. All the links to FILES: GERBER/BOM/CPL are here.
The same is implemented here in the design; I use ground fills on both layers, which can be connected with vias and ground stitches. Moreover, the LDO is in the middle, powering the ESP8266, and all other systems run at 5V. The signal may get interference if the supply used is SMPS, so try to go with batteries or a good power adapter with EMI shielding to reduce the overall noise. The PCB features programming headers on the bottom layer, where all connections are made to another ESP8266, allowing for programming to be done. To see the step-by-step programming tutorial, please refer to this link.
Taking the Project to the Next Level - With JUSTWAY
Electronics without proper housing and the audio circuit, they simply would not work. Yes! Because to keep the system available to us a proper 3D casing should be there. JUSTWAY assists you in turning your do it yourself project into a high-quality prototype that feels and looks like a genuine product that is ready for the market. What they do:
- Rapid Prototyping
- CNC Machining (Aluminum 6061 / Stainless Steel 304)
- Sheet Metal Fabrication
- Injection Molding
- Urethane Casting
- 3D Printing (SLA & HPA-PA12)
Just 4 Easy Steps to Order: Upload your CAD files at JUSTWAY.com, Select the material & finish then preview your model in 3D and place your order.
Code:
We can program the ESP through Arduino. A complete tutorial for this is already shared on my profile. In this code, we are utilising the basic Arduino libraries. These libraries can be downloaded from the Library Manager, located under the Tools menu in the Arduino IDE.
#include <Wire.h>#include <ESP8266WiFi.h>#include <ESP8266WebServer.h>// ===== WiFi Credentials =====const char* ssid = "iPhone";const char* password = "alpha5";
Just fill in the SSID and password, and connect the same network to the PC (webserver) and the ESP.
// ===== I2C Functions =====void pt2258_send(char d, char e) {Wire.beginTransmission(ic_address);Wire.write(d);Wire.write(e);Wire.endTransmission();}
The complete code is shared below, which I am using for this tone controller. The section shared above is the I2C transmission, which sends the data to the PT2258.
The programming is done in a manner that requires no external libraries and is extracted directly from the datasheet, keeping the working process minimal and fast.
Web Server:
It is the HTML-coded part in the programming section, where all the GUI and I2C logic is implemented. After uploading the code to the ESP, you will get an IP address. After opening this IP in the browser connected to the same network, you will get this interface:
Master Mode:
The volume of all six channels can be controlled through a single slider.
Channel Mode:
6 different sliders for each channel means complete flexibility over surround sound.
Video:
Here is the proper video, with a step-by-step guide to setting up the WIFI and web server:
POP noise:
When turning on the system, due to line interference, this noise can enter the system. When changing the settings on the web server, the POP issue may occur if the amplifier you are using does not have proper input circuitry. Using the tweeters with this system is a terrible idea, but I only have them aligned around, hence pairing them.
Closing:
It is just a tone controller, but the interesting thing is the 6 channels, which can be controlled through the server. The file code and PCB have already been tested, and the process is also shared in the video above. To create a proper DSP that can control bass, Treble, mids, and volume with an equaliser mode is dropping soon on my profile. Please check that also within one working day after publishing this article. And if you like the concept, please comment below for more ideas and checkout the Justway for 3D printing and moulding services.
**Read more