Post

Revisiting fundamentals of electronics

Revisiting fundamentals of electronics

Motivation

My first introduction to circuit analysis and electronics was in 2012 when I pursued my bachelor’s degree in electrical and electronics engineering. It has been quite a while since I revisited these concepts. These being my bread and butter warranted a more thorough revision. I embarked on a long guided journey to revisit the fundamentals and play/simulate them while in the process.

Udemy had a course named The Complete Electronics Course: Analog Hardware Design by Hardware Academy that lasted for 24 hours of content and another one named Crash Course Electronics and PCB Design by Andre LaMothe that had 112 hours of video content and an accompanying book titled Design Your Own Video Game Console.

I had to do Andre’s 112-hour course twice as by the end of the first run I started getting the urge to note down important concepts for revising/referencing later. Although I tried to note down most of the content here myself, some of the figures, and pictures I have on this page either come from Andre’s course or the Hardware Academy’s course.  

Andre's course Andre LaMothe’s course

Hardware Academy's course Hardware Academy’s course

This content is for my recollection and reference. The concepts and ideas may be wrong/inaccurate. Viewer discretion is advised.

Atomic theory & Bohr’s model

 

Hints in bullet form.

 

  • Atom nucleus = protons (positive charge) + neutrons (no charge). The nucleus gives the atom its weight/mass. Electrons account for electronic and chemical properties and exist in energy bands/shells that orbit around the nucleus.        
  • In general 106 elements exist in the periodic table where the periodic table lists elements in order of atomic number and vertical group related to electron configuration. Protons = atomic number and Protons = electrons and Atomic weight = number of neutrons + number of protons        
  • Losing a proton/electron in a neutrally charged atom leads to an ion and losing a neutron makes the atom an isotope. Isotopes behave like the original version of the atom but ions are very different from parent atoms        
  • Electron flow leads to electric current. Loose electrons in the valence shell contribute to this electron flow movement conductors have loosely bound electrons in valence and insulators have tightly bound electrons in valence        
  • Electrons spin in a direction and like to be coupled with electrons nearby spinning in opposite directions. The voltage applied to a conductor metal makes the electrons in the valence shell move from one atom to another leaving behind holes momentarily  

  • This shifting of electrons is an electric current. Electrons move toward positive potential, and holes (positive charge) move toward negative potential. Electron flow is called electron current, and hole flow is called conventional current.  

  • Basically, current is the motion of charges, and By definition, the amount of charge Q that passes a point p as a function of time defines current I = dq/dt. I = change in q with respect to change in t. One coulomb of charge per seconds is one ampere

Voltage

  • Voltage is a manifestation of an electric field and Every single charge creates an electric field. Many similar charges together sum the individual electric fields to create a bigger field.  

  • To move a single electron in such a field requires work. Just dropping an electron in such a field would make it feel a force and become accelerated which would be proportional to the electric field

  • Moving a charge from one point to another changes its potential energy measured in Joules. 1 Joule of energy spent in moving 1 Coulomb of charge through a potential difference or voltage of 1V. 1V  = 1J/1C

  • DC - Direct current - No change in voltage and AC- Alternating current - changes with respect to time, AC has frequency, peak voltage, peak to peak and RMS voltage, its Peak to peak voltage = Vpmax - Vpmin and its RMS = 0.5 * Vpeak-to-peak / sqrt(2)

  • Ohm’s law = (Voltage = current * Resistance ) and Power = V * I and Power factor in AC = cosine (phase angle of voltage - phase angle of current)

Resistors

  • Current flowing through the resistor makes it develop a voltage drop

  • Series resistors make the resistances add R_total = R1 + R2 and parallel resistors have equivalent resistance like so R_total = R2/R1+R2

Semiconductors

    Valence band / Conduction band of Insulators, Semiconductors and Conductors (from Andre’s book)

  • Semiconductors have properties between conductor and insulator. The energy gap needed for electrons to jump from the valence band to the conduction band (where electrons are loosely coupled leading to conduction) is less.

 Atomic model (From: Youtube, TheEngineeringMindset.com)  

Before bonding with neighbouring atoms - Silicon  

 Silicon atoms before bonding (From: Youtube, TheEngineeringMindset.com)     After bonding

  Silicon atoms after bonding (From: Youtube, TheEngineeringMindset.com)  

  • Doping is where elements like silicon which are semiconductors with 4 valence electrons are mixed with other elements with more/less valence electrons.

