200W Amplifier Design

Here’s a 200W amplifier design for your home audio. It is a class AB amplifier. It is capable of delivering more than 200W at 4 ohms.

About the Circuit

There’s nothing special about the circuit, you can find it all over the internet nowadays.

Simulation

I simulated the circuit using simetrix software. You can download the simulation circuit on our download page so you can play with the circuit and component values. Be mindful on the power of the output transistors.  You can increase output power by adding output transistors but you also need increase the supply voltage. You need to take note that the output transistor TIP3055 and TIP2955 can only have VCE max at 60V. In practice you don’t want to get near to that voltage. The safe supply voltage for this transistor should be around 45V.

PCB Design

The PCB design is simple and used 1 layer PCB only so anyone can build this project easily. You can also download the project on our download page if you want to modify it for your own requirements. My PCB design is simple and there are many rooms for improvements. The size of the filter 1000uf capacitor may be small in actual, you may need to check this before making the board. If you can change it with 2200uf capacitor then that would be better. But take note that this will be bigger capacitor. These capacitor are used to help supply power during big current draw. These high current draw usually happens during bass drum beats, especially if you set your bass to maximum. Supply voltage drops during bass drum beats due to high current draw and power supply output impedance.

These capacitors also helps reduce hum noise by filtering ripple voltage coming from the power supply.

The high current nodes such as power supply and output can be improved by making the trace wider. By making the trace wider on those nodes reduces voltage drops on those trace. This can improve bass performance.

3D Render

3D rendering is build-in on the KiCad software and this software is free!

Power Supply

This circuit can be powered by 24V up to 32V transformer. The transformer should be center tap and at least 8A for single channel.

 

image credits: interfacebus.com

NOTES:

If you want a very reliable design that doesn’t easily fail for years, the key is over designing. Design it to handle 200W and operate it at 100W and expect it to have longer life. This is because there is less stress and heat on each component if it is operating below its power handling. If you have computed that a resistor will consume 0.2W then use a 0.5W resistor or larger. Using a 0.25W resistor will still work but will eventually burn overtime.

DOWNLOADS





You can download the Kicad and simetrix project on our download page

3band tone control using transistor

Here’s a simple 3 band tone control circuit with 1 transistor instead of using opamps. This is using a single 12V supply. The frequency response is not as good as with using an opamp but it is still acceptable provided you just want a way to boost bass, treble, and mid frequencies. The transistor used is a BC549 but this can be replaced by any general purpose NPN transistor like 2N2222, etc.

 

VR1 =Treble
VR2 = Mid
VR3= Bass

Simulation result

As expected the response is not as good as what you can get with using an op-amp version but it is good enough for home sound system where you don’t need a very flat response. Each of the controls can affect the whole sound spectrum.

Bass Response at 0%, 25%, 50%, 75% and 100% setting

MID Response at 0%, 25%, 50%, 75% and 100% setting

TREBLE Response at 0%, 25%, 50%, 75% and 100% setting

Extreme settings:
green – bass = 100%, mid = 50%, treble = 100%
red -100%, mid = 0%, treble = 100%

As for the graph above, the mid setting will greatly affect the treble response. This is still good to use is you just want to boost bass frequency.

MIC Preamp type Circuit

The circuit above can be used for mic preamp. This is a simple but not outstanding. The performance is just ok for low end home audio. But for high performance audio, you should go with opamps especially made for audio applications.

IOT: Wifi controlled Audio tone control

Internet of things is becoming a thing these days. Internet connected gadgets and appliance are becoming more common these days. The advantage is very obvious: you can control these devices using your smartphone with internet browser, specially made apps or with voice command using google assistant. One of the goal of this project is to create a tone control with bass, mid, treble and source selector that can be controlled via smartphone or laptop with an internet browser. You can also develop an app for this but I haven’t have time to do so.

About the Circuit

The heart of the circuit is the NODEMCU – a wifi module that can be programmed using arduino IDE. If you are already familiar with arduino then this can be easy for you. It is connected to a 1.44 inch tft lcd with ILI9163 driver. The preamp is based on TDA7419, this is a digitally controlled tone control via I2C. This features bass, mid, and treble controls with adjustable frequency. This also has a 7 band spectrum analyzer which is better than using an FFT on arduino. This makes it easier for the programming since you only need to read an analog pin directly rather than doing the FFT calculations on arduino which is a bit of a headache to do.

The TDA7419 is powered with 8V so an 8V regulator 7808 is needed. It is also used to power the Nodemcu for wider operating voltage (most nodemcu can only operate up to 10V only). 7808 regulator can operate up to 35V input voltage. You can also use any regulator as long as it has 8V output and a sufficient output current.

