# Electronics Made Easy (By me...)

## Preface

NOTE:

1. A lot of analogy in this blog post may not completly represent the same term in the electrical world, but it should help you understand, for such cases, pls refer to much professional textbooks.
2. The purpose of this post, initially is to help myself as a quick reference, as i am not a EEE boy, I am a CS and AI man with Physics background, that dose not quite enough for understanding the whole EEE Empire.
3. Many images and contens of the post is come from some commercial posts, which lisenced to the AzatAI with commericla license agreements, and AzatAI has already paid for it, yet , that dose not meant, the images and other media on this post REQUIRES ADDITIONAL LICENCE and FEE for Publishing it elsewhere.
4. Sorry but i have to say again as it is required in the license, media contents of this post are licensed to Azat Artificial Intelligence, LLP as a commercial license agreement for use only on AzatAI projects.
5. That’s all…..tiring note, let’s start!

## Theory

### Current

Analogy: Current of water in a pipe (in a river)

• The strength of the current in a pipe as being the amount of water passing a point in the pipe every second.
• Current:
• The amount of charge carried by electrons passing a point in a wire per second.
• Ampere, amp, A

### Voltage

Analogy : similar to height in a system of water pipes & it is relative.

• At a single point, Voltage:
• difference between the voltage at that point and the local ground.
• If there is no difference in voltage between one end of a wire and another, then no current will flow.

### Ohm’s Law

• Definition:
• Current flowing through a wire or electronic component ($I$) will be the voltage across that wire or component ($V$) devided by the resistance of the component ($R$).
• $I = \frac{V}{R}$
• $V=IR$
• $R=\frac{V}{I}$

### Resistance

• Resistance:
• The ability of a substance to resist the flow of current.
• The thicker the wire, the less its resistance for a given length.
• To limit the amount of current flowing through part of a circuit -> adding some resistance in the form of a special component called resistor.

### Kirchhoff’s Current Law

• At any point on a circuit, the current flowing into that point must equal the current flowing out.

### Kirchhoff’s Voltage Law

• All the voltage that between various points around a circuit will add up to zero.

### Power

• Power is the rate of conversion of electrical energy to some other form of energy (usually heat).
• Measured in Joules of energy per second, aka Watt (W)
• $P=I\times V$
• Power in watts is the voltage across the resistor (in volts) multiplied y the current flowing through in amps.
• $P=\frac{V^2}{R}$

### AC - Alternative Current

• AC – Alternative Current
• DC – Direct Current
• DC – Usually on a circuit
• AC – usually supplied by wall outlets (sockets )
• AC
• US: 110V
• Other: 220 – 240V
• $frequency = \frac{1}{period}$
• Unit of frequency is Hertz (abbreviated as Hz)
• For AC has a period of 16.6 ms:
• 16.6 ms is 0.0166 seconds
• $frequency=\frac{1}{period}=\frac{1}{0.0166}\approx60Hz$

## Resistors

• Ohm, the unit of resistance, is usualy abbreviated as the Greek letter omega ($\Omega$)
• In circuit schematics, usually the Unit can also be used as R

### Resistor Color Code

• Three stripes together on the left determine the resistor’s value.
• The single stripe on the right, determines the accuracy of the value.

Color values:

Color Black Brown Red Orange Yellow Green Blue Violet Gray White Gold Silver
Value 0 1 2 3 4 5 6 7 8 9 1/10 1/100

Tolerance:

Color Silver Gold Brown
Value $\pm10$ % $\pm5$ % $\pm1$ %

### Variable Resistor

• A variable resistor, a.k.a a pot or potentiometer, is made from a resistive track and a slider that varies it’s position along the track.

Potentiometer in different shape:

Symbol of a pot:

### Resistors in Serial

• The overall resistance of a number of reistors in series is just the sum of the separate resistances.
• Resistors in serial often used to form a voltage devider.

### Resistors in Parallel

• The combined resistance of a number of resistors in parallel is the inverse of the sum of the inverses of the resistors.
• $R_{total}=\frac{1}{\frac{1}{R_1}+\frac{1}{R_2}}$