After doping:  

 Silicon atoms doped with Phosporus atoms (From: Youtube, TheEngineeringMindset.com)  

  • N-type semiconductors have silicon doped with pentavalent materials which has 5 electrons in its valence shell. 4 of its electrons in its valence shell bond with neighboring silicon electrons leaving one electron free for conductivity.

  • P-type semiconductors have silicon doped with trivalent materials that have 3 electrons in their valence shell. This creates a hole or acceptor atom for electrons.

P-N junction

  • When combined, free electrons migrate to the P region, and holes start increasing in the N region. This creates a depletion region, which has a barrier potential or potential difference.  
  • This becomes a steady state of the PN junction and must be overcome to start the current flow. If we forward bias the junction, current flows, and if it’s reverse biased, nothing flows.

Forward biasing

  • Applying an electric field/potential energizes the electrons in the n region to cross the barrier potential/ depletion region to occupy the holes in the P region. The positive voltage in the P region strongly attracts nearby electrons as well.  
  • Because of this flow of electrons and holes, a current starts to flow. A voltage drop is created over the depletion region to overcome the potential barrier. This is mostly 0.7 or 0.3 V

Reverse biasing

  • The whole element becomes an insulator widening the depletion region. When the PN junction is applied reverse polarity is.

Diode

  • Has anode and cathode. Current flows from anode to cathode. The diode has to be forward-biased to start conduction. The voltage drop for various current flows is not linear. Most of the time the drop remains the same at 0.7V. If a high current passes through, it could double.  
  • Some diodes are rectifier diodes, zener, LEDs, switching diodes

KCL and KVL  

 

  • Kirchoff’s current law states that the sum of currents at any node is zero where a node is a point where two or more electrical connections are made.

  • Kirchoff’s voltage law states that the sum of all voltages in a closed loop is zero

Capacitors

  • They are energy storage devices with their capacitance C measured in Farads. Normal Usage varies within pico to microfarads in typical circuits

  • They are typically two parallel plates separated by air or any other suitable dielectric medium With a distance d. When voltage is applied to the plates, an electric field is set and this causes Positive and negative charges to accumulate on opposite sides. Even when the applied voltage is removed, the charges are still there for a while      
  • Internally capacitors have ESR equivalent series resistance as well as inductance and leakage, I = c* dv/dt. The voltage on a capacitor is the integral or sum of the current over the time divided by the capacitance

  • A side effect of this equation is that DC is blocked whereas AC is passed through capacitors. Capacitors in parallel are CEquivalent = C1+ C2+… and Capacitors in series are 1/CEquivalent = 1/C1 + 1/C2 + ..

Self-Handwritten note depicting charging/discharging equations of a capacitor 

\[\begin{alignat}{2} The \ charging \ equation, \\ V = V_{IN} * (1 - e^{(-t/RC)}) \\ plugging \ t = RC, \\ V = V_{IN} * (1 - e^{(-RC/RC)}) \\ V = V_{IN} * (1 - 0.367) = V_{IN} * 0.637 \\ \\ Now, \ The \ discharging \ equation, \\ V = V_{IN} * (e^{(-t/RC)}) \\ plugging \ t = RC, \\ V = V_{IN} * (e^{(-RC/RC)}) \\ V = V_{IN} * (0.367) \\ \end{alignat}\]

charging/discharging equations of a capacitor    \(\begin{equation} Thus, \ I = C * \frac{dv}{dt} \\ \end{equation}\)

  • The common term in ICE where current leads voltage when the capacitor is present. Since the rate of change of voltage dv/dt is maximum at point 0 (as it increases from 0 to a stable state), the equation makes the current maximum/lead the voltage by 90 degrees when the rate of change of voltage is maximum (i.e, 0 point)

Inductors

  • Current through a conductor creates a magnetic field. Here, Use the right-hand rule to predict the direction of the magnetic field, Flux = L * I  
  • Coils of wire store energy in the form of generating and collapsing magnetic fields. The inductance L is measured in Henrys.  
  • Current through an inductor (a coil of wire) sets up a magnetic field. When this current is removed or cut off, the energy stored in the magnetic field generates a voltage and opposite current when it collapses.  

