Electronics Notes...

Page Contents

Charge, Current, Voltage

References

Conventional Current And Charge

Historically positive charge moves through the circuit from the positive to negative terminals. This is called conventional current. We now know that it is, in fact, the flow of electrons from the negative to positive terminals that is current. Due to the historical precedent, current is still often shown as conventional current.

From Wikipedia: Conventional current flows from the positive pole (terminal) to the negative pole. Electrons flow from negative to positive. In a direct current (DC) circuit, current flows in one direction only, and one pole is always negative and the other pole is always positive. In an alternating current (AC) circuit the two poles alternate between negative and positive and the direction of the current (electron flow) reverses periodically..

Note that voltages are relative, which is why the negative terminal of the battery can be negative - it depends what the reference voltage you are measuring agains is - e.g. if ground is midway between the two terminals then they will have voltages -A and +A respectively.

Informally, current is a flow of electric charge.

Current, i , is the amount of charge, q , that moves through a point in the circuit at any time. i = \frac{\mathrm dq}{\mathrm dt} Charge, q , is measured in Coulombs. One electron has a charge of -1.6 \times 10^{-19} Coulombs. This is the smallest unit of charge possible.

Voltage

Voltage, V , is the amount of work (in Joules) that must be done per unit charge to move between two points in a field. V_{ab} = \frac{\mathrm dw}{\mathrm dq} I.e. 1 volt is 1 Joule per Coulomb.

To help understand this let's revisit the terms energy, work and power.

Energy is the ability to do work.
Work is the force that must be exerted to move a mass a certain distance.
Power is the rate at which energy is generator/consumed.

Energy is what makes it possible to move things. Moving things involves doing work and it takes energy to do this. Energy measures the total amount of work done. It does not say how fast the energy was used/produced.

Power gives that rate at which energy is used/produced. Power measures how fast the work gets done.

Image showing work and energy vs power

Give these definitions we can see how they are defined for electronics. Using some crude (read incorrect as we're using multiplcation not integration to make it seem simpler) we see: \begin{align} E &= IVt \\ &= \frac{\mathrm dq}{\mathrm dt} \cdot \frac{\mathrm dw}{\mathrm dq} \cdot t\\ &= \frac{\mathrm dW}{\mathrm dt} \cdot t \\ &= W \end{align} So energy is indeed the total work required to move a charge between two points in an electric field. And because P = IV = \frac{E}{t} We can see that electrical power (measured in Watts) is the rate of consumption/generation of electrical energy.

Note that electric potential energy is measured with respect to a reference point. In the image below one can see that the voltage either side of the resistor is measured w.r.t ground. Ground is the normal reference point, but any point in a circuit can be used as long as it is used consistently.

Measuring potential requires a reference voltage, usually ground

Note then, that potential difference, is the difference between to points, each of which has a potential energy w.r.t to a reference. The potential difference is the difference between these two points, but only make sense if the potential of each point is measured w.r.t to the same reference.

Ohm's Law

Ohm's law gives the relationship between voltage, current and resistance:

V = IR

Kirchoff's Laws

Nodes, Branches and Loops

Branch: A branch represents a single element such as a resistor. I.e., any two terminal element.

Node: A node is the point of connection between 2 or more branches. Every point going into the node, at the node, is at the same potential.

Loop: A loops is any closed path in a circuit. Starts and ends at the same node and does not pass through a node more than once.

Branches, loops and nodes in a ciruite

The Laws...

Two important laws: Kirchoff's voltage law and Kirchoff's current law.

KCL

Kirchoff's current law says that the sum of currents flowing into a node must equal the sum of currents leaving a node. This is often expressed in another way: the sum of currents entering and leaving a node must always be zero. This works because we label, by convention, all currents entering the node as positive and all currents leaving the node as negative.

KCL

This can be written most compactly as: \sum_{j=0}^{n} I_j = 0

Lets look at the following example [Ref]:

KVL

Kirchoff's voltage law says that the sum of voltages around a closed circuit must be zero.

KVL

This can be written most compactly as: \sum_{j=0}^{n} V_j = 0

Say, for example, that V_1 is 12V, R2 is 4 \Omega , R3 is 6 \Omega , V_2 is 3V and R5 is 1 \Omega . Then we know -12 + 4i + 6i - 4 + i = 0 . We can then work out the current in the circuit using KVL by re-arranging the formula.

Resistance

Resistors control the current that flows through a part of a circuit, as described by Ohm's Law ( V = IR ). Using the formula one can see that as either resistance increases, current falls, and vice versa.

Resistor Colour Codes

In the drawing to the left you can click on the value-boxes to change the colour bands on the resistor to find out the resistance represented by the colour encoding. Note it only shows a 4-band resistor. 5 and 6 colour bands are possible but not shown here.

Note: Sometimes the click event on the canvas doesn't fire... not quite sure why that is. If first click doesn't work, persevere :)