As you can see on the schematic, there is only 1 left GPIO on the nodemcu which is the D3. There is still GPIO9 and GPIO10 but many claims that they are not usable and are not recommended to use. This is the reason why I am not continuing this project with this kind of display. By using an I2C display, I can free up 5 GPIO’s that can be used for buttons.

About the Software

The software is developed using arduino IDE. Note that this is not very well developed, there are many rooms for improvement. I won’t be improving this software further because I decided to replace the display with an OLED I2C desplay. The reason is that the ILI9163 TFT display needs more GPIO and nodemcu has very limited GPIO. Using an I2C display will free up GPIO for other functions.

The device will not start the initialization of the TDA7419 without a wifi connection. Once it established a wifi connection, it will then go to initialization on the system. That is how I designed it, because it was just a quick programming for proof of concept only. Like what I said –  there are many room for improvements here. I just posted this project for those who want to have a quick start. For the next version of this project I will be using an OLED display to be able to use the 5 GPIO for buttons and other functions.

Prototype

For the prototype, I used LM317 instead of the 7808 voltage regulator, because that’s what is readily available on my stocks. 🙂


demo: working. (Note: I accidentally cracked the LCD 🙁 )

The IP address is displayed on the LCD. This is entered on your web browser to access the controls. Take note that you have to connect on same wifi to be able to access the device.

Controlling with web browser

This is a simple webpage I made which can be improved further. The basic functions are there so you can use it as is if you prefer. There are many rooms for improvement here.

Downloads

You can download the source code on the download page

Simple Direct Injection Box

Here’s a simple Di Box that you can build. In case you don’t know the purpose of Di Box, it is used to connect unbalanced output to balanced inputs. For example, a guitar has unbalanced output and a mixer have balanced input. Balanced lines are used for long cables audio because it is able to cancel noise on long cables.

About the Circuit

The circuit use an NPN general purpose transistor. You can use any general purpose transistor here similar to 2N2222 transistor.

 

Simulation

The positive output(emitter side) has slightly higher gain because emitter current is slightly higher than collector current. The difference is minimal and may not be an issue.

Simple 9V 4 channel Mic mixer

Here’s an improved version of my simple mic mixer featured on this page. It is powered by 9V battery so you can make it portable.

About the circuit

The circuit is made of transistors only to make it simple. I didn’t use any op-amps on this project. You can basically build this circuit using universal PCB’s

It has 5 potentiometers. 1 for each channels and 1 for master volume. It can be used for guitars and mics.

Circuit Simulation

For simulation I used signal generator set with sinewave output at 50mV and each are set at different frequencies.  This is to be able to see each frequency on the output waveform. As you can see on the simulation of the output waveform, it has different frequencies.

 

PCB design

Here’s a simple PCB design that I made. As you can see, the design is very simple and only has few components. The layout is not perfect but at you can have something to start to. You can still improve this layout. 🙂

3D render by Kicad

DOWNLOADS
You can download the Kicad project file here:



Download page <- find the download here

……

Measuring Voltage using arduino

If you want to monitor a voltage level that is higher than the voltage that arduino input can handle, you will just need to use a voltage divider.

About the Circuit

Basically you will only need a voltage divider if you are measuring voltage that is greater than the max input voltage of your arduino.

“Vin” is where you will input the voltage to be measured. R1 and R2 forms a voltage divider to decrease voltage of the Vin. The value of R1 will be based on the max voltage that your Vin can reach.

Let R2 = 100k, you can choose higher value but check the computed value of R1 will be easy to find.

The maximum voltage that this arduino nano can handle is 5V so we will use that to compute for the value of R1. R1 is computed such that Va0 level is 5V at Maximum input voltage.

Computing for R1

For instance you are expecting the maximum input voltage is 15V, add about 10% to that to have a little headroom. So you will use 16.5V for your computation.

Vinmax = 16.5V
Va0max = 5V

R1 = (Vinmax – Va0max)/Iin

Iin = Va0max/R2

R1 = (R2(Vinmax – Va0max))/Va0max

R1 = R2((Vinmax/Va0max)-1)

replacing the value to the equation yields:

R1 = (100k)((16.5/5)-1)

R1 = 230k

Computing on software

Arduino will give you the digital value and not the actual voltage value so you need to compute and consider the voltage divider to be able to get the actual input voltage.

Actual voltage is computed as:

Vadc = (adc_val/adc_res)*adc_vref

where:

adc_val – digital value from the adc module
adc_res – ADC resolution, 1024 in case for arduino nano
adc_ref – ADC reference voltage. it is 5V default on arduino nano. This can be changed via program

And consider the voltage divider:

Va0 = Vin(R2/(R1+R2))

Vin = (Va0(R1+R2))/R2

Vin = (R1Va0 + R2Va0)/R2

Vin = Va0((R1/R2) + 1)

And since Va0 = Vadc then…

Vin = ( adc_vref(adc_val/adc_res))((R1/R2) + 1)

Now let’s put it into practice:

int adc_val;
int adc_ref;
int adc_res;
double Vin;
int R1;
int R2;

adc_ref = 5;
adc_res = 1024;
R1 = 230; //k
R2 = 100; //k

// read analog input

adc_val = analogRead(0);  // 0 = Connected to A0

Vin = (adc_ref(adc_val/adc_res))((R1/R2)+1);

Displaying it into the LCD

// include the library code:
#include <LiquidCrystal.h>// initialize the library with the numbers of the interface pins – The numbers
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

int adc_val;
int adc_ref;
int adc_res;
double Vin;
int R1;
int R2;

void setup() {
adc_ref = 5;
adc_res = 1024;
R1 = 230; //k
R2 = 100; //k

    // set up the LCD’s number of columns and rows:
lcd.begin(16, 2);
   // Print a message to the LCD
lcd.print(“hello, world!”);
}

void loop() {
// read analog input
adc_val = analogRead(0);  // 0 = Connected to A0
Vin = (adc_ref(adc_val/adc_res))((R1/R2)+1);
// set the cursor to column 0, line 1
    // (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
    // print the number of seconds since reset:
lcd.print(“Voltage:”);
lcd.setCursor(1, 1);
lcd.print(Vin );

}

Related: CONNECTING ARDUINO NANO TO 16×2 LCD

Vintage Guitar Preamp re-design

I have seen this circuit many years ago and I did planned to build this circuit but I never got a chance. This time though let’s try to re-design it to work with lower voltage and use an smaller amplifier for practicing. I am planning to use it for 12V or 9V amp so we need to modify it to work below 9V instead of the 60V supply which is the original design.

About the Ciruit

This circuit is all over the internet now and you can find it in many website. It is quite simple although the biggest problem in building this circuit is the operating voltage which is 60V. I will try to modify it to work with 9V supply. This task should be easy by using simulation software such as simetrix. I’m too lazy to compute so I just modify it by trial and error on the simulation by intelligent guessing of course! The main focus here are the high side resistors such as R3, R6 and R17. The goal is to decrease its value until you will come up with same bias level with the original supply voltage.

There is a small error I spot on this design – C11 should be connected to ground and not on the emitter of Q3. I wonder how they made this error.

Simulation Circuit

Again, I am lazy to match the names of the device on my simulation model so let’s keep it this way. 🙂

I did not included the “Harmonic Modifier” circuit on the simulation circuit because I want to keep it as is.

Bias Levels

I only have noted those points of interest here:

The level at Q3-emitter is around 26V, since our goal is to operate it at 12V, it wont be able to reach 26V when VDD is only 12V. We just need the voltage at this point to be half the supply. Same is true with Q2-emitter voltage.

Frequency Response

Here’s the frequency response of the original circuit.

 

Here’s the 12V modified version:

There are minimal changes, the base bias of Q1 and Q3 have been modified to make it simple. Added R20 and C7 to make up the gain at low voltage operation.

Simulation result of the modified circuit

The circuit has slightly higher gain. You can try to experiment on the values of the  resistors and capacitors. You can download the simulation file below. Simetrix is used for this simulation. It is a free software.

 

PCB Design

The PCB design is made using the kicad software, it is also free so anybody can download and use it. The design is very simple because I have no plans to build it for now. I just wanted to share the design for those who want to build this kind of project. You are free to edit it for your own requirements.

The design of the PCB is pretty basic. You can download the PCB project file below so you can edit it based on your requirement.

The best feature of Kicad is that you can view your design in 3D! This is a feature you wont expect on a free software! 🙂

 

DOWNLOADS:




Download Page

 

XH-M548 Bluetooth Amplifier review

I recently bought this board for a personal project for my house. I thought it will be helpful for some folks out there that are planning to buy one. The board specs are impressive but you’ll be disappointed when you learn the actual figures. It turns out, those specs are just for marketing reasons.

The BAD things about this module

Wrong Output Power Claims

It claims 120W x 2 output power but in reality it only can handle 50W x 2 output max. Why? It only have 1 TPA3116 Amplifier chip on board which is only capable of delivering 50Wx2 power output. The large heatsink made me think that it have 2 TPA3116 chip but I was wrong. Looking at the bottom it will become obvious that it is only using 1 IC.

Aux input not Working