charging/discharging equations of an inductor     \(\begin{alignat}{2} The \ charging \ equation, \\ I(t) = \frac{V_S}{R} * (1 - e^{(-t/\frac{L}{R})}) \\ plugging \ t = \frac{L}{R}, \\ I(t) = I_O * (1 - 0.367) \\ I(t) = I_O * (0.633) \\ \\ The \ discharging \ equation, \\ I(t) = I_O * (e^{(-t/\frac{L}{R}))}) \\ plugging \ t = \frac{L}{R}, \\ I(t) = I_O * (0.367) \\ Thus, \ V = -L * \frac{di}{dt} \\ \end{alignat}\)

  • The common term is ELI where voltage leads current when the inductor is present. The rate of change of current is max at 0 points and hence leads to the voltage being max at 0 points thereby leading current by 90 degrees

Transformer

  • Transformers step up and step down voltages using the property of mutual inductance which means that when two coils are wound together closely, current through one coil generating a magnetic field will create a magnetic field in the second coil and hence a secondary voltage/current is induced.

Frequency domain analysis

  • When frequency is involved, voltages are mostly represented in RMS where RMS = Peak * 0.707 and A sine wave voltage can be represented by
\[\begin{equation} V(t) = Peak * sine (2 * pi * Frequency * time * \phi) \\ \end{equation}\]
  • Voltage and current are in phase when it’s just a resistor, voltage being higher in amplitude on the plot (blue- v and red - i)

  • Phasor representations of current and voltage about resistor, inductor, and capacitor are as follows:

\[\begin{equation} Capacitive \ impedance \ X_C = \frac{1}{2 * pi* Frequency * Capacitance} \\ \end{equation}\] \[\begin{equation} Inductive \ impedance \ X_L = {2 * pi* Frequency * Inductance} \\ \end{equation}\]
  • Generally impedance Z = Real + Imaginary X

Analysis of RC circuit concerning AC frequency domain.

  • Since AC is involved, an impedance component and a phase shift component are introduced With supply voltage at 10V RMS with 1000hz a Resistor at 100 ohms, and a Capacitor at 2.2 uF

Self-Handwritten note depicting an example circuit for frequency domain analysis         Complex impedance:     \(\begin{equation} Z_C = Real.Part - J * X_C \\ \end{equation}\) \(\begin{equation} Z_L = Real.Part + J * X_L \\ \end{equation}\) \(\begin{equation} Z_R = Real.Part + J * 0 \\ \end{equation}\)    

Solving for the circuit :

Self-Handwritten note depicting another example circuit for frequency domain analysis   

Current leading Voltage in an capacitive circuit. Results from online SPICE program     

Another example with inductor

Example RL circuit for solving        \(\begin{equation} V = (7.07 \angle0) \ V \ and \ R = 200 \ Ohms \ and \ L = 2.2*10^{-3} \ Henry \end{equation}\)     \(\begin{equation} Z_R = 200 + J *0 \end{equation}\) \(\begin{equation} Z_L = 0 + J* X_L , \ where X_L = 2 * pi*100*2.2*10^{-3} = 1.3816 \end{equation}\) \(\begin{equation} Z_L = 1.3816 \angle90 \end{equation}\) \(\begin{equation} Z_{Total} = Z_R + Z_L \end{equation}\) \(\begin{equation} Z_{Total} = \sqrt{200^2 + 1.3816^2} = 200 \end{equation}\) \(\begin{equation} \phi = arctan(\frac{1.3816}{200}) = 0.4 \end{equation}\) \(\begin{equation} Z_{Total} = 200\angle0.4 \end{equation}\) \(\begin{equation} I = \frac{V}{Z} = \frac{7.07\angle0}{200\angle0.4} = 0.03535\angle-0.4 = (35 * 10^{-3} \angle-0.4) \ Amps \end{equation}\) \(\begin{equation} V_R = I * R = (35 * 10^{-3} \angle-0.4) * (200\angle0) = 7\angle-0.4 \ Volts \end{equation}\) \(\begin{equation} V_L = (35 * 10^{-3} \angle-0.4) * (1.3816\angle90) = 48 * 10^{-3}\angle89.6 \ Volts \end{equation}\)  

Filters and transfer functions:

RC filter transfer function

