03:00:00 pm by Jfkfhhfj, Categories: Informative, Eagle

Another type of transistor.

Bipolar Junction Transistors allow us to construct digital logic and they allow us to construct amplifiers. For simple applications, we can model BJTs fairly well. However, from a manufacturing stand point BJTs are not ideal. The base current is energy we must spend to switch our transistor and if we were to extend this to millions of transistors, we find that this type of technology is unfeasible for integrated circuits as we attempt to pack more transistors into a design. Also, BJTs are typically very complicated to fabricate and yield less usable transistors. These hindrances are the main motivation for the development of a better technology, i.e. the field effect transistor.

For quite a while, the idea of a field effect transistor was known however it wasn’t realized in an actual device until the 1960’s. A field effect transistor is once which uses an electric field (An applied voltage) to control the flow of charge carriers. A MOSFET is a type of field effect transistor which uses a topography consisting of a layer of Metal, followed by Oxide and then the Semiconductor.


So a mosfet is a Field Effect Transistor comprised by topography of Metal, Oxide and Semiconductor. The silicon substrate is composed of P-type silicon (for NMOS) with two N-type “bubbles” which form the drain and source. For small signal mosfets, these two regions are exactly symmetric. Just like with a BJT (and any other silicon device) we have a depletion region where the Si where P and N type share a boundary. This depletion region is where the charge carriers (electrons for N type and holes for P type) combine and form a charge gap.

The gate is an isolated terminal from the body of the silicon. There is no connection between the gate and any body structure, thus no current flows through the gate. The gate acts as a control of the charge carriers in the silicon substrate. When a voltage is applied to the gate (with respect to the source) that electric field created pulls electrons (nmos) into the bulk, extending the region of the N+ silicon. Once this reaches a threshold we form a connection between the drain and source and current can flow. There are two voltages that matter when characterizing mosfets. Vds and Vgs. Vds is the voltage from drain to source and Vgs is the voltage from gate to source. The actual operating characteristics of a mosfet are very complicated, but the simple analogy above holds to demonstrate the main operating principles behind this device. We characterize the Voltage at which the transistor becomes conducting as the threshold voltage(Vth). This parameter varies from transistor to transistor and can be from .4 to up to 3 to 4 volts. When we apply a Vgs greater than Vth we form a narrow channel in which electrons can flow. Now, we can use Vgs to control the width of the channel, but also our Vds determines how the channel operates. When Vds is less than Vgs-Vth we operate in ohmic mode where the characteristics of the channel (and thus Id, the current through the drain) are controlled by both Vgs and Vds. Once we increase Vds to Vgs-Vth we form a channel pinch-off and drain current is no longer dependent on Vds. This is called saturation and where most of our modeling will be done in.

3 Modes of Operation:

Transistor is tuned off, ideally no current flows between drain to source. However we have weak inversion currents that instigate a small Id. Given by the following equation:


Vt is out thermal voltage (given by Boltzmann distribution}.Cd is the depletion region capacitance and Cox is the oxide layer capacitance.

Lets assume a Vt of 1v, thermal voltage is 26mV at room temperature and we assume Id0 is 1uA. We also assume a Vgs of .7v is applied. We finally assume Cox >> Cd and thus n = 1. After we make all these assumptions we end up with an Id of about 9.74 * 10^-12. This is mostly insignificant and thus for large signal and even small signal that when Vgs < Vth our transistor is off.

Triode or Ohmic Mode:

In this region the channel is formed but it is a narrow. The characteristics of the channel are determined by both Vgs and Vds and likewise the current that flows through it, Id.

Where is the carrier mobility, W is the channel width and L is the channel Length.

This region is when the mosfet operates as a resistor; changes in Vgs produce linear changes in Id. However there is a dependence on Vds which makes this type of arrangement a little more cumbersome for signal analysis.


In this region we form a channel pinch off between the source and drain. The channel is fully created and Vds no longer has an effect on the drain current.

This is the mode of operation we primarily use for small signals.


For a BJT we would have a base current which determined the amount of current that flowed from collector to the emitter. For a mosfet, we have a voltage on the gate which determines the current which flows from drain to source. Simply put, as we increase Vgs we have increased Id, and modulating Vgs modulates Id which produces an output signal. Q point and biasing is exactly the same as it is for BJTs and we have very similar parameters. Even our small signal model is very similar.