### Voltage Dividers

• Use two resistors in series as a voltage divider ( also called potential divider ) (the word “potential” indicates the voltage has the potential to do work and make current flow)

• The output voltage ($V_{out}$) will be a fraction of the input voltage ($V_{in}$) according to the formula

$V_{out} = \frac{R_2}{R_1+R_2}\times V_{in}$

• If R1 and R2 are equal, then the voltage is divided by 2.

## Measure Light Levels (photoresistor)

measure the intensity of light electrically.

• A photoresistor is a resistor in a clear plastic package whose resistance varias depending on the amount of light falling on it.
• The more brightly the photoresistor is illuminated, the lower the resistance.

### Measure Temperature (thermistor)

Measure the temperature electonically.

• All resistors are slightly sensitive to changes in temperature.
• Thermistors are resistors whose resistance is very sensitive to change in temperature.
• There are two types of thermistors:
• NTC – Negative temperature coefficient thermistor
• resistance decreases as the temperature increases
• PTC – Positive temperature coefficient thermistor
• resistance increases as the temperaure increases
• PTC also can be used to limit current (as the current throught the thermistor increases, the resistor heats up and thus its resistance increases, reducing the current)

### Wires

• In reality, wires do have resistance.
• A thick copper wire will have a much lower resistance than the same length of a much thinner wire.
• Standards:
• AWG – American Wire Gauge
• SWG – Standard Wire Gauge

• The larger the AWG number, the thicker the wire.

• For a breadboard, you should use AWG 22.

## Capacitors and Inductors

When it comes to digital electronics, capacitors are almost a matter of insurance, providing short-term stores of charge that improve the reliability of a circuit.

In analog electronics, capacitors can be used to tasks such as:

• set the frequency of oscillators
• Smooth the ripples of a power supply
• couple two audio circuits without transferring

### Store Energy Temporarily (capacitors)

• In construction – capacirots are just two conductive surface separated by an insulating layer.
• the insulating layer between the cunductive surface can be just air.
• the value of the capacitor depends on :
• the area of the conductive plates
• how close they are together
• how good an insulator sepates them
• greater the area of plates, smaller the distance between them, the greater the capacitance (the more charge it can store)

• Capacitor as an elastic membrane in a pipe, that dose not allow water to pass all the way through the pipe, but will stretch, allowing the capacitor to be charged.

### Capacitor Types

In most cases:

• For capacitors between 1pF and 1nF, use a disc capacitor
• For capacitors between 1nF and 1uF use multilayer ceramic capacitor (MLC)
• For capacitors above 1uF use an aluminum electrolytic capacitor

### Capacitors in Parallel

• Capactitors in parallel, double up on the surface area of the conductive plates and therefore may correctly assume that the overall capacitance is the sum of the two capacitors.
• Capacitors can be used in some systems, in such case, it is common to use a number of different capacitors of different types and values in parallel to minimize the effects of ESR.

### Capacitors in Series

• Capacitors connected in serial is similar to the resistors in parallel
• $R_{total}=\frac{1}{\frac{1}{c_1}+\frac{1}{c_2}}$
• it is unusual to connect capacitors in series

### Energy stored in a Capacitor

• $E = \frac{C\times V^2}{2}$

### Modify and Moderate Current Flow (inductors)

We want a component that can filter parts of a signal or smooth out fluctuations.

• An inductor – is at its simplest, just a coil of wire. At DC, it behaves just like any length of wire and will have some resistance, but when AC flows through it, it starts to do something interesting.

• A change in current in one direction in an inductor causes a change in voltage in the opposite direction.

• The heigher the frequency of the AC, the more the inductor resists the flow of current (reactance).

• the reactance X of an inductor can be calculated by the formula: ( f frequency of AC, L inductance of the inductor whose unit is Henry(H))

$X=2\pi fL$

• Choke (a type of inductor) is designed to let DC pass while blocking the AC part of signal.

• Ferrite choke – A cylender of ferrite material that encloses the cables and increases the inductance of the wire to a level where it can supress high-frequency noise.