\(\begin{equation} \lvert H(f) \rvert = \frac{1}{\sqrt{1^2 + {(2*\pi*F*R*C)}^2}} \end{equation}\) \(\begin{equation} Plugging \ f = \frac{1}{2*\pi*R*C} \end{equation}\) \(\begin{equation} \lvert H(f) \rvert = \frac{1}{\sqrt{2}} \end{equation}\)

  • which says Voutput is 0.707 times Vinput  
  • To design such a low pass filter with this transfer function: For example a filter with a cutoff frequency of 2 KHz,   
  • Fix a suitable value for either R or C and solve for the remaining  
  • Take C = 0.1uF  

\(\begin{equation} Plugging \ f = 2KHz,\end{equation}\) \(\begin{equation} 2KHz = \frac{1}{2*\pi*R*0.1*10^{-6}} \end{equation}\) \(\begin{equation} R = \frac{1}{2*\pi*2*10^3*0.1*10^{-6}} = 795 \ Ohms \end{equation}\)          Gain dB      

  • 20 log (vOut/Vin) = 20 dB  
  • log (vOut/Vin) = 1 dB  
  • (vOut/Vin) = 101 = 10    

Another example,

   

  • 20 log (vOut/Vin) = -3 dB  
  • (vOut/Vin) = 10(-3/20) = 0.707    

High pass filter transfer function :

      High Pass RC filter transfer function     

RL Filters - Low pass

    Low pass RL filter transfer function     

For High pass RL,

    \(\begin{equation} H(f) = \frac{1}{1+ \frac{R}{J*L*F*2*\pi}} \end{equation}\) \(\begin{equation} \lvert H(f) \rvert = \frac{1}{\sqrt{1^2 + (\frac{R}{L*F*2*\pi}})^2} \end{equation}\) \(\begin{equation} Thus \ f = \frac{R}{2*\pi*L} \end{equation}\)  

NPN transistors

    BJT Transistor junctions (From: Youtube, TheEngineeringMindset.com)  

  • NPN transistors have a base, collector, and emitter. When the base-emitter junction is forward-biased, at 0.7V, electrons flow from the emitter junction into the base. The depletion layer between the base and emitter is extinguished.  
  • The majority charge carriers that are electrons from the emitter flow into the base region and minimal recombination takes place as the base is a thin layer and lightly doped.  
  • The electrons in the base region are now minority carriers. They are accelerated by the reverse bias that exists between the base and collector. The electron flow is now initiated in a major way between the emitter and collector with a very minor number of electrons going through the base junction after recombination. Please view the Khan Academy video on this to be more knowledgeable.

It can work in these modes: 

  • Saturation / Cut off - (ON/OFF)  
  • Active mode

BJT Characterization curves     

  • IE = IB + IC  
  • IC = hFE * IB      
  • When IB = 0, IC = 0 as well by multiplication

  • IE = IB + hFE * IB  
  • IE  = IB (1 + hFE)       *To switch on the transistor, VBE drops 0.6V regardless of anything.      
  • Since Base Emitter drops a 0.6V when turned ON, the 44k resistor has 4.4 V dropped on it as 5V at Base input - 0.6V = 4.4V

  • V = I/R => I = 4.4/44K => 0.1 mA    

Constant current scenario

    1 milli Amp constant current circuit using BJT      

Biasing the base using a resistor divider

  Biasing the base junction of a BJT     

  • Even Though 6.8K and 3.2K are good enough, the reflective impedance from the emitter is parallel To the R2 of the R1 R2 parallel network.

   

  • R2 || hFE * RE      
  • 3.2K * 100K/ 3.2K + 100K = 3.1K       NOTE:

  • RE is the main resistor that programs the current capability of the transistor circuit. Decide the current That has to flow into it and also the voltage drops over it after the 0.6V drop from the VBE.

Voltage programmer

         

Small signal AC analysis

  • Set a Quiescent point for the transistor at 2.5V so that the AC signal can ride on top of it giving both the positive and negative signal above the GND level of the output  
  • To set Q point to 2.5V, the Voltage at Base should be 2.5+0.6 = 3.1 V  
  • Using a voltage divider network R1 and R2, the 5V input is split into 3.3V at the Base  
  • The reflective impedance from RE is 1K * 100 with parallel to R2 which becomes 20K || 100K = 16.6K  
  • From the point of VIN, the impedance calculated is 16.6K || 10K ==> 6.24K  
  • The equivalent resistor 6.24K with capacitor coupled at VIN makes the setup a high pass filter with F3DB = 25Hz  
  • The equivalent resistor 1K at RE in connection with the output capacitor makes it a high pass again with F3DB = 15.9Hz     Common collector configuration of a BJT