Hybrid – Pi model:

(Image courtesy of Wikipedia)

For our model we have two parameters. Gm, the transconductance:

And Ro the output resistance:

With this we can replace our mosfet in our circuit for signal analysis. Analysis is pretty much the same for MOSFETS as it is for BJTs, but instead we have no resistor between gate and source.

Mosfet Current Mirror:

A very useful circuit is a mosfet current mirror. With this circuit we can construct current sources and accurately bias our amplifiers. This circuit consists of M1 and M2. M1 has R_ref hooked to its drain for VDD while the other is hooked up to a voltage source. The idea is that the current that the M1 branch draws is the current that M2 draws.
In this circuit we know a few things: Vth = 2V for this transistor, and Un * Cox * W/L = 200 ma/V^2 and we need to find R1 to get use 50ma bias current
Using KVl for the M1 branch we get:

We know:

For this arrangement Vgd = Vds. So if we find Vgs we find Vds. We plug in 50ma of Id

We find roots at 2.7 and 1.2 V. Vgs > Vth so the 1.2v root doesn’t make sense. So Vds = 2.7v. Now, if Vds is 2.7V and VDD = 10V, we have a drop of 7.3V across the resistor so R1 = 7.3/Id = 143 ohm.

With this current mirror, Iref is determined by R1, typically we can make R1 a potentiometer and vary it to get the correct reference current. In saturation Id, is determined by Vgs, and since VgsM1 = VgsM2. IdM1 = IdM2. Thus, the reference current we set for the M1 branch is the current that M2 draws.

Now that we have our current source, let’s build our amplifier!

Common Source amplifier with current source:

Let’s assume we have an amplifier like such:

We’re going to let IdM3= IRef = 5ma and Rd be 1Kohm. The equivalent circuit for M3 is:

To find open voltage gain, Avo:

Current gain is infinite since Iin = 0.

Coupling Capacitors
The coupling capacitors in this circuit serve to separate the AC and the DC parts of our circuit. The DC parts of this circuit are our biasing while the AC parts are the signal itself. The bypass capacitor on the source of M3 servers to place a ground on the source for the signal, this increases the effective Vgs and the overall gain of our circuit.

Mosfets as switches
In the following circuit we have a PIC16F690 microcontroller hooked up to a NMOS mosfet used to control an LED:

If you're not familiar with microcontrollers, don't fret, in this circuit were going to assume the microcontroller only generates 1's or 0's. A 1 will represent a voltage of VDD and 0 will represent a voltage of 0. So with the microcontroller, we can turn on and off the LED by generating digital signals. So there are two case:

Where we put a 1 on the gate:
Vgs = 5V which is greater than the threshold voltage. The transistor is in saturation, and it is fully conducting. In this case the channel is completely created and the effective resistance of the mosfet is very very low (a few mili ohms). Current is free to move through the mosfet.

Where we put a 0 on the gate:
The mosfet is in cutoff mode since Vgs = 0 < Vth. No current flows and the mosfet is an open circuit.

So what is the main difference between the mosfet as an amplifier and the mosfet as a switch? Simple put, as an amplifier, we force the mosfet into a region by having a particular bias current. With the source grounded, a large VGS will completely open the channel and the current the mosfet can handle is much greater than the current bounded by the LED and the current limiting resistor.

If we take a NMOS transistor and invert the polarity of the layers(N+ bulk with P type Source and Drain), we get a PMOS transistor. The operating principles are the same except the transistor is turned on when Vgs > -Vth. Lets take the same circuit as above except with a PMOS transistor with the same two cases.

When we have a 1 on the output
With a PMOS the source is connected to VDD. With a 1, Vgs = 0 >-Vth, the transistor is in cutoff and no current flows.

When we have a 0 on the output
With a 0, Vgs = -5v < -Vth and the transistor is saturated an fully on.

By inverting the charge of the silicon, we essentially invert the logic. There are a few things to know about Pmos:
The majority charge carriers in a PMOS transistors are holes, which are larger and slower, thus a PMOS isn't as fast (has higher intrinsic capacitance) and generally push less current. However, they are necessary when this type of logic is needed.

