Professional Documents
Culture Documents
by Muhammad Waleed
Copyright © 2023 by Muhammad Waleed
AC voltage
………………………………………………………………………………
…………………………..…………………2
DC voltage
………………………………………………………………………………
……………………………..………………3
Resistors
………………………………………………………………………………
……………………………………………..….6
Potentiometers
………………………………………………………………………………
…………………………...........12
Capacitors
………………………………………………………………………………
…………………………………………...15
Diodes………………………………………………………………………
……………………………………………………...……20
Inductors……………………………………………………………………
…………………………………………..…………….28
Transistors
………………………………………………………………………………
………………………...………………..30
Fuse…………………………………………………………………………
………………………………………..……………………34
Thermistors………………………………………………………………
………………………………..……………………….35
Introduction to breadboard
………………………………………………………………………………
…………37
Bread connections
………………………………………………………………………………
…………………………..38
Transistor as a
switch………………………………………………………………………
……………………..……..44
Water level
indicator……………………………………………………………………
………………….…………… 48
555 basics
………………………………………………………………………………
……………………………………..50
Internal
structure……………………………………………………………………
………………………………….51
LED
blinking……………………………………………………………………
……………………………………………52
AND Gate
………………………………………………………………………………
………………………………………58
OR Gate
………………………………………………………………………………
………………………………………….59
NOT Gate
………………………………………………………………………………
………………………………………..61
NAND Gate
………………………………………………………………………………
……………………………………62
NOR Gate
………………………………………………………………………………
……………………………………….63
XOR
Gate…………………………………………………………………………
…………………………………………… .64
XNOR
Gate…………………………………………………………………………
…………………………………………66
Microcontroller introduction
………………………………………………………………………………..
77
Arduino board
………………………………………………………………………………
…………………………….78
LED blinking
………………………………………………………………………………
……………………………..…80
Electronic schematics
………………………………………………………………………………
……..…….86
✓ LED with a push
button………………………………………………………………………
…..88
✓ 555
timer…………………………………………………………………………
……………………………..89
✓ Transistor as a
switch………………………………………………………………………
……...90
✓ Linear power
supply………………………………………………………………………
…….……91
Decoupling capacitor
…………………………………………………………….…………………
……………..95
AC Voltage
The
shape of the AC voltage is sinusoidal which looks like an up
and downhill and can be seen with the help of an
oscilloscope.
DC Voltage
Direct Current is the type of voltage that has only one
direction with changes in time and it has a straight-line
waveform.
Conductors and Non-conductors
Conductors
THT resistors or through holes are the ones that have long
legs or pins as shown in the picture. These are easy to solder
and easy to remove from the circuits.
A surface mount resistor is a tiny rectangular ceramic body
with silver conductive edges on either end.
R = R1 + R2 + R3
= 470Ω + 330Ω + 5KΩ
= 5800Ω or 5.8kΩ
In a series combination, voltage is divided and the current
remains the same.
1= 1+ 1+ 1
R R1 R2 R3
=
1+ 1+ 1
470Ω 330Ω 5kΩ
=186.64 Ω
In this combination, the
voltage remains the same,
and the current is divided.
Calculating resistance:
The resistance of the resistor can be calculated with the help
of the multimeter or you can use the resistor color chart if
you didn’t have the multimeter.
Potentiometers are basically type of
resisters but their resistance
can be changed. They are also called variable resistors with
three terminals. Two terminals are connected to resistive
element and the center terminal is connected to rotating
wiper. The center terminal is used to sets the resistance
value.
Types of potentiometers: In the market, there are two types
of potentiometers which are
Rotary
Linear
Rotary potentiometers
Dual Gang
Concentric POT
Servo POT
Linear potentiometers
Linear potentiometers are the same as the rotary
potentiometers but instead of moving in a circular direction
they move in a straight line. Linear potentiometers are
available in two pins as well as in 3 pins.
Motorized Fader
Multi-Turn slide
Capacitors
A capacitor is a two-terminal, electrical component that
stores electrical charge. Along with resistors and inductors,
they are one of the most fundamental passive components
we use. Common applications of capacitors are charge
storage, voltage spike reduction, and signal filtration.
1= 1+ 1+ 1 C C1 C2 C3
1 + 1 + 1=
= 0.5uF
1uF 1uF 1uF
The total capacitance in this combination is 0.5 microfarad.
In parallel combination, the
In a parallel combination of
capacitors, the capacitance is
added.
C = C1 +C2 +C3
= 1uF + 1uF +1uF
= 3uF
Types of capacitors
Working
Reversed biased
Laser diode
Avalanche diode
Zener diode
Schottky diode
Photodiode
LEDs are like tiny lightbulbs but they require a lot less power
than filament bulbs which is 0.25 watts for LEDs and 2.5
Watts for filament bulbs at 5V.
Working principle:
3mm LEDs are not as bright but are smaller, and are good
for the indication (like an LED that tells you something is on).
They're not as good for illumination because they have a
smaller area that is lit.
Soft Ferrite
Hard Ferrite
Transistors
Transistors are one of the most exciting inventions in modern
technology. They're tiny yet powerful switches that allow
electrical signals to be manipulated in a variety of ways,
whether through amplification or logic processing.
Transistors work by allowing current to flow between two
contacts when an input voltage is applied, allowing a wide
range of targeted applications from communication devices
and amplifiers, to digital logic circuits and much more. Even
though they may look simple but today's most advanced
transistors contain myriad buried structures within their tiny
footprint for efficient operation in high-speed scenarios. It's
no
wonder why the invention of transistors revolutionized the
way we think about computing and communication!
Material Transistors are made from pure sometimes other
semiconductor materials manufacturing.
silicon or germanium but
Breadboard
Two pins on one side A and A’ are connected and the same
with the opposite pins B and B’.
Circuit
LED in Parallel and Series combination
Led in parallel
LED in series
In series combination of LEDs voltage is divided and current
remains the and the LEDs are connected like a chain.
Transistor as a switch
The most common type of transistor is the BC547 which
came in two type NPN and PNP.
Collector-Emitter Voltage 45 v
Emitter-Base Voltage 6 v
Collector Current 0.01 amps
These are maximum voltage and current values of BC547
and if the voltage and current reaches above that limit the
transistor will be damaged.
Circuit
Circuit
Circuit
Working
When the glass is empty all the LEDs will be OFF. When the
water level reaches the green wire, the green LED will light
up because the current will start flowing from red to the
green wire. When more water is added the water level rises
and the LEDs will continue to light up in a sequence.
The number of
components in this IC are
Transistors=25
Diodes= 2
Resistors=15
The transistors in this IC are in the size of nanometers which
is smaller than the grain of rice.
Image from the Wikipedia --NXP-7555
The first pin of any IC can be identified by the circle which
will be on the left side and it goes from top to bottom and
from left to right
LED blinking using 555
Circuit diagram:
Working
AND Gate
In first gate the both inputs are zero so the output is also
zero.
In first gate the both inputs are zero so the output is also
zero.
A Logic NOT gate is a type of digital logic gate that has one
input and one output. It is typically symbolized by a triangle
with a line crossing through it. It performs a logical "not"
operation, which means that if the input is true (1), the
output is false (0). If the input is false (0), the output is true
(1).
INPUT OUTPUT 0 1 1 0
In the first NOT gate, when the input is 0 the output is 1 and
in the second NOT gate it does the opposite.
When battery is connected to the circuit the LED will light up
and when the push button is pressed it will short the positive
and negative terminal of the battery and LED will turn OFF
NAND Gate
The NAND gate is the opposite of AND gate and when the
both inputs are 0 the output will be 1 because of the NOT
gate at the output.
NOR Gate
XOR Gate
A XOR gate (Exclusive OR gate) is a digital logic gate that
produces an output that is true (1) if and only if exactly one
of its inputs is true (1). The output of a XOR gate is false (0)
if both inputs are the same. The symbol for a XOR gate is a
standard OR symbol with an additional line crossing it. The
XOR gate is also known as an "exclusive OR" gate. It can be
used to compare two bits and see if they are different.
Additionally, it can be used to create a parity bit in a circuit.
There are two AND gates that makes the output 0 when the
both inputs are also 0.
When the input A is 1 the second NOT gate and the input A
makes the first AND gate to turn ON. At the end OR gate is
used which outputs 1 if one of the inputs is 1.
XNOR Gate
2.
3.
4.
Logic gates using transistors
Logic gates ICs are also available in the market but logic
gates can be made with the help BJT transistors which
require transistors, resistors, and push buttons.
AND gate
OR gate
A half adder is a simple adder circuit that can add two binary
digits (bits) and produce a sum (S) and a carry (C) output.
The half adder has two inputs (A and B) and two outputs (S
and C). The sum output (S) is the XOR of the inputs (A and
B), and the carry output (C) is the AND of the inputs (A and
B). Half adder is used to add two single digits and if the sum
of these binary digits is a three-digit number it becomes a
carry.
and a carry of 1.
0+0=0
0+1=1
1+0=0
1 + 1 = 10
LogicGates ICwihcode writtenontopofthem
CD4001 for NOR Gate
This generates SUM and C-OUT is true only when either two
of three inputs are HIGH, then the C-OUT will be HIGH. So,
we can implement a full adder circuit with the help of two
half adder circuits. Initially, the half adder will be used to add
A and B to produce a partial Sum and a second-half adder
logic can be used to add C-IN to the Sum produced by the
first half adder to get the final S output.
In the first four inputs we add 1 and 4 and in the last four
inputs we added 2. The total sum of these three numbers are
1 + 4 + 2 = 7.
The
be
programmed before doing any kind
of task.
HIGH);:100030000C946E000C946E000C946delay(1000);
E000C946E0088digitalWrite(LED_BUILTIN, LOW);
:100040000C9413010C946E000C9delay(1000);
}
The leftimage shows thesimple code writteninC++and the
image onthe right shows the hexadecimalformofthatcode.
Arduino Nano
Width = 1.8 cm Length = 4.5cm
Arduino UNO
Width = 5.34 cm Length = 6.86 cm
Arduino
software:
program Arduino boards
The software used to is the Arduino IDE (integrated
Development Board)
What is an IDE…?
An IDE is basically any kind of software application that helps
people to write codes.
i d i d
First Arduino code
After uploading this code, the LED will continue blinking until
the power is removed or the reset button is pressed.
The circuit for the blinking LED will look like this with the
330-ohm resistor connected with the long leg of the LED and
the other leg of the LED is connected to GND or ground.
LED
brightness control using variable PWM
The circuit uses the ADC module of the Arduino board which
receives data from the potentiometer and changes the
output signal. There are 6 ADC pins which are labeled A0, A1,
A2, A3, A4, and A5 and the 6 other pins that can create a
PWM signal are 2, 3, 5, 9, 10, and 11.
Let’s start with the working of Analog to Digital Converter
(ADC). It converts the analog signal into a digital signal
which can be understood by a microcontroller. Almost all
sensors like temperature, humidity, and smoke send analog
signals to a microcontroller which is then converted into a
digital signal to get data. ADC converts analog values like 1,
10 220, 150, and 100 into 1011010.
Connections of LED and a Potentiometer are defined at the
start.
In the main loop section, the ADC will read the value from
the potentiometer with the help of theanalogRead() function.
At first, the ADC value is zero but when we rotate the
potentiometer the value will change. After that, we will use
the map function in which we set the minimum and
maximum value of the ADC and the minimum and maximum
value of the PWM module. The map function compares the
values and changed the value of the PWM when there is the
change in the ADC value.
A schematic is essentially a graphical representation of an
electrical circuit that uses symbols to identify each
component and how they are connected together.
Schematics can provide a great deal of information about
your device or system, including input/output relationships,
power consumption, and expected performance levels. With
some practice, even non-technical types can become
familiar with reading these diagrams - it's almost like
learning a new language. So why not get out those wire
strippers and test probes and start exploring this exciting
realm?
Reading schematics
Transistor as a switch:
Decoupling capacitor
100