Common emitter amplifier

     Common emitter configuration of a BJT    

  • Set and determine the Qpoint at VC to be 5 V. To do this, select the emitter resistor first, and make the emitter current a predetermined value such as 0.5mA in this case. The 0.5mA over the Re resistor should drop a 1V.  
  • This means that a suitable resistor divider network has to be selected at the base with an estimated base voltage of more than 0.6-0.7V than the emitter voltage drop  
  • A resistor divider network of 100K and 19K is selected so that the input voltage of 10V is brought down to 1.6V  
  • Since the impedance reflected from the emitter is hFE*Re = 200K  
  • 19K || 200K = 17.35k ohms , Increase the R2 of the resistor divider so that the equivalent resistance of R2 with regard to emitter impedance reflection becomes 19K  
  • Hence, try R2 with resistance 21K instead of 19K (for instance, 21K||200K = 19k)  
  • Determine F3dB for the input and output equivalent High pass filter network at C1 and C2

Mosfets

  • Three terminals: Gate, Source and drain with No current control, only voltage control.     MOSFET Characterization curve

  • When the gate has applied a voltage that is over the Threshold voltage, the drain-source conduction path is activated.  
  • The conduction path is linear from the drain-source only when the drain-source voltage is lesser than gate voltage - threshold voltage  
  • Breakdown happens when the MOSFET cannot resist the very high voltage applied between the drain-source path

Opamps

  • Opamps are most commonly used as programmable amplifiers. They are also capable of operating as buffers between different circuits, differentiators, integrators, adders, subtractors, etc.,  
  • Opamps have low-to-negligible output impedance and very high input impedance

Opamp model

  • The difference between the input terminals is multiplied by the gain to provide the resulting output  
  • The golden rule of Opamps is that it will do everything possible to make both the non-inverting and inverting input terminal match their voltage while allowing no current to flow in either of the inputs  
  • Normally, Vout = AOL (V+ -  V-)

Opamp common configurations

  • Virtual ground concept applies to inverting amplifier configuration  
  • Opamp has full control over the Vout pin and changes it to + or - ve whichever direction to make both the non-inverting and inverting pins equal  
  • Depending upon the situation to make both non-inverting and inverting pins equal, the opamp can both source current to the load or sink current from the load

Working theory of inverting amplifier configuration

Non-inverting amplifier with gain X3

 Working model of non-inverting amplifier with gain x3       

  • Gain = 1+ RF/R2 = 1 + 1k/500 = 3    

Non-inverting amplifier with gain X1

Working model of non-inverting amplifier with gain x1 also called follower

High current op-amp follower

Working model of non-inverting amplifier with gain x1 and a high current configuration

Inverting amplifier with gain X3

Working model of inverting amplifier with gain x3

The output voltage is amplified by gain -Rc/RE and inverted.

 Gain Bandwidth Product

  • The behavior of opamp’s working is dependent upon the frequency ranges on the input side  
  • Looking at common charts, the gain becomes unity when the frequency range touches 1 MHz, this point is called the gain-bandwidth product  
  • In comparison with the open loop gain, the closed loop gain remains constant until 10KHz  
  • GBP = Av * frequency  
  • Example, for a GBP of 1MHz in a circuit with 100x gain, f = 1MHz/100 = 10KHz

Theoretical model of Gain Bandwidth Product

  • This gain and frequency response could be improved by cascading multiple opamp stages in series

Theoretical model of Gain Bandwidth Product of a cascaded configuration (From: TI’s documents)

Digital logic

Inverter using transistors:

Basic inverter using BJT        When Input is high, output is low and When Input is low, output is high.    

NAND using transistors

Basic NAND gate using BJT 

Inverter at the end of NAND making it AND

 Basic AND gate using BJT     

D Flip flops

   D Flip flop      These are 1-bit memory where the Q and Q complement emit out data inside the memory.   To latch data into memory, when the clock pulse rises, input the memory into the D pin.    

Half adder

     Half adder using basic gates     

Full adder

     Full adder using basic gates 

This post is licensed under CC BY 4.0 by the author.