The CMOS inverter and CMOS Logic
Here we are going to delve into digital logic since the CMOS gate is a very important part of digital electronics. CMOS stands for Complementary Mosfet, this is a setup composed of both a NMOS and PMOS transistor to form the logic function of a NOT gate.

Again we take our two cases:

When we have a 1 on the input
The NMOS transistor is conducting and the PMOS is not, we see GND on the output, which is a logical 0.

When we have a 0 on the input
The PMOS is conducting and the NMOS is not, we see VDD on the output, which is a logic 1.

As you see, when we put in a 1 we get a 0, and vice versa.

The important thing about a CMOS gate is the fact a MOSFET has no input current. We can make the same arrangement with BJTs but since there is Ib, we lose energy to keep the gate into a state.

However, the fact a CMOS gate doesn't use power is only an idealization. Our computers use CMOS gates to construct their logic and anyone with a laptop will tell you they get plenty hot. One thing to realize is that mosfets do have finite resistances which lead to power losses however, the biggest thing to realize is the fact that our gate is nothing more than a capacitor. To charge and discharge this capacitor it takes energy. Every time we switch our gate we lose that energy we used to charge the gate capacitor. The faster you switch, the more energy you use up. As you increase clock speed, our electronics get hotter!

What else can we do? The answer is almost anything. Mosfets are the primary component used in integrated circuits. Mosfets replace resistors and capacitors in many circuits and even some analog ICs can be made primarily using mosfets. They are incredibly easy to make and the scale incredibly well. They're the primary reason for modern electronics and they will be for quite a while. In the future we will be discussing circuits involving mosfets and other fun stuff!


  11:52:01 am by Jfkfhhfj, Categories: Informative

One of the most valuable elements in modern electronics is the transistor. The transistor has allowed electronics to go from a hobby to an industry. The transistor allows your circuit to work with large signals, small signals and interface between the two. Transistors are at the base of amplifiers, digital systems and practically all sensors.

The biggest thing with transistors is that they no longer follow ohm's law. We will now start working with elements that follow relationships not governed by simply V=IR. The relationships between our voltages and currents will be determined by transistor configuration. KVL and KCL will still hold, but where going to have to be careful when we use them.

The Theory
Transistors are made possible by semiconductors. A semiconductor is a material that can be in a conducting state, or an insulating state based upon the voltage applied to it and its intrinsic properties.

Charged Silicon
Silicon by itself, is neither a good conductor or insulator. Its just a pretty decent resistor. One of the things we can do is to "dope" silicon. doping is when we add impurities to the silicon to change its conductive properties a little bit. What gives silicon it's conductive properties is the fact that silicon likes to bond to itself and form a crystal lattice. In this lattice, the silicon's valance electrons are all shared with neighboring silicon atoms. Since all the spare electrons are help up in this bond, any extra electrons (your electric current) have a hard time jumping from silicon to silicon. However, the energy needed to bump an electron out of its orbit, isn't that much, so there still is a flow of current through regular silicon, it just isn't that much.

When we dope silicon we take atoms which have one extra valance electrons, or one fewer electrons. What this does is either gives us a material with an overall positive charge (P type silicon) with excess holes (positive charged nucleus) or overall negative charge with excess electrons (N type silicon) This excess of movable charge allows current to flow. So p type and n type silicon are themselves decent conductors. How conductive a piece of p-type or n-type silicon is, is determined by carrier concentration and charge mobility (along with other factors). We can choose carrier concentration by how much we dope the silicon and mobility is determined by the majority charge carrier (electrons for n-type and holes for p-type). Naturally, electrons are more mobile so n type is usually more conductive than p type with similar doping. This is all fine and dandy, and is great science for making really good resistors, but to make a silicon device we have to look at the barrier between a piece of p-type silicon and n-type silicon.

Band Theory for dummies
I am not going to go in depth into band theory, but I will go over as much as you need to know to have an understanding of our devices. We know that like charges repel and opposite charges attract. Charges in our silicon are mobile and can move around. When we put a piece of nSilicon and a piece of pSilicon we form what is called a depletion region. The holes combine with the electrons and we get neutral charged silicon. This forms a barrier between between the pSilicon and nSilicon and charge no longer flows. Because we have a separation of charge, we have a built in potential and this is the key to silicon devices.