The aux input circuit is wrong. It is connected to the output of the op-amp which is a bad idea. Although this connector is not labelled “input”. But I know most of us will assume this is an Aux input as most bluetooth amplifier have. Based on the schematic, it will work as an Aux output rather than input.

Muting the Main Amplifier when no music is Playing

The bluetooth module is programmed to automatically mute the TPA3116 amplifier chip when nothing is playing on the bluetooth receiver or it is not paired. This is the reason why there is no audible hum even if I am touching the amplifier inputs.

Annoying Power on sound

It is not an issue if you are only using it with small speaker but it is very annoying for a 100W speaker. Or maybe its just me. The power on sound is a 3 note melody if I remember it right.

20W Audio Amplifier LM1875

LM1875 is an old yet reliable Audio amplifier IC. It is very common and you can get it for very cheap price. With this IC you can get up to 30W power output with 33V supply using 8 ohms speaker.

It has very simple circuit and very easy to build because it requires few components. This design is for single supply application. You can find more information about this IC on its Datasheet on this link.

PCB Design

This time around I am playing with Kicad. It’s is very different from what I used to but it has more feature and best of all its free! The layout is not yet optimized(i.e. size of the trace) because i am still learning. But you can download the project file so you can edit it for your own project. The size of the capacitors are just assumed.

3D render

The best about Kicad is that it has built-in 3D rendering feature for your board at no cost. This is a very useful tool for visualizing your project.

Downloads

You can download the Kicad project here:



Download page

 

Connecting High Power LED to Arduino

Arduino digital can only drive a few milliamps and up to 5V only. You can’t use it to drive a high power LED directly. If you want to drive a high power LED using Arduino, you need to use a driver.   There are 2 options, 1 is to use a transistor driver or use an IC driver. A transistor driver is the easiest option, it will only require 3 components(2 resistors and 1 transistor). The transistor is either a MOSFET or a BJT.

Figure 1 – Driving LED using BJT

In the example above, we are using a NPN transistor for driving a LED. R1 is used to limit the current coming out of the Arduino. Without R1, Arduino digital pin might got damaged due to high current sinking from the output pin. The output voltage of the Arduino will be limited to the Vbe(base-emitter voltage) of Q1 without R1. While R2 limits the current for the LED.

R2 = (VDD – VLED – VCEsat)/ILED
where:
VLED – voltage of the LED
VCEsat – saturation voltage of the Q1 at ILED current
ILED – current of the LED at VLED
VDD – supply voltage(in this example: 5V)

  • Note: You do not need R2 if VLED is equal to VCC. For example if voltage of the LED is 12V and your supply is also 12V, R2 will be useless.

Minimum value of R1:

R1 = (Vout – Vbe)/Iin
where:
Vin – output voltage of Arduino (usually 5V or 3.3V)
Vbe – base-emitter voltage of Q1(usually around 0.5 – 0.7V)
Iin – Max output current of Arduino ( ~10-20mA)

Max value of R1:
this is a little tricky so let’s derive the equation, shall we?

IC = Ib * β
replace Ib with equation from the circuit:
IC = ((Vin – Vbe)/R1) * β
IC = ILED
ILED = ((Vin – Vbe)/R1) * β
ILED/β = (Vin – Vbe)/R1
R1/β = (Vin – Vbe)/ILED

R1 = ((Vin – Vbe) * β)/ILED

where:
β – transister beta or HFE
ILED – LED current
Vbe – base-emitter voltage of the transistor
Vin – output voltage of arduino
IC – Collector current of the transistor

If you have computed lower maximum resistance than the minimum resistance then you should consider changing your transistor with higher HFE. You may consider using  a darlington transistor or a MOSFET.



LED Driver IC

LED driver IC is a bit expensive but it has some advantage. It can supply a constant current which leads to more constant brightness especially if you are using multiple LED’s at a time. It also has some sort of overload protection. It is also more efficient and very ideal for battery powered applications which will have longer battery life. It is not usually simple because it is usually using switching power supply topology.

 

Figure 2 – LED driver IC

Dimming LED with Arduino

Dimming is done by using PWM or Pulse Width Modulation. PWM works by rapid turning on and off of the output. The brightness of the LED is controlled by controlling the ratio of the on versus the off state. PWM is easily done with Arduino, thanks to its very simple library.

Sample code:

int ledPin = 9; // LED connected to digital pin 9
int analogPin = 3; // potentiometer connected to analog pin 3
int val = 0; // variable to store the read value

void setup() {
    pinMode(ledPin, OUTPUT); // sets the pin as output
}

void loop() {
val = analogRead(analogPin); // read the input pin
     analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
}

 

Note: analogWrite command only works on PWM pins. 

 

-tataylino.com