Some popular ways of remembering the resistor colour codes include "Bad Boys Ravish Our Young Girls But Violet Gives Willingly" and my fav, "Bad Booze Rots Our Youg Guts, But Vodka Goes Well".

Resistor's In Series

Resistors in series can be "collapsed" into an equivalent single resistor with a resistance that is the sum of all the resistances of the individual resistors.

Using Kirchoff's voltage law: V_1 + V_2 + V3 - V_s = 0 Using V = iR we can substitute in for the individual voltages across each resistor. Note that because this is a closed loop the current though each resistor will be the same (as there is no path in which the current can "split" up). iR_1 + iR_2 + iR3 - V_s = 0 \therefore V_s = iR_1 + iR_2 + iR3 Now, V_s can also be re-written using V = iR as V_s = iR_t , where R_t is the equivalent, total, resistance of the resistors in series... \therefore iR_t = iR_1 + iR_2 + iR3 \mathbf{\therefore R_t = R_1 + R_2 + R_3}

Resistor's In Parallel

Resistors in parallel can also be "collapsed" into an equivalent single resistor...

Using Kirchoff's current law we can say that i_t = i_1 + i_2 + i_3 . Using V = iR , we can say the following: \begin{array}{ccc} V = i_1R_1 & V = i_2R_2 & V = i_3R_3 \\ \therefore i_1 = \frac{V}{R_1} & \therefore i_2 = \frac{V}{R_2} & \therefore i_3 = \frac{V}{R_3} \end{array} Subsituting the above back into i_t = i_1 + i_2 + i_3 , gives us the following. i_t = \frac{V}{R_1} + \frac{V}{R_2} + \frac{V}{R_3} And, of course, i_t can also be re-written, giving the solution: \frac{V}{R_t} = \frac{V}{R_1} + \frac{V}{R_2} + \frac{V}{R_3} \mathbf{\therefore \frac{1}{R_t} = \frac{1}{R_1} + \frac{1}{R_2} + \frac{1}{R_3}}

Voltage Divider

Using Ohm's law we know the following. V_1 = iR_1 \implies i = \frac{V_1}{R_1} V_2 = iR_2 \implies i = \frac{V_2}{R_2} Using Kirchoff's voltage law, and substituting in the above, we know that, \begin{align} V_t & = V_1 + V_2 \\ & = iR_1 + iR_2 \\ & = i(R_1 + R_2) \end{align} This means that we can say, i = \frac{V_t}{R_t} = \frac{V_1}{R_1} = \frac{V_2}{R_2} Substituting i = \frac{V_1}{R_1} into V_t = i(R_1 + R_2) gives... V_t = \frac{V_1}{R_1}(R_1+R_2) \mathbf{\therefore V_1 = V_t \times \frac{R_1}{R_1+R_2}} Substituting i = \frac{V_2}{R_2} into V_t = i(R_1 + R_2) gives... V_t = \frac{V_2}{R_2}(R_1+R_2) \mathbf{\therefore V_2 = V_t \times \frac{R_2}{R_1+R_2}} In words, we can say that the voltage across the second resistor is proportional to the ratio of the second resistance to the total resistance.