PN junction diode
The simplest device we can have is just a PN junction and with that junction we form a diode. A diode is a device that allows current to flow in one direction.

We discussed how a PN junction has a natural build in electric field caused by the separation of electric charge due to the creation of a depletion region. If we are to sketch this as voltage across the diode we get something like:

When we apply a voltage to out diode, that voltage will affect our built in potential. If it is the same polarity as the built in potential, our diode's potential hill increases and doesn't allow current to flow:

However, when we apply a voltage, opposite polarity of our built in potential, we create a potential hill that allows our current to flow. However we lose the built in potential to our diode and the voltage across our circuit is the voltage of our source minus the built in potential voltage:

Thus, a diode allows current to flow only in one direction, the one which opposes the built in potential and creates a potential hill that our electrons may pass through.

So here we see how a PN junction in silicon creates a useful device. This is the basis for all silicon devices. By taking advantage of the geometries and modifying the band structure of a crystal we can build silicon devices to do almost anything.

The transistor.
A transistor is another type of silicon device. For all intensive purposes there are two transistors that we are concerning ourselves with, the Bi-polar Junction Transistor (BJT) and the Metal-Oxide-Semiconductor transistor. Both transistors have the same general principles (they can both act as switches and both are amplifiers) however, they operate on vastly different mechanics and each have their own advantages.

A BJT is made with three layers of semiconductors either NPN or PNP. The arrangement determines it's polarity. For the purpose of the rest of this document, we will be working with NPN transistors, for PNP everything is the same except we invert the biasing. (i.e. we now need -.7v to “turn on” the transistor). BJTs were the first practical transistors (however not the first theorized) BJTs have great transconductance (the ability to control output current with input voltage) and have some nice features which make them very practical to model. However, BJTs are trickier in the fact they have finite input and output resistances which must be take account for. All BJTs have three terminals, the base collector and emitter.

Principle of operation
The way a BJT works is that a signal on the base of the transistor allows a larger current to flow from the collector to the emitter.

A transistor is a device that is not linear, and it doesn't follow one equation the way, say a resistor does.

Depending on several variables (Base Current, Collector-Emitter Voltage) we get different Collector currents.

Now, there are three modes of operation worth looking at:

-Cutoff: This mode is where there is no base current present and the transistor is off, no current flows from collector to emitter

-Saturation: This mode is where the transistor is fully conducting, this is the same as a logical 1.

Switching VS Amplification
The most used aspect of a transistor is its ability to be an electronic switch. The philosophy behind this is that we can use a small signal from say a microprocessor to control large electric objects like DC motors (For more on this check out mcuplace.com). However, for this blog we will be looking at transistors as amplifiers and because of that, the most useful region of operation is the forward active mode.

Forward Active
Typically to be in the forward active mode both the base-emitter diode is forward active (>.7v) as well as the base-collector diode. We also have the constraint of collector-emitter voltage >.3V. As long as we satisfy those three conditions we are in forward active region. When the transistor is in this mode, it behaves by the following formula

Where Beta is a parameter of the transistor.

Transistors are complicated devices in that there's no simple way to figure out whats going to happen with a circuit. When designing a circuit, we generally have goals we'd like to accomplish and we use the following above as assumptions to find the collector current. Once we know the collector current, we can see how variations in base current (voltage) produce variations in collector current (voltage) allowing us to amplify signals. Before we can do that, we have to model the transistor in a static DC case and figure out some parameters.

Q-Point and biasing
Biasing is the act of choosing our DC base current so that we can get proper signal amplification. We can bias our transistor in many ways. The result however is to find our Q-point base current giving us our Q-point collector current and allowing us to calculate parameters for signal analysis.

So lets start with a circuit:

In this circuit, we have a voltage divider hooked up to the base, and we have a collector resistor and an emitter resistor. The voltage divider allows us to set the base voltage, which determines our base current, and our collector current.

Quick Dirty Analysis

Analyzing a circuit like this can be a nightmare, if we take out time and stick to what we know, we can analyze every aspect of this circuit and find the exact currents and voltages... OR we can make a bunch of assumptions and get a good enough approximation.