### Convert AC Voltage (transformer)

A transformer is essentially two or more inductor coils wrapped onto a single core.

• Primary coil is driven by AC, the secondary coil is connected to the load.
• The voltage at the secondary is determined by the ratio of the number of turns on the primary to the number of turns on the secondary.

## Diodes

### Block the current in one direction

Dione : Allows current to flow one way but not the other.

• Diode – A diode is a component that only allows current to flow through it in one direction.
• It is analogy of one way water valve
• The diode offers very low resistance in one direction and very high resistance in the other.

• anode
• a
• in
• cathode
• k
• out
• The diode’s one-way effect can be used to convert AC indto DC (is called rectification)

### Different Types of Diodes

• There are many different types of diodes.

• The forward voltage, often abbreviated as Vf is the voltage across the diode when forward-biased.

### Use a Diode to Restrict DC Voltage (Zener Diode)

When forward-biased, Zener diodes behave just like regular diodes and conduct. At low voltages, when reverse-biased they have high resistance just like normal diodes. However, when the reversebiased voltage exceeds a certain level (called the breakdown voltage), the diodes suddenly conduct as if they were forward-biased.

• Zener diodes are usefull for providing a reference voltage.

• The output voltage will remain rougly 5v whatever Vin is as long as it’s greater than 5V.

### LEDs

LEDs are like regular diodes in that when reverse-biased they block the flow of current, but when forward biased they emit light.

• Generally a standard RED LED has a forward voltage of about 1.6v

### Photodiode – Detect Light

Photodiodes can be treated as little tiny photovoltaic solar cells. When illuminated they generate a small current.

The resistor is necessary so that the small current from the photodiode is converted into a voltage

(V=IR).

• Photodiodes are quite linear, so they are often used in light meters.

• They also respond pretty quickly and are used in telecommunications systems to sense optical signals.

## Transistors and Integrated Circuits

Transistors are used to control the flow of a current. In Digital electronics this control takes the form of an on/off action, withe the transistor acting as an electronic switch.

Transistors are also used in analog electronics where they can be used to amplify signals in a linear manner.

### Switch a stronger current using a weaker one — Bipolar junction transistor (BJT)

BJT cost just a few cents and are often used with a microcontroller output pin from an Arduino or Raspberry Pi to increase the current the pin can control.

• Collector — the main current to be controlled flows into the collector
• Base — the control connection
• Emitter — the main current flows out through the emitter

The main current flowing into the collector and the out of the emitter is controlled by a much smaller current flowing into the base and out of the emitter.

• the ratio of the base curent to the collector current is called the crrent gain of the transistor and is typically somewhere between 100 and 400

So for a transistor with a gain of 100, a 1mA current flowing from base to emitter will allow a current of up to 100mA to flow from collector to emitter.

Above is NPN BJT and is widely used.

NOTE: One should limit the current that flow into the base of the transistor.

PNP BJT :

### Darlington Transistor

A regular BJT will typically only have a gain ( ratio of base current to cpntrol current) of perhaps 100. A lot of time , this will be sufficient, but sometimes more gain is required. A convinient way of achieving this is to use a Darlington transistor, which will typically have a gain of 10,000 or more.

• A darlington transistor is actually made up of two regular BJTs in one package.

• The overall current gain of the pair of the transistors in this arrangement is the gain of the first transistor multiplied by the gain of the second.

### MOSFET

Metal-oxide semiconductor field effect transistor do not have an emitter, base ,and collector, but rather a source, gate, and drain.

Like BJTs, MOSFETs come in two flavors:

• N-channel

• most used

• P-channel

Rather than multiply a current in the way that BJT dose, there is no electrical connection between the gate and other connections, of the MOSFET.

• The gate is separated from other connections by an insulating layer.
• If the gate-drain voltage exceeds the threashold voltage if the MOSFET, then the MOSFET conducts and a large current can flow between the drain and source connections of the MOSFET.
• MOSFETs can switch much higher current than BJTs before they start to get hot.