02/03/10

Permalink 10:36:17 pm by anthony, 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.

\documentclass[10pt,a4paper,titlepage]{article}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage{epsfig}
\author{Anthony Tricarichi:106718074}
\title{Lab 09: Radioactive Decay}
begin{document}
\maketitle

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.

Environments:

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.

\begin{tabular}{|l|l|l|l|}
\hline
Column 1& Column 2 & Column 3 & Column 4 \\
\hline
\end{tabular}

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.

\begin{eqnarray}
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
\end{eqnarray}

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.

COMMANDS!

\\ - Line break

\footnote{}

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

 

02/02/10

Permalink 10:33:44 pm by anthony, 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.

Recap:

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

11/15/09

Permalink 06:49:35 pm by anthony, 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

Operation

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

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.

Analysis

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)
-Summers
-Differentiators
-Integrators
-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:

06/23/09

Permalink 09:12:22 pm by anthony, Categories: Schematic, Eagle

I would like to demonstrate a very simple yet powerful circuit, a light sensor using an LDR.

A LDR is a Light Dependent Resistor, this circuit element varies its resistance based upon the amount of light that hits the device.

When we hook up this element in a voltage divider configuration, we can make a high and low signal based upon how much light hits the sensor. This is further filtered by using an NPN transistor in an inverter configuration to generate a purely digital signal.

This circuit allows you to produce a 1 or a 0 that correlates to whether the sensor is subjected to light or is in shadow. The amount of light that triggers the sensor is based on resistor R. (the resistor hooked up in the voltage divider with the LDR)

The circuit:


The schematic above was drawn with EAGLE, a CAD software for designing electric circuits as well as Printed Circuit Boards(PCBs)

Eagle is a very powerful tool and can make designing complicated circuits a breeze. Its much easier to draw a circuit out on eagle than to fumble around with a breadboard guessing and checking along the way.

The first thing you want to do is to create a new project file and make a new schematic.

The Blank Eagle Screen:

This is what comes up once you create a new schematic. Your first job is to start adding devices to your circuit. This is done by pressing the add devices button.

Once you do that the following screen comes up:

You can begin typing what part you need, first thing we're going to do is assemble the power supply so we have a steady potential across our circuit. We want a positive voltage regulator in a TO-220 package. A TO-220 package is fairly common package as its cheap and very easy to work with and we don't have to worry about overheating too much because the package can handle a lot of heat. Most of the time as well the package has a mounting hole for a heat sink a swell.

Once we select the part we want we can add it to our circuit. For the power supply were going to need two capacitors and a voltage regulator as well as inputs for our voltage from our source.

Once we place all the parts we have to hook everything up. For this, we use the wire hookup tool. We link all the parts like we normally would in a circuit with wire. We have to take one more step however, we have to use the node tool at any junction where two devices connect. Just because a wire and a device touch, doesn't mean they're linked. We must use the node tool to link the devices and make a connection. This is very important as unlinked nodes will produce an improper PCB design when we eventually get to that stage.

One thing you'll notice is the GND and VCC "devices." These are symbols we use to note common points in the circuit. We use a GND symbol to denote the ground. Therefore, any point in the circuit that connects the ground, connects to this symbol. This way of designing our schematic makes things look cleaner and allows us to separate functioning parts of our circuit into blocks that can be modified separately.

What the power supply does:

The power supply provides us with a known potential. When building this circuit we are going to use a 5 volt positive voltage regulator, which on the output gives us a steady 5 volts irregardless of the input voltage (assuming its DC and within specs).

The two capacitors act as filters, filtering out noise that might be introduced on our line. The capacitors in that configuration are called decoupling/bypass capacitors and are a type of low pass filter.

The LSP1/2 devices are nothing more than pads to attach our voltage source.

Once we have a steady source of power we can begin doing analysis.

The voltage divider.

The first part of our circuit is a voltage divider.

This allows us to output a voltage that is proportional to the voltage source.

Since

And

Thus

And

Then

From that relationship, we see how the voltage is proportional to the resistor R we choose and the resistance the LDR provides.

Using a multimeter we can find that the LDR puts out a resistance of about 200 ohms when in light and around 5Kohms in the dark.

We want to have a system where the change in V is the greatest for on an off conditions.

Assume we use a 1Kohm resistor for R, That gives us:

And for the off state:

This gives us a nice kick to switch our NPN transistor to solid on/off states.

The Inverter.

BiJunction Transistors are a type of "switch" they amplify current by allowing a large amount of current to flow via a small trigger.

The most important character of a BJT is its current gain, which is how much the BJT will amplify current before it reaches its limit.

For this setup we are going to be using the TIP120 NPN BJT.

Data sheet: http://www.learn-c.com/tip120.pdf

BJT usually have 3 leads; a base, collector and emitter.

