A lot of times in my 20+ years of experience I came to the conclusion that very difficult problems that I worked on eventually narrowed down to just fundamental concepts. This is the first blog post in a series focussed on fundamental concepts of electronic circuits analysis and design. I will start with the most basic concept of electric current, after which I will present Ohm’s law from an intuitive perspective. Following that I will talk about time varying electric currents and I will show some examples of time varying signals measured in time domain and in frequency domain. Then I will cover Kirchhoff’s voltage and current laws, two basic laws of circuit analysis. I will be using the new to illustrate these concepts.
1. Electric Current
We all have some idea about what electric current is, so I would like to start this series of blog posts by first trying to clarify what electric current is.
What do you think is electric current from a physical microscopic point of view?
What do you think is electrical current from an analytic point of view?
To answer these questions let’s first notice that in order to have electric current we need a closed-loop circuit made at least by a voltage source, a conductive path, and a load. But what is a voltage source? A very common voltage source is a battery, so let’s look at how batteries generate electricity.
The question we try to answer is how does a battery create a positive charge at one terminal and a negative charge at the other terminal? This happens through chemical reactions, which can be of many types so instead of going in more details on the chemistry part I propose to use a modeling approach. We can imagine these chemical reactions like some kind of "motor" or "pump" that pulls electrons from one of the two metallic terminals of the battery and pushes them towards the other terminal. This mechanism stabilizes when the voltage between the two terminals reaches a predefined value, for example 1.5V in most common batteries.
This model can be visualized in the figure below:
At 1.5V the "electrons" pump stops. The battery region near the negative terminal has an excess of mobile electrons while the region near the positive terminal has an excess of positively charged ionized atoms, which have been depleted of part of their the electrons.
If the battery is not connected in a circuit there is no electric current flowing inside, and the battery can be imagined like an electrostatic charged "device".
Let’s take a look next at a conductive path and load made of a metallic wire and a resistor, as shown in the figure below:
A simple way to imagine this is to visualize a metal as made of many atoms which each is neutrally charged: the negative charge of the electrons is equal to the positive charge of the nuclei. This is exemplified in the magnified view of the metallic wire on the right side of the figure.
What is special about metals is that many of the electrons do not stay attached to their atom, they just float around within the metal. This happens mainly due to a thermal agitation force that is higher than the force that attracts these electrons to their atom's nucleus. So millions of atoms have these loose electrons floating around, but still the total number of electrons is equal to the total number of positive charges in the atoms, so the metallic wire is neutrally charged.
Let’s connect now the metallic wire to the battery, as I am showing in the following figure.
From electrostatics we know that particles charged with opposite polarity attract each other and particles charged with the same polarity repel each other.
Based on this, electrons on the negatively charged side of the battery, which tend to repel each other since they are charged with the same polarity, find a way to flow out of the battery through the metallic wire, so they start “pushing” each other through that “exit” path. As they enter the metallic wire they push the mobile floating electrons inside the metal. This pushing propagates from electron to electron through the entire metallic wire and resistor towards the positive terminal of the battery, where the electrons are attracted inside by the positive charge of the ionized atoms. Since this flow would eventually neutralize the negative and positive charges of the battery, thus lowering the 1.5V, the "motor" or "pump" inside the battery turns on and pushes more electrons towards the negative terminal trying to maintain the 1.5V potential difference. This mechanism maintains the flow of electrons through the circuit.
So we learned that at a microscopic level of analysis, electric current in metals consists of negative charged electrons that flow in a circuit starting from the negative terminal of a source/battery, passing through the circuit elements, and entering back into the source/battery through the positive terminal.
How shall we define the direction the electric current in a general circuit made out of a voltage source, conductive path, and one or multiple loads? Shall we pick the direction of electrons flow and say that this is the direction of electric current?
To answer these questions let’s notice that electric current made out of positive charges exists and flows from the positive terminal into the negative terminal of a voltage source. An example would be the positive ions flow in electrolysis; they are positively charged particles and travel from the positive terminal to the negative terminal of the electrolysis electrodes. Other examples may be related to electric discharges though various gases where ions form. When positive charged ions form they travel towards the negative terminal, and when negative ions form they travel towards the positive terminal of the voltage source, so this direction is opposite to the electrons flow direction in the example above.
So in some circuits positive charges flow in one direction and negative charges in the opposite direction. Then, how shall we consider the direction of electric current when we write analytic equations like Ohm’s law, Kirchhoff’s voltage and current laws?
To answer this question let’s notice that what we talked about so far was the physical mechanism of charge flow inside conductors and the important part is that flowing particles can be both positively or negatively charged. Positive charges flow in one direction while negative charges flow in opposite direction.
To avoid any confusion, in analytic equations and mathematical analysis instead of considering the electric current as a microscopic structure of charged particles flow we use instead an abstract model of electric current. This abstract model defines electric current direction as flowing from the positive terminal of the power supply through an external circuit and back into the negative terminal of the power supplies. This is only a convention or a model and does not represent a physical phenomenon occurring inside the circuits' wires. We use this model only to be consistent across various equations and formulae in circuit analysis. The following figure illustrates this concept:
So in conclusion we know that microscopically the electric current in metallic wires is made out of negatively charged particles - electrons flowing from "-" to "+" terminals of the power supply, but we do not use this knowledge in circuit analysis. Instead when analyzing circuits we use an abstract model which describes the electric current as a flow of positive charge from the "+" to the "-" terminals of the power supply.
2. Ohm’s Law
Ohm's Law is used to calculate the voltage drop on a resistor when knowing the current and resistor value. To illustrate this let’s look at the figure below:
We know use the analytical model of electric current as consisting of positively charged particles flowing from the positive terminal of the voltage source, through the circuit and back into the negative terminal of the voltage source. This circuit has a resistor in the path, which we can view as a section of the path that partially blocks the flow of electric current. This is analogous to traffic on a highway that at some point has a lane closed and cars slow down and accumulates at the beginning of the narrow section. This is illustrated in the figure above by a larger number of charged particles accumulated at the entrance into the resistor. Since these particles are positively charged, if we take a voltmeter and measure the voltage between the entrance into the resistor section and the exit from the resistor section we will notice a difference in electric potential due to higher density of positive particles at the entrance. This difference of potential is called voltage drop on the resistor. Ohm’s law quantifies this voltage drop as being equal to the intensity of the electric current multiplied by the resistance of the resistor: V=IR.
3. DC and AC Currents
So far we have talked about electric current and we saw how it flows from one terminal of the battery through the external circuit and back into the battery through the other terminal.
This was a continuous current also named DC current. Let's think now at alternating current, named AC current. How do you think the AC current flows in a circuit? How do you think electrons flow in an AC electric current?
An easy way to imagine an alternating current is to look at the battery model shown in the previous figures and consider that the “pump” inside alternates the direction towards it pumps electrons. Like for example it can pump electrons towards the terminal at the bottom for one millisecond and then switch direction and pump electrons towards the terminal at the top for another millisecond, and then continuing like this back and forth one millisecond in each direction. As a result, the electrons through the entire circuit (including the load too) will move back and forth one millisecond each way. This is called alternating current and it is abbreviated AC. The voltage at the terminals of the source changes polarities as the internal “pump” changes the direction in which it pushes electrons. The term “alternating current” is typically used for currents (and voltages) that alternate their intensity following a sinusoidal function. This not always the case; sometimes the variation follows different functions like square wave, triangle wave, or just any arbitrary periodic variation. These time-varying voltages can be visually measured with an oscilloscope.
4. What is an oscilloscope and how can we measure time varying signals with it?
In a very simplistic way, an oscilloscope is an instrument that can be used to visualize how signals vary in time. The following figure shows the graphical representation of a square wave signal and the image of this signal as shown on the display of an oscilloscope:
We can view the oscilloscope as an instrument that captures successive snapshots of the signal waveform and display them one after another on the screen. The trigger function of the oscilloscope ensures that each snapshot starts at the same location within the signal period so the image on the display stays stable. The time base function of the oscilloscope ensures that each snapshot has the same length in time, thus when sequentially displaying these snapshots the image is clear and stable.
In this measurement I used a Tektronix TBS1202B-EDU oscilloscope, which I personally like because it has a crystal-clear and colored screen and offers very useful built-in functions besides the displaying signal waveform. Some of these functions, like the automatic measurement of signal amplitude, frequency, rise and fall time, RMS value, mean value, duty cycle, pulse width, overshoot and undershoot, performed digitally rather then visually approximating them on the screen help me significantly in design and troubleshooting of electronic circuits. Also the Tektronix TBS1202B-EDU oscilloscope has a built-in Fast Fourier Transform function that allows signal conversion from time domain to frequency domain, which enables additional analysis and troubleshooting areas like signal jitter components and electromagnetic interference.
Here is an example of a sinusoidal signal displayed on the TBS1202B-EDU oscilloscope with my annotations in color pink:
The measurements at the bottom of the screen show the minimum and maximum voltage levels, the peak-to-peak magnitude of about 2V, the mean value of a few millivolts, the frequency of about 2MHz, and the RMS voltage of 680mV. The RMS (root mean square) voltage is what we measure with multimeters when we probe time varying signals. Not all oscilloscopes have built-in measurement for RMS voltage, so in many cases we need to use a digital multimeter (DMM) to measure the RMS value; however, DMMs are usually limited in bandwidth so they do not measure accurately the RMS value of high frequency signals. I like this TBS1020B-EDU oscilloscope since all the built-in measurements work up to the full bandwidth of 200MHz.
So what is the physical meaning of the RMS value of a time varying signal?
A DMM measures the rms value of a sinusoidal signal, which is equal to the peak voltage multiplied by 0.707.
Here is a clarification for the "rms" (Vpeak*0.707) and also the "average" (Vpeak * 0.636) values of a sinusoidal waveform:
The factors 0.707 and 0.636 result from the following analysis:
0.707 comes from the rms voltage definition. V_rms, is a constant (DC) voltage that produces the same average power dissipation on a resistor as the sinusoidal voltage V_max*sin(ω*t). The power dissipation P = V*I = V^2 / R . So for V_rms, which remember is a DC voltage, it’s easy: P_avg = V_rms^2 / R; however, for a sinusoidal voltage P_avg = ( V_max*sin(ω*t) )^2 / R = [V_max^2 * (sin(ω*t))^2] / R . Since these two average powers have to be equal, it results that: V_rms^2 = V_max^2 * (sin(ω*t))^2. The sinusoidal term is an average over many periods of a sin square function, which from trigonometry or from an intuitive graphic (similar to a sinusoid but shifted up and varying between 0 and 1) has the value of 0.5. Inserting 0.5 in the above equation V_rms^2 = V_max^2 * 0.5, and taking square roots on both sides V_rms = V_max * squareroot(0.5) = V_max * 0.707
0.636 comes form calculating the time average of voltage (not power like in the rms case above) for one half cycle. By integrating the sinusoidal voltage over half of period we obtain V_max * (2/pi) = V_max * (2/3.14) =V_max * 0.636
Similar analysis applies for any arbitrary time varying periodic signal, since periodic signals can be decomposed based on Fourier analysis into multiple sinusoidal signals superimposed. This Tektronix TBS1202B-EDU oscilloscope has a built-in Fast Fourier Transform (FFT) function that can decompose the time domain displayed waveform into frequency domain sinusoidal components. Here is a picture of the frequency spectra of the sinusoidal signal above, with my annotations in color pink:
We can see the fundamental component located at 2MHz (this is the frequency of the signal also shown in the time domain displayed sinusoid in the previous picture). Additionally we can see parasitic spurs at various frequencies, which are generated by my signal generator circuit. In an ideal case we should see only the fundamental component, but in this case we see these parasitic spurs generated by my signal generator circuit. Notice that we could not see the effect of these parasitic spurs in the time domain displayed sinusoidal waveform even though they were there. When we design or troubleshoot a circuit these parasitic spurs distort the signals and degrade the performance of our projects. Since they cannot be visually noticed on the time domain waveform this built-in FFT function in the Tektronix TBS1202B-EDU oscilloscope is a great tool that can be used to identify the root cause of signals distortion.
In the following picture I am showing the FFT transform of a rectangular signal with my annotations in color pink:
This rectangular wave signal has the fundamental frequency component at 200kHz and odd harmonics at 600kHz, 1MHz, 1.4MHz, 1.8MHz, … There are also parasitic spurs superimposed to these expected spectral components. Since rectangular signals are typically used in communication interfaces (like microprocessors, systems-on-chip, peripheral modules, and various interface signals between them) the parasitic spurs translate into timing jitter, which may degrade the performance or generate failures.
To characterize rectangular waveforms there are additional built-in measurements in the TBS1202B-EDU oscilloscope like: rise time, fall time, overshoot, which I captured in the youtube video linked below:
Going now back to analog signals there are two fundamental laws that are used to analyze circuits: Kirchhoff’s voltage law and Kirchhoff’s current law.
5. Kirchhoff’s Voltage Law
Kirchhoff’s voltage law describes the relationship between the voltage sources and voltage drops on loads in a circuit loop. A simple example is shown in the following figure. According to Kirchhoff’s voltage law the algebraic sum of voltages in a loop is equal to zero. Notice the polarities of voltages on the battery and the three resistors. In red it is shown the direction of electric current as flowing from the positive terminal of the battery through the three resistors and back into the battery. The voltage on the battery has polarity opposite to the direction of electric current and therefore it is algebraically added as negative value.
In the example above we knew the direction of electric current; however, there are often cases when we do not know the direction of electric current through the circuit loop. To apply Kirchhoff’s voltage law we don’t really need to know the actual direction of electric current; we can just define an arbitrary direction and write Kirchhoff’s voltage for that direction. This is exemplified in the figure below:
In this example we defined an arbitrary direction through the loop, clockwise in the example 1 and counter-clockwise in example 2. Notice that the Kirchhoff’s voltage laws written for these two opposite arbitrary directions result in the same equation.
To further clarify the Kirchhoff’s voltage law let’s look at the following example, which includes multiple voltage sources and connected with reverse polarities.
So depending on the arbitrary direction chosen, some supply voltages are summed with a positive sign and others with a negative sign.
6. Kirchhoff’s Current Law
Kirchhoff’s current law describes quantitatively the relationship between the intensity of electric currents that flow in and out of a circuit node. From an intuitive perspective, by looking at the figure below we can deduce that as I_total current splits into three currents, I1, I2, and I3, the number of charges of I_total that flow through the wire in a unit of time would have to split among the three paths of I1, I2, and I3. So if we combine the number of charges that flow in one second in I1, I2, and I3 currents the sum should be equal to I_total’s number of charges that flow in one second (no charges are lost and no charges are created). This is exactly what Kirchhoff’s current law states, that:
I_total = I1 + I2 + I3,
or in the general form: the algebraic sum of electric currents flowing into a circuit node is equal to zero.
How does the current split? How much would it go through one resistor and how much through the others? Let's look at an example: R1 = 1kOhms, R2= 3kOhms and R3 = 9kOhms, all connected in parallel to a 9V voltage supply. Applying Ohm’s law to each resistor, V=I1*R1, V=I2*R2, and V=I3*R3, we know V and R1, R2, R3, so we can calculate the value of each current: I1=9mA, I2=3mA, and I3=1mA.
To conclude, in this first part Blog I have covered some fundamental concepts of circuits and signals analysis. In the following blog posts I will talk about capacitors, inductors, amplifiers, and digital versus analog signals. Feel free to ask questions or post comments, and I will try to address them.