import matplotlib
if not hasattr(matplotlib.RcParams, "_get"):
matplotlib.RcParams._get = dict.get
1. Ideal Sources, Meters, Current, and Voltage#
1.1. The Physics of electrons in motion#
1.1.1. Electron flow and current#
An atom consists of a nucleus with protons and neutrons. Both particles have a mass, but only the protons are positively charged. Negatively charged electrons, with hardly any weight, orbit around the nucleus. Electrons align in different orbitals. The outer orbital electrons are more weakly bound to the nucleus, and can therefore move around.
type
mass
charge
electron
9.1093837139 \(10^{−31}\) kg
-1 e= −1.602176634×10−19 C
proton
1.67262192595 \(10^{-27}\) kg
+1 e= +1.602176634×10−19 C
neutron
1.67492750056(85) \(10^{-27}\) kg
0 e
A flow of electric charges, which is often a flow of electrons is called an electric current, with symbol \(I\). Because current was defined long before the electron was discovered, current is defined to flow from positive to negative potential, while the negatively charged electrons flow in the opposite direction historical reasons.
In order to drive a current, a source is required, such as a battery. The amount of the current depends on all other electric components in the circuit.
For now, let’s start with the most basic circuit:
Fig. 1.1 In this circuit you see a battery with a load (external resistor). The direction of current is opposite to the electron flow.#
The current \(I\) is given by the change in charge \(q\) per time \(t\):
1.1.1.1. Current flow analogies#
The flow of electrons, which are too small to observe, in the above circuit can be seen analogous to a closed water system, like central heating systems in houses. A water pump pumps the water around, and might find smaller tubes (which resist the water flow) along the way. The water is analogous to current, the water pump to the electron source, and the small tube to a load resistor.
One could also envision a bike chain, which is moved around gears. The pedal is then the source, the moving chain the electrons, and the perhaps difficult moving gear is analogous to a load.
1.1.2. Electric potential difference#
Electric potential \(U\) is given by:
which is the energy \(E\) per charge \(q\). \(U\) is given in Joule per Coulomb, and has the unit Volt (V).
Although some sources provide current, more generally, sources provide energy. This energy is represented by what is termed the electromotive force (\(emf\)). This \(emf\) will drive a current, which is limited by the load (=external resistor). In this load, electrons lose their energy, and because of this loss there will be a potential difference between different locations in the load. Both the \(emf\) and the potential difference, the latter, denoted by \(U\), has the unit Volt or \(V\).
In analogy with a hike in the mountains, a chairlift is the electromotive force which provides a change in height. When the hiker walks back to basecamp, this is the current flow. The height is analogous to the potential difference.
Fig. 1.2 In this circuit you see a battery connected to a load (external resistor). The potential difference points from low potential (-) to high potential (+)#
1.1.2.1. Independent and dependent Sources#
An independent source can provide the specified voltage or current regardless of what happens elsewhere in the circuit. An example is the 230V mains, a battery and a laptop charger. Sources in the first half of the book are mainly independent sources.
A controlled (dependent) source provides voltage or current dependent on another voltage or current in the circuit. These will be encountered in the second half of this book. You can have a :
Voltage-controlled Voltage source (for example an OPAMP circuit)
Voltage-controlled Current source (for example a transistor circuit)
Current-controlled Current source (for example a BJT transistor circuit)
Current-controlled Voltage source
Fig. 1.3 The Controlled source depends on the input at another part of the circuit.#
1.1.2.2. Passive Sign Convention#
In a closed series circuit, like Fig. 1.2, the current had the same direction through all components, while the sum of all voltage changes in the loop is zero, according to Kirchhoff’s laws.
According to the passive sign convention:
for a passive component (like a resistor, or charging battery), the current enters at the + terminal and leaves at the - terminal.
for an active source (like a discharging battery), the current leaves at the + terminal and flows through the external circuit. Therefore, inside the battery the current flows from - to +.
The sign of the potential depends on where the current enters:
when current enters at the + terminal, then \(P=UI>0\). This element absorbs power, and converts it to heat (like a resistor).
when current enters at the - terminal, then \(P=-UI<0\). This element delivers power, like a battery or voltage supply.
1.1.3. Circuit#
For a current to flow, a closed circuit or closed loop is required. While there are components which can store charge, this will not happen in an interrupted wire.
So what happens with the current and voltage when a circuit is interrupted? Compare the two circuits with the switch closed (short-circuit) and open (open circuit) in the figure below.
Fig. 1.4 The difference between these two circuits is whether the switch is closed or open.#
In the case of the closed circuit, current can go from the + to the - of the supply. This leads to a potential difference over the load (resistor) of 3 V. In the case of an open circuit, there can be no current, and since there is no current, there is also no potential difference over the load. So where is the potential difference? Over the opened switch. Only upon closing the switch the current does have a path: the potential difference over the (closed) switch becomes zero, and over the load becomes the supplied 3 V.
1.1.4. Meters in a circuit#
When determining where to place meters in a circuit, it is good to notice that current goes through a component, and voltage (difference) is over a component. Therefor, a current meter must be placed in series, so all the current goes through the current meter in order to be measured. The voltage is over a component, therefore a voltage meter is placed parallel to the component which voltage (difference) needs to be measured. Note it is always a voltage difference, however often this is ‘abbreviated’ into just voltage.
Fig. 1.5 A current meter is placed in series, and a volt meter in parallel#
1.1.5. AC-DC#
Yes, AC/DC is the name of a band, it is also an abbreviation of alternating current (AC) and direct current (DC). Direct current flows in only one direction, while AC current is alternating the direction. An example of a DC source is a battery, which provides a continuous potential; an AC source, as we experience it, is the wall outlet which provides a sinusoidal signal with frequency and amplitude (50 Hz, 230 V, in Europe). In later chapters the change from AC to DC source is explained.
1.1.5.1. Benefits and drawbacks of AC and DC potentials#
AC signals can transmit energy more efficiently over longer distances, than DC signals. Most digital devices run on DC, and require a stable supplied potential difference, or risk to be damaged. So therefore the transport of energy is done via AC, but the use requires rectification (see the diode chapter).
1.1.5.2. Sine: amplitude, peak-peak and \(V_{rms}\)#
While there is only one way to define the frequency of a (single sine) signal, the amplitude can be described in multiple ways:
peak-peak: the difference between the minimum and maximum value.
peak: the maximum value of a signal, relative to 0 V
amplitude: the difference between the peak and the average of the signal, or equal to \(\frac{U_{pp}}{2}\)
the root mean square: this is a value which involves the same power as a lower continuous DC signal. For a sine signal of amplitude 1 V the rms value is \(\frac{1}{\sqrt{2}}\)=0.707 V.
Fig. 1.6 The sine signal can be characterized with different amplitudes (with units \(V_{pp}\), \(V_{p}\), \(V_{rms}\))
Created by AlanM1, under copyright CC0, link to original#
1.1.6. Sine rewritten as sum exponential functions#
A sine can also be written as sum of two complex values:
1.2. The electronics of moving electrons#
1.2.1. Sources parallel and in series#
Both current and voltage sources can be placed in parallel and in series, but care has to be taken with their orientation.
Consider the following voltage sources in series and parallel, connected to a load resistor (given as rectangle). The load can be any device, for example a coolbox:
Fig. 1.7 Assume two 1V batteries and a load (resistor). The batteries can be placed in parallel or in series, in a correct or wrong orientation. What is ok, not working and quite disastrous?#
Voltage sources in series add their voltage, so better to have them in the same orientation, then their voltages add (Fig. 1.7b), otherwise their voltages subtract. This is also why when placing one out of two -in series- batteries in the wrong orientation, there will be no current and your device will not work (Fig. 1.7d).
Placing two 3V batteries in parallel (in the correct, same, orientation) will result in the same voltage, hence the same current, each battery delivering half of this current Fig. 1.7c). However, when the batteries are in opposite direction (Fig. 1.7e), a huge, infinite current will run through the two batteries only and almost instantly deplete the batteries. This is because the internal resistance of a voltage supply is very low and can in first instance be considered zero.
For current sources in parallel, the same happens as for the voltage sources (adding current through load in same orientation, no current through load in the opposite direction). The internal resistance of a current source is very high and can in first intance be considered infinite.
Exercise 1.1 (Current source in series)
What happens to two current sources in series?
answer
Most likely something starts giving smoke signals. The current of source 1 goes through the high internal resistor of source 2, causing a very high power drain, and lots of energy dissipation.
1.2.2. Periodicity#
Signals which repeat itself in time are called periodic, an example of such signal is a sine wave, but can also be much more complex. The time it takes to repeat itself is called a period. The value of such signal at certain time \(t_0\) and after one period \(t_0 +t_{period}\) are equal. Most of the signals encountered in this book will be periodic, except for noise which is often random and highly irregular.
1.2.3. Signals as Fourier series#
Joseph Fourier found out that any periodic signal can be seen as the sum (=a series) of sines and cosines. This can be written in either the trigonometric or the exponential way:
Simple cases are, when:
\(a_n=b_n=0\), which is a constant DC signal
\(a_1>0\) and all other amplitudes are zero, leading to a sine signal
Also a block and a triangular wave can be seen as series of sines, but with specific amplitudes at multiples of the main frequency. This main frequency is also termed 0th order, or ground frequency, denoted by \(f_0\). The higher multiples are called n-th order frequencies, harmonic freuencies, or (just) harmonics. For the block wave, you only need odd harmonics, so n=1,3,5,… with decreasing amplitude:
For the triangular wave you require both even and odd harmonics:
The following code allows you to add different harmonics with different amplitudes. Try it out, and observe the outcome of:
Set Amp 1 to 1, , set Amp 2 to \(\frac{1}{2}\) , set Amp 3 to \(\frac{1}{3}\), et cetera.
Set Amp 1,3 etc to \(\frac{1}{n}\), set Amp 2,4,etc to 0
Set only one Amp0 to 1, the rest to 0.
Set only one Amp3 to 1, the rest to 0.
Fig. 1.8 interactive plot: With Overtones, meaning higher frequencies an integer number times the ground frequency, you can make different shapes of signals. Note that each arbitray signal can be seen as the sum of (many) sines with varying frequency.#
1.2.4. Time and frequency plots#
The most familar plot for a signal, is amplitude versus time. However, in the previous section Fourier series have been introduced, with amplitudes and frequencies. That means that a signal can be plotted as amplitude versus both time and frequency. Let’s for now only look at \(f\)>0.
A DC signal has only \(a_0\)>0, and therefore the peak in the amplitude-frequency plot appears at \(f\)=0.
A sine signal has only a single frequency, and therefore the amplitude-frequency plot shows a single peak.
The block and triangular signal have a Fourier Series, so in the amplitude-frequency plot a train of pulse appears. Odd and even harmonics for the triangle, only odd harmonics for the block wave.
Fig. 1.9 Each signal can be displayed as amplitude versus time, and amplitude versus frequency.
Created by Philip Clemson, under CC BY 4.0, original file#
The transfer from the time domain to the frequency domain is called the Fourier transform, the transfer from frequency to time domain is the inverse Fourier Transform.
The equation for the continuous Fourier Transform is outside the scope of this book, and can be covered by a Signals & Systems course.
Example 1.1 (Fourier Transform formulas)
Just as there are analog (continuous) and discrete (sampled at certain time points) signals, there are also continuous and discrete fourier transforms. The above fourier transform is continuous, meaning that it has infinitely many values. Its counterpart is the discrete fourier transform (DFT), which looks like this:
1.3. Hands-on with current, voltages and supplies#
1.3.1. Batteries: a finite voltage supply#
A battery can be used as finite voltage supply. Depending on the reversibility, the stored chemical energy is released once (or another time after recharging) into electrical energy. There is a wide range of batteries, smaller ones for household purposes, or bigger ones for cars and storing solar energy.
A cylindrical AA battery supplies typically 1.5 V with a capacity of 2 Ah (2000 mAh). Then a low power LED drawing, for example, 50 mA will last much longer than a high power LED of 500 mA. For a car, the battery supplies 12 V, with a capacity of 60 Ah, so at much bigger scale.
1.3.2. Ground and common#
When working with a circuit, one needs a reference. Ground is such a reference, with voltage \(U\) = 0 V. As the name ground hints at, it originates from the earth. A lightning rod is grounded by connecting it to a grounding pin inserted a few meters into the earth, in order to provide a low resistance path for harmless carrying of the lightning energy to the earth. Ground can be seen as an infinite sink, and practically it can reduce complecity in your schematics since all lines connected to ground do not need to be connected anymore to each other.
In order to prevent users from suffering from a discharge, the chassis or outer (often metal) part of a device is connected to ground. Hence, the outer chassis acts as a shield between the user and the voltage inside a device. Some devices, like a power supply might even have an output pin for such Chassis Ground.
Common is also such 0 V reference, with the big difference that common does not necessarily have to be connected to ground. For example within a voltmeter, the voltage is measured between the, often red, signal in pin and the, often black, common pin. When the common is not connected to ground, the circuit is floating, like the described voltage meter.
For small electronics, the common and ground (GND) are the same, but this is not the case for larger equipment.
Example 1.2 (Voltmeter signal in and chassis ground connected)
What would happen if you connect the voltmeter’s signal in and chassis ground to your measurement system?
answer
When connecting the chassis ground instead of the common, there is no loop for the current, since the common and chassis ground are not connected. There will no voltage, or current, be measured by the volt meter in this case.
1.3.2.1. Simplification of circuit drawings#
The symbol of ground makes it easier to simplify circuits. Another simplication is that not always a voltage source or meter are drawn. Both can be seen in the following graph, where the same circuit is represented in various ways.
Fig. 1.10 All grounds are connected, but this is not necessarily shown in every circuit (it actually simplifies circuits). When an input voltage is given, this is always provided even when the source is not drawn. When an output voltage is given, this is measured with an (ideal) meter, even if the meter is not drawn.#
1.3.2.2. Ground loops#
Although having common or ground (as reference) is very convenient, be careful to not have unintentional connections. If you think to measure with a floating voltmeter but the common is actually connected to ground, then you might cause ground to be on both sides of a component: one due to the circuit design, the other due to the ground of the voltmeter. In such case, the current will not go through that resistor as intended, but will go via ground, as displayed in Fig. 1.11.
Fig. 1.11 Sometimes you could unintentionally connect ground to a circuit, resulting in altering the circuit, or bypassing components. In this figure by measuring the top resistor with a voltmeter connected to ground, the bottom resistor is shortcircuited, because both grounds are connected.#
1.3.2.3. Safety: residual circuit breaker#
The ground is only connected for safety. In case of malfunctioning of a device, the metal enclosure (chassis) is connected to ground. In households, the difference in current through the live and neutral (ground) wire is measured. As soon as the (high) current difference exceeds a certain limit, a residual circuit breaker will interrupt the circuit, and prevents any current towards the circuit. This breaking of the circuit happens in the fuse box or consumer unit. In the older days, a fuse (one time switch) would break and one would replace the fuse. In modern households a circuit breaker would be switched off, and can only be switched on again after removing the (damaged) device, which caused the circuit to be broken in the first place.
1.3.3. Switches and relays#
There are various types of switches, all meant for making or breaking a connection. There are variations in what action to take to change the switch position: push, rotate, toggle, and slide for example. The action can either result in a connection (push-to-make) or a disconnection (push-to-break).
Example 1.3 (Household electronics)
In Dutch households the brown ‘hot’ or ‘live’ electric wire is connected to 230 V, and the blue ‘neutral’ wire is for the common 0 V. A light switch connects the brown ‘live’ supply to a black wire, with is the switched line, it only has a potential when switched on. This approach makes sure that when a lamp is switched off, both wires are not live.
Example 1.4 (multiway switching)
It is possible to have two switches controll the same lamp, for example at the top or bottom of the stairs. These switches are 3-way switches, and by changing either of them, one toggles the lamp. While both switches have two positions, the combination is either aligned or non-aligned, resulting in making or breaking of the circuit as shown in the image below.
Fig. 1.12 Only when both switches are in the same position, which can be either both up, or both down, a circuit is formed and the lamp will be on.
created by I, Cburnett, under CC BY-SA 3.0, original link#
Another type of switches are automated switches. An example of such switch is the relay, which uses an electromagnet to mechanically open or close a switch. Transistors, which will be explained later in this book, can be used to switch electronically (so less mechanical wear).
1.3.3.1. Fuse = one-time switch#
A fuse can be seen as a one-time switch. At high enough current, the fuse’s wire will just burn, and needs to be replaced. Fuse boxes were found in older days at each household, but you will also find a fuse in each current meter.
1.3.4. Safety and Unwanted charge or connections#
You might have felt a spark, or quick discharge, for example when changing a light bulb while not having turned off the power switch. In that case electrons find a path of least resistance through your body. The best prevention is, obviously, not offering this path or removing the source.
Also when building electronic circuits, think critically. It might be that components on your circuit are so sensitive, they can get damaged from a quick (higher voltage) spark from an electrostatically charged person. Wearing a woolen scarf, having low humidity (dry air), wearing isolating shoes or synthetic fabrics, all contribute to static electricity, and can be enough to blow up or fry microcontrollers.
Lastly, also the production method can result in unwanted connections or missing connections, when the soldering process did not go optimally. Therefore always compare the predicted and measured signal; when they do not agree, figure out why.
1.4. ECG: electronic signals in human (Sources in action)#
An Electrocardiogram (ECG) is a recording of the electrical activity of the heart, required to let the heart muscle contract in order to pump blood around. The ECG can be measured with electrodes on the chest and limbs. Physicians can retrieve information about heart rhythm, and whether disturbances occur. Fun fact: the Dutch Willem Einthoven got the Nobel Prize for precisely recording an ECG.
Often 12 measurement points are used; the data from the limbs is subtracted in order to construct a virtual central measurement point (called Wilson’s central terminal), the measurements will then be related to this virtual reference point. The measurements at the chest are sensing different angles and sides of the heart, and therefore sense different parts of the heart more effectively.
Fig. 1.13 ECG signals from different limbs. Top row displays the raw signal, bottom row the subtracted one, referenced to the real central signal.
Created by Npatchett, under CC BY-SA 4.0, original link#
The limb leads and augmented limb leads (Wilson’s central terminal is used as the negative pole for the latter in this representation)
Fig. 1.14 Animation of a normal ECG wave
Created by Kalumet, under CC BY-SA3.0, original link#
1.5. Exercises#
Exercise 1.2 (Draw currents)
Draw the current(s) in Fig. 1.7.
Tip
Does the current go from + to -, or oppositely outside a source?
answer
in figure a,b,c: the current goes from + to - outside a source (the electrons go from - to +). So the current in the load goes from left to right
in figure d: the batteries are placed oppositely, there will be no current (it cannot go left and right at the same time)
in figure e: the current only goes through the batteries in a circle, not through the load
Exercise 1.3 (How do currents relate to each other)
Within Fig. 1.7: What is the relation between I_a, I_b, I_c?
Tip
Does the current go from + to -, or in opposite direction outside a source?
answer a)
I_b=2 I_a I_c=I_a/2