One issue to be aware of is that any load placed across R_2 , i.e., in parallel with R_2 , will change the effective resistance of that node (remember resistors in parallel can be "collapsed" into an equivalent single resistor). Therefore, be aware that the load across R_2 will also influence the ratio of voltage division.

Current Divider

i_tR_t = i_1R_1 \begin{align} i_1 & = \frac{i_tR_1}{R_1} \\ & = \frac{\frac{R_1R_2}{R_1+R_2}}{R_1} \times i_t \\ & = \frac{R_2}{R_1+R_2} \times i_t \end{align}

The Wheatstone Bridge

The Wheatstone Bridge is a circuit for measuring resistance very accurately. This material is based on the link to the Texas Instrument tutorial...

Using Kirchoff's voltage law around the loop consisting of R_2 , V_{out} and R_4 we get the following. -V_2 + V_{out} + V_4 = 0 \therefore V_{out} = V_2 - V_4 We can find the voltage across R_2 and R_4 by using the formula for voltage dividers: R_1 and R_2 are one voltage divider and R_3 and R_4 are the other voltage divider. Using the voltage divider formula we get the following two results: V_2 = \frac{R_2}{R_1+R_2} \times V_t, \qquad V_4 = \frac{R_4}{R_3+R_4} \times V_t Here V_t is the supply voltage. Substituting these into the first formula we get... \begin{align} V_{out} & = \left(\frac{R_2}{R_1+R_2} \times V_t\right) - \left(\frac{R_4}{R_3+R_4} \times V_t\right) \\ & = \left(\frac{R_2}{R_1+R_2} - \frac{R_4}{R_3+R_4}\right) \times V_t \end{align} If three out of the four resistances are known and the current across the V_{out} branch is zero, the third resistance can be calculated.

Let's say that we don't know the resistance of R_3 . If we set all the other resistors to be equal so that R_1 = R_2 = R_4 , then the above formula simplified to the following.... V_{out} = \left(\frac{1}{2} - \frac{R_k}{R_u+R_k}\right) \times V_t Where R_k is the known resistance and R_u is the unknown resistance. This assumes that R_u is roughly equal to R_1 and that all R_k resistors are very closely matched.

A simple re-arrangement gives us... V_{out} = \frac{1}{2} \times V_t - \frac{R_k}{R_u+R_k} \times V_t

In the above, V_{out} , V_t , and R_k are all known. We know V_{out} because we can measure it and the other known parameters are already set apriori. With more simple re-arrangement we get... 0.5V_t - V_{out} = \frac{R_k}{R_u+R_k} \times V_t \therefore \frac{0.5V_t - V_{out}}{V_t} = \frac{R_k}{R_u+R_k} \therefore \frac{V_t}{0.5V_t - V_{out}} = \frac{R_u + R_k}{R_k} \therefore \frac{V_t \cdot R_k}{0.5V_t - V_{out}} = R_u + R_k \therefore \mathbf{R_u = \frac{V_t \cdot R_k}{0.5V_t - V_{out}} - R_k}

And now we can calculate the unknown resistance... why is this useful? Because this unknown resistance is our sensor. It could be a thermistor, LDR, or whatever... something that changes resistance due to the thing we're trying to measure.

One thing to note is that the V_{out} of the Wheatstone Bridge is non-linear as the figure to the left shows: V_{out} does not change linearly with changes in the unknown resistance R_u ! In the figure I just picked pretty arbitrary values for the various knowns.

So... why use this rather complex arrangement to measure an unknown resistance when we could do the same using a simple voltage divider? The answer lies in the sensitivity of the measurement system. This is covered in the next section.

Power

When current flows through a resistor it disipates power in the form of heat. When it flows through an LED it disipates power in the form of both heat and light.

Power, measured in watts, is defined as: P = VI = I^2R = \frac{V^2}{R}