First thing we know, our VCC is 5V, with our voltage divider we get a VB of 2.5V. Since the voltage drop across VBE is .7V we know VE is 1.8V. The current that goes through RE is the same (approximately) as RC so 1.8/1k is 1.8ma. Thus Ic is 1.8ma. Now we know our collector current we can go on to do signal analysis.

Checking our approximation

The easiest thing we can do, is use PSPICE to verify our circuit.

As you see, our guestimations are pretty close to what Pspice decided to spit out. So lets start analyzing what happens when we put a signal on our circuit.

Signal Analysis

For signals, we use a different type of model, one that allows us to not worry about recalculating every parameter of our circuit at every instance of our changing signal. For this type of model, we simply find the q point characteristics and shove it into our model. Lets take our circuit and modify it a little bit.

We've added quite a bit to our circuit but all will be explained in a moment. First off, we added an AC source which will be our signal. Like all sources it has a finite output resistance RS. We add CC1 as a Coupling Capacitor, this isolates our AC and DC parts of our circuit so that current from our biasing circuit doesn't flow into the source. This works because fundamentally, capacitors act as a DC block, they only allow AC to flow. Next, we add CE, this capacitor will increase our gain of the circuit and will be more apparent once we build our model. Finally we add a load resistor and another coupling capacitor, again we want to separate the AC and DC portions of our circuit.

Hybrid-Pi Model

What our model does, is take our complicated transistor and reduce it to a few resistors and a current source like such:

(photo courtesy of wikipedia)

This model allows us to replace the transistor in our circuit with the model above (note the Base Collector and Emitter nodes)

To build our model with have to define a few parameters:

: This is our imput resistance defined as where Vt is the thermal voltage and Ib is base current

Ro: Output Resistance, this is defined as where Va is the Early voltage(intrinsic parameter) and Ic is the collector current.

Gm: Transconductance, is defined as

Thermal Voltage is a relationship derived from Boltzmann's constant that correlates to the intrinsic voltage in a semiconductor junction. It is dependent on temperature, but for most cases it is 26mv.

Early Voltage is a theoretical voltage, that relates to our output resistance. For the transistor in the circuit the 2n2222 the early voltage is around 100v (you can look this up in the data sheet hopefully)

Ib, the base current should be . is approximately 150, but we can just use our PSICE values.

Ic, was shown to be approx 1.8ma.

With those parameters we find:

gm ~ .07 a/v

So lets construct our signal circuit with the above parameters. Now, we are building a circuit for signals and thus there are a few things to be aware of:

With respect to a signal in circuits, power and ground are the same thing, thus in our above circuit with the voltage divider, those resistors are actually in parallel with respect to a signal, thus we can convert them to a common resistor to ground.

Capacitors are a low impedance connection with respect to AC, thus they are shorts to our signals. The purpose of CE becomes a little more clear, rather than connecting to ground through RE, we can connect R pi directly to ground increasing the voltage drop across it and the signal gain.

With those considerations our circuit becomes:

First thing we want to calculate is our voltage gain AV

For our circuit Av = -35.

Thus any input signal should be amplified -35 times. Note the input voltage is after the signal source, with our current circuit the output resistance of the source dwarfs the input resistance of the amplifier, thus we have a large voltage drop across the source resistance and very little across our amplifier... oops...

Three types of amplifiers.

The amplifier we just analyzed is called a common emitter amplifier. We call it this since the emitter shares a connection to the input and output (namely the ground) There are two other types of amplifiers, Common Base and Common Collector. All can be analyzed using similarity techniques and all have different properties.

Common Emitter: Large voltage gain but worst bandwidth

Common Collector: Large current gain, Large input impedance, low output impedance, unity voltage gain.
Common Gate: Best frequency response, low input impedance, unity current gain, low voltage gain.

Now, each amplifier excels at one task, but they are most useful when combined together. The idea behind cascade amplifiers is to use buffers and these amplifier configurations to maximize performance and gain while no suffering the drawbacks of any one design.

MOS transistors
Metal-Oxide-Semiconductor Transistors are very similar to BJTs in the fact they act as both amplifiers and switches. Even the design methodologies are very similar. However the design principles are completely different. MOS transistors, like BJTs have three leads. Gate (base) Drain(Collector) and Source(emitter). However the similarities stop there. Due to the sheer size of this article, I will hold off on talking to much about MOS transistors.

