Friday, March 08, 2013

Breadboard Basics 2: From Schematic to Breadboard - Audio Amp

Overview
In breadboard basics 1, we looked at how a breadboard is structured. In this post, we are going to look at how to move from a schematic to a breadboard, and the step-by-step decisions that would be involved in doing so.

We're going to build a simple audio amplifier! The aim of this post is to:
1) Give you the skills to work confidently with a breadboard
2) Give you the skills to read simple electronic schematics
3) Give you the skills to translate a simple schematic onto a breadboard for real-world use

Here is the schematic for this circuit. Don't be overwhelmed! We'll look at it step-by-step. This circuit is based on the LM386 power amplifier.


IMPORTANT: Audio Input Signal and Audio Input Ground should be swapped. This was a typo when I was making the schematic!


Demo Video



Parts List and Materials
• 1 x breadboard
• 4 x alligator leads
• assorted breadboard jumper wires
8 ohm 1 watt speaker and 3.5mm mono audio jack
9V battery and battery clip 
10k potentiometer
100uF 25V electrolytic capacitor
47nF capacitor
100 ohm resistor
LM386 amp








 







Schematic Representations vs Real Parts
In general, we can break the process of translating a schematic to a breadboard down into two parts:
1) What are the parts that we need? How are these parts represented in the schematic?
2) How does every pin and connection on each parts relate to the other pins and connections of the circuit?



To be specific, the way that I usually approach this, is I break the whole thing down into a step-by-step process:
1) Set up power supply on the breadboard, but leave the power turned off
2) Place a major component such as a main chip on the breadboard
3) Trace the schematic, and go from each individual pin of the main chip, following where the connections from that chip end up
4) Follow this tracing process for every pin on the chip
5) Follow this tracing process for every component in the schematic
6) Physically check my work against the schematic
7) Turn on the power supply




Connections in schematics are shown by continuous, thin lines, such as the ones shown above. These might physical be breadboard jumper wires or simply plugging the leg of one component directly next to the leg of another, so that they are electronically connected.




In many circuit diagrams, junctions are often (but not always) shown as dots where connections meet and join. On a breadboard, this might be four wires electrically connected in a power bus or a row, so that they are all joined to each other. Keep in mind that this doesn't have to be a physical wire; it could be the leg of a component meeting and joining a power bus or a physical wire.




Resistors are often shown as a zig-zag line. The two lines coming out of the zig-zag represent the two legs of the resistor.

Above the resistor, there might be a designation such as "R1", "R2", "R3" etc. This designation is used in a list of parts to differentiate this particular component from others. Below the resistor is the actual value of the resistor. The resistor shown in the diagram has a value of 10 ohms. In this case, ohms is not represented by the Omega symbol, but rather by the letter R. This is common.



The small-value capacitors (such as the 47 nanofarad or nF capacitor that we are using in this circuit) are non-polarised, meaning that there is no positive leg and there is no negative leg.

These types of ceramic or polyester non-polarised capacitors are represented by two parallel fat lines, perpendicular to the electrical connection going in to and coming out of them. The two lines coming in and going out of the capacitor represents the two legs. It doesn't matter which leg goes where.

Above the capacitor, there might be a designation such as "C1", "C2", "C3" etc. This designation is used in a list of parts to differentiate this particular component from others. Below the capacitor is the actual value of the capacitor. The capacitor shown in the diagram has a value of 47 nanofarads.




The larger value capacitor that we are using is a 100uF (microfarad) electrolytic capacitor. The capacitor is represented with a flat line with a plus symbol next to a curved line. Unlike the 47nF cap, this one does indeed have a positive leg and a negative leg.

The negative leg is marked on the capacitor itself with a white line and a series of minus symbols pointing at it. Furthermore, if the capacitor is brand new, the shorter leg will be the negative leg.

Once again, we have the designation above (C1) and the value below (100uF).








The symbol for a potentiometer (or pot) is shown as a zig-zag line with an arrow pointing at it. This closely resembles a resistor, because a pot is a type of resistor - a variable resistor with a moving wiper. We can literally think of the two outside legs of a potentiometer as forming a static resistor, with the centre leg being the variable part.

In the diagram, the lines that form the zig-zag lines are the outer two legs whilst the line with the arrow on it is the middle leg. We have - as to be expected - a designation (POT1) and a value (10k) as well.




The power supply for a circuit is a little more complex than the other components that we have looked at so far, in that it:

1) does not resemble a physical battery at all and
2) the positive and ground terminals are completely separated in the schematic and
3) there may be multiple "ground" points or "vcc" points but they should physically all tie back to the same negative (ground) and positive (VCC) terminals.

Vcc, Vdd, V+, Vs+ all mean the same thing - the positive terminal of our power supply, in this case the red connection of the 9V battery snap.

Vee, Vss, V-, Vs- and GND all mean the same thing - the negative terminal of our power supply, in this case the black connection of the 9V battery snap.



When I draw schematics, I usually draw connection points to external equipment as terminating junctions (shown above). Note that this terminating junction - in each case - represents a single physical connection.

In the case of the audio input signal, this represents the signal connection of the audio input - the short connector of the audio jack.

In the case of the speaker output +, this represents the signal connection going to the positive terminal of the speaker.

The long connection of the audio jack (i.e. the negative) should go to ground. The speaker output - (i..e the negative terminal of the speaker) should also go to ground.




Integrated circuits (ICs) such as op-amps and logic chips are often the most confusing components to decipher when it comes to circuit schematics, as they do not closely resemble their physical counterparts.