Resitors usually have a power rating (the power they can disipate) associated with them. This means that if you know the resistor's power rating you can calculate the maximum voltage or current you can put across/through them without breaking the resistor.

Voltage Sources & Current Sources, Ideal v.s. Real World

Voltage Sources

An ideal voltage source is one that supplies constant potential, no matter what load is connected to it. I.e., it produces whatever current is necessary to maintain the voltage across it [Ref]:

Image explaining an ideal voltage source

But, batteries, even power supplies etc etc are not ideal. In the real world they have a small internal resistance, anywhere between approx 0.1 Ω to 2 OHM() depending on the battery [Ref], which means they are modelled more like this:

Image explaining a non-ideal, real world, voltage source

It can be seen that because the internal resistance of the battery, is in series with the circuit it is powering, i.e., the load (simulated by the resistor), the combination acts like a voltage divider, and so the voltage across the load varies with its resistance. I.e.,the battery is not ideal (but its pretty close!)

This is why it is always best to measure the voltage across a power supply when it is under load.

We can now also understand that an ideal voltage source is one that has zero internal resistance.

Current Sources

An ideal current source is one that always produces the same current, no matter how the voltage across it or the resistance of the load it is "feeding" varies, [Ref].

This is why, incidently, in a circuit you cannot have two current sources in series!

Source Transformations

It is possible to switch out a voltage source in a circuit for a current source and vice-versa using source transformation using Thevenin and Norton equivalent ciruits [Ref].

Superposition

Circuits can have multiple sources. In this case, to determine voltage levels at nodes, the principle of superposition can be used:

  1. Set all sources to zero except one,
  2. Solve the necessary currents and voltages using only that source,
  3. Repeat the above step for each source
  4. Add the circuit values together - "superimpose" them onto one another.

Take the following example [Ref]:

Circuit analysis using superposition theorem

In the above diagram we get: \begin{align} I_1 &= I_1' + I_1'' \\ I_2 = I_2' + I_2'' \end{align}

References

Switches

Switches are defined by the number of poles and throws they have...

Poles: A switch pole refers to the number of separate circuits that the switch controls.

Throw: The number of throws indicates how many different output connections each switch pole can connect its input to. Think of it as how many places a single source can be "thown to".

Picture of switches with different #poles and thows

Capacitance

A capacitor consists of two conducting plates separated by an insulator (a.k.a. a dialectric).

When connected to a voltage source, the source creates a positive charge on one plate and a negative one on the other plate:

Pici of a capacitor with charge on both plates

Charge stored is proportional to applied voltage: q = Cv \implies C = \frac{q}{v} Where C is called the capacitance of the capacitor and is measured in Farads (F). By re-arranging the above we can see that capacitance is the charge per volt that the capacitor can store. Thus, the more charge that the capacitor stores per volt, the higher its capacitance is. This quanitity is dependent on the type of dialectric used, the surface area of each plate and the distance between the plates.

Recall that current is the amount of charge that moves past a point per unit time. Thus, by differentiating w.r.t time, the above, we get the current-voltage relationship of a cap: i = C\frac{\mathrm{d}v}{\mathrm{d}t} This gives us in important property of caps. Because for DC current the voltage does not change, \frac{\mathrm{d}q}{\mathrm{d}t} is zero, so a capacitor is an open circuit to DC! (But it does charge). Because of the definition of a derivative, we also know that the voltage across a cap must be smooth - i.e., it cannot change abruptly.

Note that real capacitors dissipate their energy over time - they "leak"

Capacitors resist abrupt changes in voltage, which is why the function as low pass filters.

Charging Through A Resistor

When a capacitor, with a capacitance C , charges in series through a resistor of resistance R ohms, in RC seconds it will charge to 63% of the supply voltage and in 5 \times RC seconds it charges to over 99% [Ref]. You get an exponentially decreasing current flow as the resistor draws current from the battery and the capacitor stores the current's flowing charge [Ref]. \tau \ \text{(in seconds)} = RC \\ \\ 63\% \text{ charge in } 1\cdot RC \text{ seconds} \\ 99\% \text{ charge in } 5\cdot RC \text{ seconds}