I hope this article served as a nice guide into doing design work with transistors, I've barely scratched the surface when it comes to using these devices. Note we've only covered one mode of operation and barely at that. There is much more to learn about these devices but unfortunately, I don't have the time or knowledge to do so at this time. I look forward to posting much more on this topic as well as exploring more theoretical topics and possibly even device fabrication.


  10:36:17 pm by Jfkfhhfj, Categories: Informative

I know this isn't exactly related to circuitry, but i figured I'd do a quick little writeup on . If you haven't noticed already, throughout this blog i use mathematical formula to describe the phenomena which i happen to be writing about. I use a cgi script to generate the formula into a JPEG from the Latex(Pronounced La-Tek)typesetting commands.

Typesetting vs WYSIWYG:

When you create a document you have two choices, you can use a program like Microsoft Word and how you type the document and format it on the screen is how it comes out (WYSIWYG) or you can use a language like HTML where you use tags to get desired formatting (a Typesetting language)


Latex is a typesetting program which is widely used in the physics and engineering community, it uses pre-formatted packages to adhere your document to certain guidelines but also allows you to customize every setting. Instead of trying to explain what Latex is, i am just going to provide a sample document in which i used Latex to make.

Sample Lab Document

Here is the .tex document that we will be referencing through out the post.

Sample tex document

As you can see, Latex makes good looking documents, fairly quickly. Latex has a whole host of useful typesetting features for mathematical formula, Greek letters, operators, figures, symbols and operations. It is a very powerful tool which will help you in any situation where you need to make a professional looking document. How it works: Texmaker is what i use to write my Latex documents, however a basic text editor is all you need. After you write your tex file (with .tex extension) you use Latex to "compile" it into a .dvi, .ps or .pdf format. Just like with any program any syntax errors will result in a compile error. So lets get into the code.

The Preamble:

The preamble of the latex document sets up the basic guidelines the document will follow. i.e. the author information, the font packages to use, other misc packages to use and the document type.

\author{Anthony Tricarichi:106718074}
\title{Lab 09: Radioactive Decay}

In Latex we precede each command by \. Document class tells Latex what font to use, the type and other document settings. Usepackage tell latex what packages to use (use the ones i use as default). Author sets the author information for the document, Title sets the title. Like HTML uses tags, latex has something similar.


Latex uses environments to guide the flow of a document. When in an environment Latex follows certain formatting guidelines. We start our document with the document environment, we enter an environment with \begin and exit it with \end In the document environment we denote section with \section{} and subsections with \subsection{}

Tabular Environment:

To create tables in Latex we use the tabular environment.

Column 1& Column 2 & Column 3 & Column 4 \\

We enter a tabular environment with \being{tabular} it accepts a parameter which tells latex how many columns the table will have {|l|l|l|l|} | denotes a horizontal line and l denotes left-justified. r,c,l are all valid parameters. \hline denotes a horizontal line, & denotes a column break and \\ is a new line. That makes the following table.

Math environments: One of latex's most powerful features is it ability to create very elegant and professional math equations. There are several ways to enter math mode in latex. If you want to use math environment tags in your regular document you can temporarily use $ to enter math mode and then another $ to terminate it. A more permanent environment is the equation array environment. It is very similar to the equation environment but allows you to align your equations like a tabular environment.

Math commands:

In math mode, you have access to commands that let you build your equations. +,-,/, and * all have their own symbols and formatting.

^{} is for superscript

_{} is for subscript

\frac{a}{b} is for fractions of the form

There are many more commands which i will outline at the end of the document.

P_{abs} &=& P_{atm} + \rho gh \\ \nonumber
&=& 1.01*10^5 + 10*1000*.2 \\ \nonumber
&=& 103000 Pa \\ \nonumber
m_{slope} &=& \frac{\Delta x}  {\Delta y} \\ \nonumber
&=& \frac{0-100}{91807-129549} \\ \nonumber
&=& 377.42 \\ \nonumber
Percent Error &=& \frac{Experimental - Actual}{Actual} * 100 \\ \nonumber
&=& \frac{-243 - -273}{-273} * 100 \\ \nonumber
&=& 10\% \\ \nonumber