However, with a bit of thinking and searching, we can easily make sense of these too!

The problem is that ICs are often laid out in a schematic in such a way that makes electronic sense. For example, the LM386 above has: it's inputs on the left, it's output on the right, the positive voltage on the top and the ground pin on the bottom. This makes sense when designed a circuit but it does not resemble the actual physical chip at all.

So let's break it down.
• The LM386 has a total of 8 pins
• All chips of a similar shape have a half circle indent on the front face. This is the "top" of the chip
• All chips of a similar shape have their legs / pins numbered in the same way:
--- Starting with the pin directly to the left of the half circuit indent - this is pin 1.
--- Numbering from pin 1 in an anti-clockwise fashion, we go up until we reach the pin to the right of the half circle indent.
--- Thus the LM386 has eight pins numbers 1, 2, 3 and 4 on the left hand side and 8, 7, 6 and 5 numbered on the right hand side
• The schematic of the LM386 shows us which schematic connection corresponds to which leg number. There is one line coming out of the LM386 diagram for each leg, and each leg is numbered.

This same process applies to all ICs. Simply use the IC designation (e.g. IC1) and the leg numbers to determine where you are at with the physical chip.




From Schematic to Breadboard
Ok! So now that we know all the parts in our schematic, it's time to translate the schematic to the breadboard!

With each pair of images in the process below, we can see the schematic and the corresponding breadboard setup.

As the schematic is completed, the breadboard becomes more complex with more components added.

For your reference, here is the circuit schematic of the audio amplifier again:


IMPORTANT: Audio Input Signal and Audio Input Ground should be swapped. This was a typo when I was making the schematic!





Let's start off with a blank breadboard and just connect a 9V battery clip to the blue and red vertical busses. Connect the red connection (9V power) to the red bus. Connect the black connection (9V ground) to the blue bus. At the moment, this is not represented on the schematic, as we haven't really connected anything to the breadboard.




Connect the blue vertical busses to each other. This way, we can have access to ground on both the left and the right side of the breadboard. This is handy for more complex circuits. In the schematic, this is represented by the GND symbol.






Connect the red vertical busses to each other. This way, we can have access to 9V on both the left and the right side of the breadboard. This is handy for more complex circuits. In the schematic, this is represented by the Vcc symbol. By making these connections, we are 'creating' our power bussing structure on the breadboard.




Place the LM386 on the breadboard, so that the end with pin 1 and pin 8 are facing up as in the photo above. In the schematic, this is represented by the LM386 symbol.



Connect pin 4 of the LM386 to ground (blue bus). This is the grounding pin of the LM386 op-amp IC.





Connect pin 2 of the LM386 to ground (blue bus). This is the negative input pin of the IC. Note the common junction that goes to ground in the schematic.



Connect pin 6 of the LM386 to 9V (red bus). This is the Vcc power supply pin of the LM386.



Connect the 100uF electrolytic capacitor to pin 5 of the LM386. Pin 5 is the output pin of the LM386. Make sure that the positive leg of the capacitor is connected to pin 5. The negative leg of the capacitor should go to a new, unused row.


Connect the 47nF green capacitor to pin 5 of the LM386. Note the junction on the schematic. The capacitor has no polarity so it doesn't matter which leg goes where. One leg should go to pin 5, the other should go to a new, unused row.



Connect the 10R resistor to the unused leg of the green 47nF capacitor. The other leg of the resistor should go to a new, unused row.



 Connect the unused leg of the resistor to ground (blue bus). Note the junction in the schematic.






 Place the potentiometer on the breadboard, so that it takes up five new, unused rows.




Connect the middle leg of the potentiometer to pin 3 of the LM386. This pin is the positive input pin of the IC.





Connect one of the outer legs of the potentiometer to ground (blue bus). Note the junction in the schematic.



Connect a breadboard jumper with an alligator lead on it to the unused outer leg of the potentiometer. This is out audio input signal connection. Note the junction on the schematic as well as the representation of this terminal.

IMPORTANT: Audio Input Signal and Audio Input Ground should be swapped. This was a typo when I was making the schematic!





Connect a second alligator lead to ground (blue bus). In the schematic, this is our audio input ground connection. Note the junction on the schematic as well as the representation of this terminal.

IMPORTANT: Audio Input Signal and Audio Input Ground should be swapped. This was a typo when I was making the schematic!
 


Connect the other ends of the alligator leads to the audio jack. The audio signal connection goes to the short leg. The audio ground connection goes to the long leg of the jack.





Connect an additional two alligator jacks to the circuit - one to the unused leg of the electrolytic capacitor (for speaker +) and one to ground (blue bus) (for speaker -). Note the junctions in the schematic. Note the representation of these terminals.

IMPORTANT: Audio Input Signal and Audio Input Ground should be swapped. This was a typo when I was making the schematic!



Connect the appropriate alligator leads to the appropriate speaker terminals.




Connect the battery to the 9V battery connector, plug in an audio source, turn up the pot and you should hear sound coming from the speaker!

4 comments:

Sam said...

The LM386 is a power amplifier, not an operational amplifier. This doesn't matter for the circuit shown, but trying to use it as an op-amp can lead to unwanted results, such as self-oscillation.

Sebastian Tomczak said...

Hi Sam,
Thanks for the comment! My mistake. Corrected!

Unknown said...

Thank you! this is so awesome. I am going to make this on BB then make the circuit on this flexible PCB i have :)

I am trying to learn how to translate schematics to PCB designs

Sebastian Tomczak said...

Mate, that will be the fourth post in this series :)