Capacitor charging through a resistor

Recall KVL: the sum of voltages around a closed circuit must be zero. The dotted arrow in the diagram above shows a direction around a closed ciruit, which by KVL means that [Ref]: \begin{array}{l l} +V_s(t) - V_r(t) - V_c(t) = 0&\ \text{from KVL law,} \\ \therefore\ V_s(t) = V_r(t) + V_c(t)&\ \text{by rearrangement,} \\ \therefore\ V_s(t) = R \cdot I(t) + V_c(t)&\ \text{by substiting from}\ V_r(t) = R \cdot I(t), \\ \therefore \ V_s(t) - V_c(t) = R \cdot I(t)&\ \bf{\color{blue}{(1)}} & \end{array} I.e., the current at time t is proportional to the difference in voltages across the supply and the capacitor, the constant of proportionality being the resistance.

Now a quick aside to derive something we're going to need:

Recall: I = \frac{\mathrm{d}Q(t)} {\mathrm{d}t}\ \text{ and }\ Q_c(t) = CV_c(t) If we differentiate Q_c(t) = CV_c(t) w.r.t time, we get: \frac{\mathrm{d}Q_c(t)}{\mathrm{d}t} = C\frac{\mathrm{d}V_c(t)}{\mathrm{d}t} And we know that I = \frac{\mathrm{d}Q(t)}{\mathrm{d}t} , so we can write: I(t) = C\frac{\mathrm{d}V_c(t)}{\mathrm{d}t} \ \bf{\color{blue}{(2)}} I.e., the current at time t is also proportional to change in voltage across the capacitor, the constant of proportionality being the capacitance.

Now we can continue by substituting \bf{\color{blue}{(2)}} into \bf{\color{blue}{(1)}} to get: V_s(t) - V_c(t) = R \cdot C\frac{\mathrm{d}V_c(t)}{\mathrm{d}t} TODO - FILL REST IN

We end up with: V_c(t) = V_s(1 - e^{\frac{-t}{RC}}) We can see that as the value of RC increases, the exponential value will decrease, which means that the time it takes to charge the capacitor increases with either , or both of, R and C .

Capacitors In Series

\frac{1}{C_{eq}} = \frac{1}{C_1} + \frac{1}{C_2} + \cdots + \frac{1}{C_n}

Capacitors In Parallel

C_{eq} = C_1 + C_2 + \cdots + C_n

References

Inductors

An inductor is a coil of wire, sometimes round a feris core, that stores energy in its magnetic field. Its strength depends on the number of turns in the coil and the type of core material and its cross-sectional area.

Inductors oppose the change of current flowing though them. They are measured in "Henrys". The formula below defines inductance, L. Inductance is the voltage generated per unit change in current. v = L \frac{\mathrm{d}i}{\mathrm{d}t} Integrating both sides and re-arranging we can get: i = \frac{1}{L}\int_{t_0}^{t} v(t)\ \mathrm{d}t - i(t_0)

Inductors In Series

L_{\text{eq}} = L_1 + L_2 + \cdots + L_n

Inductors In Parallel

\frac{1}{L_{\text{eq}}} = \frac{1}{L_1} + \frac{1}{L_2} + \cdots + \frac{1}{L_n} So, for 2 inductors in parallel: L_{\text{eq}} = \frac{L_1L_2}{L_1 + L_2}

Diodes

diode symbol

Diodes let current flow in one direction, but not the other, and always drop the same voltage across them no matter the src voltage.

Diodes drop the same voltage across them no matter the voltage source rating. So, for example, silicon diode needs about 0.7V to fwd bias, but won't let the voltage drop across it exceed this. So if you don't protect it with a resistor it will allow too much current to flow an potentially overheat!

References

555 Timer

555 timer in astable operation