Generates the following -

End note and other commands:

Latex is a fairly simple typesetting language, if you take a look at my sample .tex document you should have all you need to make a Latex document.  This has only been a crash course into latex, more in-depth support on the working of Latex can be found almost anywhere on the internet.


\\ - Line break


\(insert greek letter name) - Insert a greek letter



  10:33:44 pm by Jfkfhhfj, Categories: Informative

I figured since the circuits im am going to be analyzing are going to keep getting more complicated i figured i'd share some tools i use to make sense out of complicated circuits. If you are familiar with KVL,KCL, mesh and nodal analysis, you can skip this post otherwise i hope to shed some light on some useful techniques. The math can get a little difficult but ill try to use as many steps as possible.

Kirchoff's Voltage Law:

Voltage is defined as the potential difference between two points due to an electric field, because of this field there is potential energy to do work (Voltage).  Like all other potential energy this one is also related to position or location. To help realize this we can use an analogy to gravity.

With gravity, potential energy is directly related to how high an object is, as you move an object higher it gains potential energy. However, if you take an object at some height, raise it up and bring it back to your starting position the potential energy is the same, despite the fact you had a gain in potential energy, you had the same amount in loses to return the object to the starting position. The net of this motion is NO change in potential energy.

Voltage works the same way. KVL states that if you have a circuit, and you go around a loop in that circuit, the net change in voltage is zero. We express this with the following formula:

Lets make use of this law, consider the following circuit

What we do is define some variables, we let the current in out circuit be denoted by I.

Here we sum all the voltage drops, because the voltage source provides a voltage and we are summing over the drops we make it negative. Of course due to Ohm's law (eqn 1) the voltage across the resistors is I times their resistance.

Mesh analysis:

If we take KVL one step further we can solve some pretty advanced problems involving many currents and resistors. Mesh analysis is all about taking the loops and assigning each of them their own current (called mesh currents) and we keep track of each current in each loop using KVL.

Ill try and make this as clear as possible, but unfortunately my paint skills are limited. Consider the following circuit with three mesh current, I1,I2 and I3. Each current is positive in the counter clockwise direction.

If we take KVL we can make the following equations (we have three unknowns thus we need at least three equations)

Phew! If you plug all the currents back in however, they all check out. The work looks alot more tedious than it actually is, Mesh analysis is a very useful way of making good use of KVL.

Kirchoff's Current Law:

The second most important law in EE is KCL or Kirchoff's Current Law. This law like KVL has an analogy in physics. Its very common knowledge that energy and mass are always conserved in a physical system, simply you cannot create or destroy energy (it can only be transferred one place to another). With circuits, we have conservation of charge or simply that the charge into a node has to leave that node. This can be expressed as:

Or that all the current into a node = 0 and all the current out of a node = 0 Consider the following:

KCL states that the current coming from the left of the node has to add up to the current going through both resistors, in this case its trivial, each resistor draws 100mA of current and I1 = 200mA and I2=I3=100mA.

Nodal Analysis:

Nodal Analysis is where we define each node in a circuit. With these definitions and KCL we can find all the node voltages and from there we can define the circuit. Lets take our previous example, instead of using mesh currents we use nodal analysis.

As we look at our drawing, we can make some pretty clear distinctions, V1 is 5V, V3 is 10V and the current through R3 is 5mA. Using KCL at V2 node we make the following conclusion.

You can see the power of nodal analysis, for this circuit it is much easier to do a nodal analysis than it is a mesh one.


KVL is that the sum of the voltages in a loop must equal zero (Change in potential in a loop is zero)

KCL says that charge is conserved so, the current into a node must also exit that node.

Mesh analysis is an application of KVL where we define mesh currents and find them using KVL

Nodal analysis is an application of KCL where we define node voltages and use KCL to find the remaining variables.

With these tools in hand, you can analyze almost any electrical circuit, even if you cannot follow the math, having these principles in mind make circuitry more intuitive.

We will be continuing with op amp circuits in the next upcoming posts and then moving onto more advanced topics, if you would like to see a certain derivation or any specific topics email me at Jfkfhhfj@gmail.com


  06:49:35 pm by Jfkfhhfj, Categories: Informative