The way a NPN BJT works is that a small current on the base will amplify a current from the collector to the emitter.

Now, in reality, the BJT is much more complicated than that, but for this post, that information should suffice.

The way our transistor is hooked up, is in an inverter configuration, which means when the transistor is OFF the device receives power, when the power is turned on, the transistor passes the load to ground, giving the device a 0 potential.

When our LDR is ON, there is a large amount of current going into the NPN transistor, this saturates the gate, and the LED doesn't light. When the LDR is off however, there is very little current going into the base of the transistor, thus there is very little voltage drop across the transistor and the LED gets power just as if it were hooked up to the resistor alone.

Operating Pictures:

We setup the project on a breadboard, which allows us to prototype the circuit. Instead of permanently soldering components to a PCB, we can just insert the leads of the components into the breadboard and use the internal network to connect our circuit.

The parts list for this circuit are:
2X - 2.2Kohm Resistors
1X - Blue LED
1X - TIP120 NPN Transistor.
2X - 15uf 50V electrolytic capacitors
1X - LM7805 5v pos Voltage regulator
1X - Diode
1X - 9v (or any DC voltage source)
- Some hookup wire.

The LED is off, which means the voltage divider is high, and the NPN transistor is ON. Current is being drained to ground, instead through the LED.

In the next setup, we cover the LDR, producing a low on the voltage divider, turning the transistor off, allowing current to flow to the LED.

Conclusion:

This is a very useful circuit and allows you to understand basic circuit elements. Light sensors are very useful in robotics in object detection and any other circuit where your application is sensitive to light.

- Alternative designs using op amps!

04/16/09

Permalink 09:28:27 am by anthony, Categories: Informative

We've covered the 3 fundamental components the basis for electrical systems. Lets do a quick review over some terms

AC: Alternating current, circuit that deal with a cyclic harmonic change in potential over time. Us outlets are 110 VRMS 60HZ which means the average voltage put out is 110 volts and it oscillates as a 60HZ sine wave.

DC: Direct current, current is steady and a fixed potential is across two points. We use DC for most circuits.

Voltage: Potential difference across two points, Voltage is the work a circuit is capable of doing and is the product of an electrostatic attraction between two points.

Current: Is the charge that actually "flows" in a circuit. Voltage is the work capable current is what does that work.

The Three Fundamental components:

The Resistor: The resistor allows you to control current in a circuit, it is probably the most essential component. (V=IR)

Capacitor: Two plates separated by some sort of dielectric, Holds a charge and useful in storing energy and filtering signals.

Inductor: Coil of wire that holds energy in a magnetic field. Any current flowing through a wire produces a magnetic field around it.

The Fourth fundamental component?:

Resistors, Capacitors and Inductors are all useful things but it wasn't until semiconductors that we truly were able to create high speed circuits of today.

I've already done a writeup on semiconductors here:

http://mcuplace.com/mcu/blog4.php/2008/08/20/semiconduct-this

What is circuitry?

Circuitry is the process of taking these components and making circuits that do useful things. We can make sensors that record data, Counters, Timers, Computers, Calculators, Robots. We can make pretty much anything you want to with these components.

What we will be covering in this blog is a hodgepodge of information from digital circuits, to circuit analysis to schematic design and introduction to software suites.

Basic Symbols:

Part of reading a schematic is understanding what the symbols mean and how to interpret them.

Voltage Source / EMF

A battery or DC voltage source is denoted by parallel lines of varying size. The longer line denotes + and smaller line denotes -

Passive Components:

The symbol for a resistor is a zig-zag line.

Potentiometers or variable resistors are a resistor symbol with an arrow through it

The symbol for a capacitor is two separated parallel lines

Electrolytic capacitors may have a curved line or a + sign to denote polarity

The symbol for an inductor is a half coil

Semiconductors

The symbol for a diode is a triangle with a line at the tip, the triangle *points* where the current flows and the line is usually on the negative part of the diode.

The symbol for an LED is a diode symbol with arrows coming out from the triangle denoting it produces light.

Transistors

NPN Bi-polar Junction Transistors are denoted by the following symbol

PNP transistors are denoted by

NPN can be remember because the arrow is Not Pointing iN, and PNP is the complement of NPN

MOSFET transistors share a different symbol than BJT transistors.

NMOS transistors are denoted by:

PMOS are denoted by a NMOS symbol with a complement dot in the front.

MOSFET transistors also have different symbols but all use the same basic shape.

There are many other symbols out there for electric components, however these are the most common. As we demonstrate more circuits we will go over the symbols as we get to them.

We will be going over some basic circuits so we can get the hang of designing circuits and doing analysis.

:: Next >>

July 2010
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 29 30 31

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.

Search

XML Feeds

multiblog platform