The total resistance RA + RB will determine the time it takes for the transistor to charge, assuming we keep capacitance constant. However, when the capacitor discharges, it only discharges through RB.

Recall charge time for a cap to charge to 63% of the voltage across is is \tau = RC . So by varying either the resistors or the capacitor the period of the pulse train output on pin 3 can be varied.

The diagrams above and below imagine that there is a switch inside the 555, which there is, its just not a mechanical switch like these diagrams suggest (see later below for more details). As the capacitor charges the voltage across it increases. When it hits 2/3 of the reference voltage, the switch in side the 555 closes such that pin 7 is shorted to ground. The capacitor then immediately starts to discharg through RB and when the voltage across the capacitor is less than 1/3 the reference voltage the switch opens again, starting the charge cycle and so on.

As the switch also controls the connection between the reference voltage and the output, this produces a pulse train who's frequency is determined by the two resistors and the capacitor, and with a duty cycle that is determined by the two resistors.

The following is a silly little animation of the capacitor discharging through R2. Imagine that the 3 red dots represent the flow of electrons from the negatively charged plate to the positive plate of the capacitor as it discharges. I think normally it would be shown using conventional current flow, but this animation uses actual electron flow. meh.


Wikimedia has a really nice illustration of the components in the 555, which I've copied below and inserted the components outside the chip that we used above to create an astable vibrator. Here, we can see that the switch shown above is really an RS flip flop combined with a transitor.

Picture of 555 astable vibrator with internals representation of 555 shown

Each of the components, like the RS flip flop, comparitors and other gates can be further broken down into their transitor/resitor combinations, so the above is just another, slightly more detailed abstraction. The real circuit is far, far more complex when broken down into its "atomic" building blocks!

555 References

Bipolar Junction Transistors (BJT)

NPN transistors consist of two N-type (negatively doped - excess electroncs) silicon "chunks" sandwiching a P-type (positively doped - exess holes or lacking electrons) as shown below. They are current controlled.

[Ref]

By forward biasing the emitter to base junction with even a small current, the transistor's resistance between the emitter and collector quickly decreses, allowing a relatively large current to from from the emitter to collector. I.e., base current controls current at emitter and collector.

The above configuration is called the common emitter configuration and is probably the most widely used [Ref].

NPN transistors can typically handle up to about 0.8 A. Thus, they are low current devices. For large currents MOSFETs are used (later section).

Saturation region is where the maximum collector current flows and the transistor is basically a closed switch from collector to emitter.

Active mode / region is where there is an almost linear relationship between the terminal currents at the base, collector and emitter. The transistor has some resistance, that is determined by the emitter/base current.

Cut-off region is where the transistor acts like an open switch.

A common NPN transistor is the 2N2222. Looking at the data sheet [Ref] we can find the following properties:

ParameterMax
Collector-base voltage VCBO60 V
Collector-emitter voltage VCEO30 V
Emitter-base voltage VEBO5 V
Peak collector current800 mA
Peak base current200mA
Total power disipation500 mW

We can see that this device can handle a maximum of 0.8A though its emitter-collector and only 0.2A at the base. It is however, able to tolerate relatively high voltages, just not high currents, which as we said above, you'd need MOSFETs, or even relays for.

Lets represent the above common emitter example as a circuit diagram:

Basic NPN common-emitter curcuit diagram

  • The base is responsible for initiating transistor action. When a voltage is applied at the base, it gets biased and draws small current which is then used to control large current at the collector and emitter side.
  • The base action is considered as an ON-OFF valve which generates current when a proper bias voltage is applied at this terminal.
  • The small change at the voltage applied at the base terminal shows a large impact at the output terminals. Actually, base acts as an input and collector acts as an output in NPN transistor.
  • In case of silicon transistor emitter-base junction draws voltage around 0.7 when there is no voltage at the base terminal, in order to initiate the electron action and put the transistor in running condition, the base voltage must be greater than 0.7 voltage in case of silicon transistor and 0.3 in case of germanium transistor.

References