So we have our basic components, Capacitors, inductors and resistors. We also have semiconducting components such as diodes and transistors. If you read my other blog you also know about microcontrollers. Operational Amplifiers or op-amps for short, are in their own league. At its heart an op amp provides a voltage gain to a potential difference on its inputs. However, when you begin to do some analysis and creative placing of components, you realize op-amps do so much more.

An op-amp typically has 5 inputs:

+ : The non inverting input
- : The inverting input
V+: Positive rail supply voltage (not shown)
V-: Negative rail supply voltage (not shown)
V_out: Output Voltage


As said earlier, the op-amp is a simple device, it applies a voltage gain on the voltage difference between the + and - pins. Gain is denoted by A and is typically around the scale of 10^6. Now, this might be a little confusing, does this mean the op-amp will output 10^6 volts when a 1 volt difference is applied across the + and - pins? No, you are bound by the positive rail and negative rail supply, you can never surpass those.

So if that's the case, wont a few millionths of a volt cause the op amp to go completely to one rail? This is true however we must make a few idealized assumptions about op-amps so that we can properly analyze op-amps and once we do that we can understand what feedback is.

The idealization and analysis of an op-amp

The best way to go about analyzing an op-amp is to break it up into two parts:

The input: The input of the op-amp are the inverting and non-inverting inputs, here we make our first assumption. The resistance between these two points is infinite. This means that no matter what voltage is on either pins no current flows between the two points. This is our second assumption, no current flows into or out of the input pins.

The output: Taking our idea on how the op-amp works we get the following formula:

We can turn the Vout pin into a dependent voltage source (i.e. it is a voltage source which is dependent on a voltage somewhere else in our circuit) going through a resistor. The output voltage is governed by the equation above.

Our final assumption is that, this resistor is 0 ohms.

Our ideal op-amp

Taking our four assumptions:
-Resistance between + and - pins is infinite
-No current flows into the + and - pins
-Vout = A*Vin
-Output resistance is zero

After we make these assumptions we get the following circuit

="http://mcuplace.com/mcu/media/blogs/cay//Ideal Op amp.jpg" alt="" title="" width="500" height="200" />

Now what?

A simple amp using feedback

Now the greatest power an op-amp has is its ability to use feedback to create some neat effects.

Lets say we input a voltage to the + terminal and then have a resistor from the output feedback to the - input.

="http://mcuplace.com/mcu/media/users/jfkfhhfj/Feedback.jpg" alt="" title="" width="500" height="358" />


Lets start off by reminding ourselves of our assumptions, We know that the resistance is infinite between the inverting and non-inverting inputs and because of that no current flows. Because of that, the + and - pins are held at the same potential.

So lets look at our circuit. We see that the output voltage is hooked up in a voltage divider configuration with the - input. We recall for a voltage divider that:

or that....

Taking our original formula

We find for this circuit

This circuit represents controllable gain, which is extremely useful.

Many basic signal amplifiers work off of this very practical circuit.

Where do we go from here?

Operational amplifiers have many other applications to signal processing beyond just a simple controllable gain circuit.

Many other uses of op amps include:

-Signal Buffers (Zero gain amp circuit)
-Oscillators and Waveform Generation
-Much more!

We'll be going over uses of op amps as we use them.

A Step back

In the LDR post i posted about how you could use an operational amplifier to get more precise triggering of the LED light. Ill go over this briefly.

If you apply a voltage to the inverting input and another to the non inverting:

If V+ > V- the output will be the positive supply rail.

If V- > V+ the output will be the negative supply rail.

Thus if we hook up the LDR to the + terminal (in a divider configuration) and apply a voltage the the - input (via a divider or voltage source) we can get a binary output from the LDR sensor.

Formula sheet

Ideal Op amp:

Non-inverting amplifier output voltage:


February 2017
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28        

Ads By Google

This blog is an extension of Microcontrollers and You! This blog focuses more on the hardware part of design rather than software. This blog will be covering topics such as analog hardware, digital hardware,schematic and printed circuit board design and tons of other things. Topics may overlap for convenience sake.


  XML Feeds

multiblog platform