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

Digital Audio Mixer Project with ADAU1701

It has been my long desire to design a digital audio mixer but there a too little resources regarding digital signal processing. While researching I stumble upon this little chip from analog which don’t require DSP knowledge. It is program using a software called sigma studio. There is no programming language, you just need to drag and drop modules. I am still on learning process, and this is just a test of what can I able to pack on a cheap ADAU1701 DSP. Considering the price of this DSP and the size of its memory, these modules that I was able to put was amazing.

What I was able to get with the limitation of ADAU1701:

  • 8 input channels
    • all have 3 parametric equalizer
    • all have compressor
    • all have volume control
    • all have 1 pre aux
    • all have 1 post aux
  • 4 output channels
    • 2 as main output with 6 band equalizer
    • 1 as pre Aux output
    • 1 as post Aux output

That’s about it. Adding more modules will prompt an error that you are out of memory. Considering what most 8 input analog mixer are offering on the market, this features are better. This project can be further improved so I have uploaded the project file on my download page so you can edit it yourself.

Sigma Studio Project

Main Schematic

Channel strip

These controls can be accessed through a microcontroller connected to it via I2C. The microcontroller can then be connected to user interface such as buttons and displays like LCD.

10 Channel variant

I have tried to use the maximum possible inout of the ADAU1701 which is 10 inputs but simplifying the schematic and removing the compressor on channel 7 and 8. The 2 additional channel can be used for bluetooth audio. I was able to achieve the following:

  • 10 input channels
    • Channels 1-6 has HPF, 3 band Parametric EQ, Compressor, 2 aux sends
    • Channels 7 and 8 has 3 band Parametric EQ and 2 aux sends
    • Channel 9 and 10 has 3 band EQ
  • 4 output channels
    • 2 main out with 10 band graphic EQ
    • 1 Pre Aux out
    • 1 Post Aux out

I think that is the best I can have for ADAU1701 DSP.

Multi-track Recording

This is the biggest challenge for this project, for now I don’t have any idea on how can it be done and how it can work with the ADAU1701. What’s clear for now is that the ADAU1701 DSP can’t be used for this purpose. I know it can be done using the XMOS chip but the development board is too expensive for me.

Conclusion:

The ADAU1701 is a powerful DSP for audio application. It can surely be used for digital audio mixer application with limited input channels. 8 channels maybe the most channels you can have for this application. You can have as much as 10 total inputs but you need to limit some functions like compressors to be able to use all the 10 inputs or else you will ran out of memory and the project will not compile at all.

Notes:

  • ADAU1701 only have 2 ADC channels build in, you need an external ADC to be able to add 6 more inputs.

I have yet to build the actual hardware but I am not sure when I can do it. When I got the fund and time for sure but I am not sure when.

Downloads:

Download page

Arduino Controlled Bass Mid Treble and input selector

My LC75341 project was a bit of a disappointment. It was working ok but it only offers bass and treble controls. The frequency response is not that good. It has very limited controls. I decided to stop that project because it is not what I am looking for. Now after lots of research, I stumble upon this digitally controlled bass mid treble IC from ST. What is great is that it has 7 band spectrum analyzer feature and a differential input. Plus it also has Q and frequency control and a subwoofer output. This is almost exactly what I want to do.

Continue reading “Arduino Controlled Bass Mid Treble and input selector”

2 Way Active Crossover with adjustable frequency

Most of the schematic design of active crossover on the internet are mostly with fixed crossover frequency. Here’s an interesting circuit that I found on Elliot Sound Products website. I learned a lot on this website when I was just a student. If you love to build sound products such as amplifiers and tone controls, you may already know about this website.

Continue reading “2 Way Active Crossover with adjustable frequency”