Internship Report
Internship Report
Training Program
1
INDEX
Study and Practical Analysis
1) Computer Basics
2) Data Representations
3) Data Conversions And Display Systems
4) Soldering Procedure
5) Basic Electronics
6) AC Distribution
7) Electronic Components (Resistors-Types, Applications)
8) Capacitors-Types, Applications
9) Inductors-Types, Applications
10) Semiconductors-Types, Applications
11) Digital Electronics
12) Power Supplies
13) Op Amps- Applications
14) Opto Couplers- Applications
15) Comparators- Applications
16) Sensors and Working Principle and Applications
17) Micro Controllers (ATMEGA328P)
Analog Digital
ANALOG COMPUTER:
Analog computer is one which is having one scale and pointer .The pointer is always
moving on the scale [All Electromechanical systems]. Analog systems are also called as
continuous systems.
Examples: Thermometer, Analog multi meter, Ammeter, Energy meter etc.
DIGITAL COMPUTER:
Digital computer is one in which the entire process is carried out through binary digits.
There are 2 types of digital computers.
1. Special purpose digital computer
2. General purpose digital computer
• Special purpose digital computer: It is a one designed for a specific purpose, we can’t alter
its functioning.
E.g. Calculator, weighing machines etc.
• General purpose digital computer: It is for generalized applications. Any type of special
purpose application can be designed by a general purpose computer.
E.g. personal computer.
NUMBER SYSTEM:
The following number systems are widely used. They are,
Binary [0 and 1]
Octal [0 to 7]
Decimal [0 to 9]
Hexa decimal [0 to F]
Decimal:
The decimal system contains ten unique symbols from 0 to 9. Since counting in decimal involves
10 symbols, we say that its base or radix is 10. Each symbol in the number is called digit.
3
Binary:
The binary number system is a positional weighted system. The base or radix of this number
system is 2. The symbols used are 0 and 1. A binary number consists of a sequence of bits, each
of which is either ‘0’ or ‘1’.
Advantages:
• System data recognisation
• Simple data transmission
• Easy data storage
So people are widely using binary number system.
Disadvantages:
• It requires more length.
Octal:
The octal number system was extensively used by early mini computers. It is also a
positional weighted system. Its base or radix is 8. It has 8 independent symbols from 0 to 7.
Since its base 8=23, every 3 bit group of binary can be represented by an octal digit.
Hexa decimal:
Hexa decimal is the advanced system of binary. The Hexa decimal number system is the
professional weighted system. The base or radix of this number system is 16, that means, it has
16 symbols used from 0 to 9 and A to F. In this A to F represents the decimal digits from 10 to 15.
DATA
4 bits =1 Nibble
8 bits = 1 Byte
1024bytes = 1 Kilo byte
1024 Kilobytes = 1 Mega byte
1024 Megabyte = 1 Giga byte
1024 Gigabyte = 1 Tetra byte
REPRESENTAION OF VOICE:
In case of analog systems sound energy is converted into magnetic energy through
microphone, amplifier and a coil at the transmission side. At the receiver end the reverse operation
is performed.
C
C
Magnetic O Amplifier Loud Speaker
MIC Amplifier O
I
I Energy L
L
In digital systems the sound energy is converted into digital form through microphone,
amplifier, ADC at the transmission end. At the receiver end, the reverse operation i.e. the digital
data converted into sound energy through DAC, amplifier and loudspeaker. Compared to analog
systems, the losses in Digital systems are less.
DATA CONVERSIONS:
Binary to Decimal and Decimal to Binary
Octal to Decimal and Decimal to Octal
Hexadecimal to decimal and decimal to Hexadecimal
Octal to Binary and Binary to Octal
Hexadecimal to binary and binary to Hexadecimal
7 Segment code:
PORT
5
14Segment display:
SOLDERING PROCEDURE
Tools required:
Soldering iron
Lead
Flux
PCB
Petrol thinner or white petrol cleaning material.
SOLDERING PROCEDURE:
• Soldering iron tip must be very cleaned by using file.
• Apply lead on the tip.
• Apply little bit flux at solder area.
• Put soldering iron beside the point at the rate of 45degrees.
• Wait for few seconds.
• Remove the soldering iron and wait for some time.
NOTE:
The soldering lead and PCB surface must be very cleaned.
DE SOLDERING PROCEDURE:
• De soldering wick (shield wire with flux).
• De soldering pump.
6
PCB TYPES:
• Single sided PCB.
• Double sided PCB.
• PTH (pin through hole) PCB.
• Multi layer.
Basic electronics
Voltage:
The potential difference between the two pints is called voltage. It is denoted by “V” and their units
are “volts”.
Current:
The flow of electrons in one direction along any path or around any circuit is called electric current. It
is denoted by “I” and its units are “Ampere”.
Power:
Power is nothing but a product of voltage and current. It is the ratio of electric work done in the
electric circuit for unit time.
Electric power = Electric work done / Time taken
Power = VI
Units for power are “watts”.
DC Voltage:
The voltage which remains constant in direction w.r.t time and may or may not have constant
magnitude is knows as direct (or) steady voltage.
E.g.: Battery, generator, solar panel system.
AC voltage:
The voltage which changes in magnitude as well as direction wart time is known as Alternative
voltage”.
7
Materials:
The electrical properties of different materials can be explained in terms of the electrons having
energies in the valence band and conduction band, because the electrons lying in the lower energy bands
which are normally filled, play no role in the conduction process.
Insulators:
Insulators are the solid materials which are bad conductors of electricity. E.g.: wood, plastic, rubber.
In terms of energy bands, Insulators
• Have full valance band
• Have an empty conduction band
• Have a wide forbidden energy gaps
So in case of insulators a very large amount of energy must be supplied to electrons to cross from the
valance band to the conduction band.
Conductors:
Conductors are the solid materials which are good conductors of electricity. In terms of energy
bands conductors have,
• No forbidden energy gap between valence band and conduction band.
E.g.: Copper, Aluminum, Gold.
Semi Conductors:
Semi conductors are the solid materials which are neither good conductors nor bad conductors of
electricity.
E.g.: Silicon, Germanium.
So in case of Semiconductors a very little amount of energy is sufficient to move electrons from valence
band to conduction band. This energy is available at room temperature itself.
A.C DISTRIBUTION:
115W 920W
FUSE
Current Coil FUSE
Ph 4A
1
2
Mains Switch
Nt
6.5A 6A 4A
FUSE
460W
The above diagram shows the single phase A.C Distribution which
consists of a potential coil and current coil to which the mains and fuses are connected. The loads
are connected at the output. If the mains are at ON state, the disc will rotate due to the torque
produced by the two coils [Pc & Cc]. If the mains are at OFF state, the disc will not rotate.
8
EARTHING:
0V 230V
N P
230V
Earthing refers to connecting an electrical conductor to earth which is assumed to have zero
electric potential.
(OR)
Earthing means connecting the neutral point of supply system or the non-current carrying metal
part s used in electrical distribution system to the general mass of the earth by a wire of negligible
resistance in such a manner that at all times an electrical discharge of electrical energy takes
place without danger. This brings the body of equipment to zero potential and thus will avoid the
shock to the operator
IMPORTANCE OF EARTHING:
It protects us from electric shocks.
It reduces EMI [Electro- magnetic induction].
It reduces RFI [Radio frequency interference.
1 2
3
4
5
C
FIXED RESISTOR VARIABLE RESISTOR TAPPED RESISTOR
9
Features of resistors:
These are two terminal, passive bilateral elements.
The effect of resistance is same for both AC and DC.
Use of resistors:
To limit current.
To establish proper values of currents in circuits.
To provide voltage drop.
To provide load.
Specification of resistors:
1. Ohmic value: It represents value of the resistance.
2. Tolerance : It represents percentage of variation in the ohmic value.
3. Wattage : It represents power handling capacity of a resistor.
Ex: 4K7J2W
Equivalent resistance: 4.7kΩ, +/-5%
2. SMR coding:
It is a surface mounted resistor coding system which is useful to know the value of the
Resistor. In this system the tolerance and wattage is printed on bulk pack.
EX:
103
3
10 *10 Ohms = 10KΩ
10
3. THREE BAND COLOUR CODE:
It is a system is used to know the value of resistance. In this system the resistor
Contains 3 colour bands on its body.
Ex:
1). 270KΩ, +/- 5%
Red violet yellow gold practical value: 268KΩ, ± 5%
2) 4.7KΩ, +/- 5%
Yellow violet red gold practical value:4.39KΩ, ± 5%
3) 39Ω, +/-1%
Orange white black brown practical value: 35Ω, ± 5%
1STband-first digit
2ndband-second digit
3rd band-third digit
4th band-multiplication factor
5th band-tolerance
Black 0 100=1
Brown 1 101=10 +/- 1%
Red 2 102 +/- 2%
Orange 3 103
Yellow 4 104
Green 5 105
Blue 6 106
Violet 7 107
Grey 8 108
White 9 109
Gold - 0.1 +/- 5%
Silver - 0.01 +/- 10%
No colour - - +/- 20%
Pink colour - - High stability
11
EX: 1. 275 K Ω ± 1% Practical value:272KΩ ± 1%
Red Violet Green Orange Brown
3. 28.5 Ω ± 1%
Red grey green gold brown
Classification of resistors:
Basically resistors are divided into two types namely fixed resistors and variable
resistors. These two types are further classified into different types are shown below
CAPACITORS
CAPACITOR:
A Capacitor or condenser is a two terminal passive component which
Has the ability to store electric charge and it opposes instantaneous change of voltage in the circuit.
Capacitor blocks the passage of direct current (D.C) and allows the alternating current (A.C) through it. A
capacitor essentially consists of two conducting surfaces separated by an insulating medium called
dielectric.
12
Capacitance is the property exhibited by a capacitor and may be defined as, “The ability of a capacitor to
store electric charge per unit potential difference”. It is measured in Farads. But, in real world, all the
generalized usage conditions demands much smaller units measured in milli, micro, nano, pico farads.
Types of capacitors:
Capacitors can be classified into various types based on the di-electric material used in them. They are:
• Mica capacitors
• ceramic capacitors
• paper capacitors
• Electrolytic capacitors
• Air capacitors
• Aluminum capacitors
• Tantalum Electrolytic capacitors
• Variable capacitors
• Tuning capacitors
• Trimming capacitors
Specification of Capacitor:
Capacitance value
Tolerance
Dielectric constant
Dielectric strength
Power factor
Temperature coefficient
Voltage rating (Withstanding voltage)
Leakage resistance/Leakage current
C=εA/d [ε=ε0εr]
C=ε0εrA/d
Where ε0 = absolute permittivity of air =8.8540X10-12F/M
εr = relative permittivity of medium
Variable capacitors:
The capacitors whose capacitance value can be varied are known as variable capacitors.
These are of two types. They are
1. Tuning capacitors
2. Trimming capacitors (or) untunned capacitors
13
Losses in capacitors:
There are mainly 3 types of losses that will occur in a capacitor. They are
Leakage resistance
Absorption losses
Power factor
Di-electric losses
Combination of Capacitors:
Capacitors may be connected in series or in parallel in order to decrease or increase the total capacitance
value.
Capacitors in Series:
C1
1
C2
BATTERY
2
C3
C=1/C1+1/C2+1/C3
C1, C2, C3 = capacitance of three capacitors.
V1, V2, V3 = voltage drops across C1, C2, and C3
V = applied voltage
In series combination, charge (Q) on all capacitors is same, but voltage drops are different.
V = V1 + V2 + V3
Q/C = Q/C1 + Q/C2 + Q/C3
Capacitors in parallel:
1
BATTERY C1 C2 C3
2
C = C1+C2+ C3
14
INDUCTORS
INDUCTORS:
Inductor is an electro magnetic energy concentrator formed by wounding an insulated
Copper wire on the core material. The inductor has got a property called as inductance. Inductance is
measured in Henry’s. The symbol for an inductor is
INDUCTOR
.The inductance value of an inductor depends on number of turn’s core material etc. There is no
frequency for D.C. voltage.
The inductor is having a parameter called as inductive reactance (XL)
XL=2╥fL
Z=√R2+(XL)2
Where,
Z=Impedance
R=Resistance of coil
XL=Inductive reactance
Properties of inductors:
The inductor opposes A.C. and allows D.C.
At the time ( t=0sec) the inductor acts as a open circuit
At the time (t=1sec) the inductor acts as a close circuit
The current limiting factors of inductors are
Frequency
Inductance value
D.C. resistance
In D.C I=V/R →
Applications of Inductors:-
Inductors are used by so many electronic devices. They are
Chokes
Line filters
Electro mechanical relays
Motors
Generators
Transformers
15
Chokes:
Choke is an AC voltage dropper. It is used in tube lights etc.
Line filters:
Line filters determine high frequency noise from AC 230V. The symbol
Of a line filter is
1
LINE FILTER
4
Relays:
Relay is an electrically operated switch. Relay can be defined as “a device opens or closes
an auxiliary circuit under some predetermined condition in the main circuit”. The object of relay is to act as
a sort of electric magnifier i.e., it enables a comparatively weak current to bring into operation a much
stronger current.
5
3
4
1
2
RELAY SPDT
Classification of Relays:
Relay can be classified according to the principle of operation, polarization and application as
Based on the principle of operation
Electro thermal relays
Electromagnetic relays
Solid state relays
Hybrid relays (combination of both (b) and (c))
Based on the polarization
Polarized relays Ex: Telegraph relays
Non polarized relays Ex: Telephone relays
Based on the application
Commercial relays
Industrial relays
Military relays
Communication relays
Railways relays
Specifications of relays:
Type of relay (NO, NC, CO)
Coil operating Voltage
Coil Resistance
Contact current
Eg: 1CO, 12V, 400ohms, 5A
16
Applications of relays:
Circuit selection and switching in various system
Automatic control process in industrial plants
Semi-automatic processes in industrial plants
Mathematical functions in computers
Traffic control signals
Temperature controllers
Electric motor switches
Automatic stabilizers
Televisions
Industries
Contact materials:
Low contact resistance
High electrical and thermal conductivity
High melting point
Long operating life and
Should not oxidize in atmosphere
Types of contacts:
Make contact (or) normally open contact (abbreviated as N/O): It close when the relay gets
energized.
Break contact (or) normally closed contact (abbreviated as N/C): It gets broken when the relay is
energized.
Change-over contact: In this, the movable contact which while changing over its position by the
operation of the relay, breaks with one contact and makes with the other.
Make-before-break contact: In this type, when the relay is operated, one normally broken contact is
first made when it is operated, then only a second normally made contact is broken.
Transformers:
A transformer is a static device (or stationary) piece of apparatus by means of which electrical power in one
circuit is transformed in to electrical power of the save frequency in another circuit. It can rise or lower the
voltage in a circuit but with a corresponding decrease or increase in current. The physical bias of a
transformer is “Mutual Induction” between two circuits linked by a common magnetic flux.
The first coil, in which electric energy is fed from the A.C supply mains, is called “primary winding”
and the other from which energy is drawn out, is called “secondary winding”.
In brief, a transformer is a device that transformer electrical power from one circuit to another
It does so without a change of frequency
It accomplish this by electromagnetic induction
Where the two electronic circuits are in mutual inductance to each other.
1 5
4 8
TRANSFORMER
Types of Transformers:
Transformer is a device converts AC to AC in following manner
Step down transformer
Step up transformer
Isolation transformer
Auto transformer
Power transformer
17
Step down transformer:
Transformer is a linear device. In this type of transformer the secondary voltage always less than the
primary voltage.
8
4
5 1
VS < VP
NS < NP
Where, VS = Secondary voltage
VP = Primary voltage
NS = No of turns of secondary
Np = No of turns of primary
Step up transformer:
In this type the secondary voltage is always greater than the primary voltage.
1 5
4
8
Step Up TRANSFORMER
VS > VP
NS > NP
Isolation transformer:
It is a 1: 1 transformer provides isolation between primary and secondary
1 5
4 8
TRANSFORMER
VS = VP
NS = NP
If voltage reduces at the output then it is step down transformer.
If voltage increases at the output then it is step up transformer.
If input voltage is equal to output voltage then it is isolation transformer
1 5
4 8
TRANSFORMER
230v, 12v, 1Amp
18
Auto transformer:
It is a transformer with one winding part only.
Variac
2
5
3
4
1
It is a transformer with one winding part only. common to both primary and secondary, in this
transformer the primary and secondary are not electrically isolated from each other as is the case with a
two winding transformer. Because of one winding it uses less copper and hence is cheaper. It is used
where transformation ratio differs little from unity.
Losses in a transformer:
i) Core (or) Iron loss:
It includes both hysterisis loss and eddy Current loss. The core loss is practically the
same at all loads.
ii) Copper loss:
This loss is due to ohmic resistance of the transformer windings.
Current Relations of transformers:
Vp/Vs = Is/Ip = Np/Ns
If the no. of turns increases, it results in increase in the coil resistance which makes current decrement.
Transformers types:
Single tapped transformer:
It is an ordinary transformer. In this type of transformer it contains two Output terminals.
1 5
4 8
TRANSFORMER
Centre Tap
8 1
MultipleTap
19
Isolated tapped transformer:
In this type of transformer the output is same as the applied voltage.It is used for provide between the input
and output.
1 8
3
9
10
4
5
7 11
Isolated Tap
Current Transformer:
It is setup transformer. It used measure the high currents. The primary windings of the current
transformer must have 2 or 3 windings. In this in terms of voltage we calculate the current. In this we
increase the current depending on the number of secondary windings.
Voltage Transformer:
It is a step down transformer, used to measure high voltages. In this transformer we decrease the
voltage depending on the number of secondary windings.
SEMICONDUCTORS
SEMICONDUCTORS:
Semiconductors are solid materials whose electrical properties lie in between conductors and
insulators. All semiconductors are negative temperature coefficient materials i.e resistance of semi
conductors decreases with increase in temperature and vice versa. These are half filled valency electrons.
Example: Silicon, Germanium
The process of adding impurities to the pure semi conductors is called “Doping”. Depending on the
process of doping, semi conductors are classified into two types.
1. Intrinsic semiconductors
2. Extrinsic semiconductors
Intrinsic semiconductors:
A Semiconductor in its pure form is called intrinsic semiconductor. In intrinsic semi
conductor, equal no. of electrons and holes will be available at room temperature. So current conduction
takes place by both electrons and holes equally. It has poor conductivity because of less no. of free charge
carriers.
Eg: pure silicon, pure germanium.
Si
Extrinsic semiconductors:
Impure or doped semi conductors are called as extrinsic semiconductors. These have more
conductivity because of more no. of free charge carriers. The current conduction of these semiconductors
depends upon level of impurity or amount of doping. The impurities may be pentavalent or trivalent atoms.
20
The atoms whose valence electrons are five are called as “Pentavalent atoms”. These are also called as
donor impurities because they donate electrons to the conduction band. The atoms whose valence
electrons are three are called as trivalent atoms. These are also called as acceptor impurities because they
accept electrons from conduction band.
P-TYPE SEMICONDUCTORS:
These are formed by adding trivalent impurities such as boron (5) to pure
semiconductor like silicon (14). These are acceptor materials.
Al
FORMATION OF PN JUNCTION:
When P and N type materials are placed together then the free electron in n-
type material is combine with the hole i.e free electrons are diffuse from N region to P- region to N-region.
Then positive charge developed in N-type & negative charge in the p-type. At the junction potential barrier
is formed. The barrier voltage is 0.3v for Ge and 0.7v for Si .The barrier potential opposes the flow of
majority charge carriers from one side to another side and it assist the flow of minority charge carriers in
crossing the P-N junction. The barrier potential can be decreased or increased by applying external
voltage.
1 2
PN JUNCTION DIODE
21
P-N JUNCTION WITH FORWARD BIAS:
If the positive voltage is connected to the p-side or anode and
negative voltage is connected to the n-side or cathode then the P-N junction is said to be forward biased. In
forward bias holes in the p side and electrons in the N-side are compelled to move towards the junction. As
a result the width of the depletion region is reduced. With the increase in external voltage the barrier
voltage decreases smaller and smaller and at one particular external voltage the barrier potential totally
disappears. Then the junction offers very low resistance.
PN JUNCTION DIODE FORWARD BIAS
1 2
1 2
BATTERY
1 2
BATTERY
With increase in external voltage the Barrier potential increases. The junction offers very high resistance
(Almost infinite) ¤t flow is low.Very little amount of current (In the order of Nano & Micro ampere
flows which can be treated as zero) due to minority carriers.
DIODE SPECIFICATIONS:
Maximum forward current (IF max): It is the maximum forward current through the diode when it is
conducting.
Peak inverse voltage (PIV): This is the maximum reverse voltage that a diode can withstand
without being destroyed.
Maximum forward voltage drop (VF): It gives the maximum forward voltage drop for a given
forward current.
Recovery time: It is the time taken by a diode to change its state from forward bias to reverse and
vice versa.
Applications:
Used in rectifier circuits for converting A.C current into D.C current.
Used as signal diodes in Modulation & Demodulation circuits.
Used as regulators.
Used in Radio &T.V receivers in tuning circuits.
Used in Digital logic gates.
Light emitting diodes used as visual displays
22
OTHER DIODES
Zener diode: Zener diode is the heavily doped silicon or germanium PN junction diode . It is always
operated in the breakdown region. By varying the doping level it is possible to produce Zener diodes with
breakdown voltages from about 2v to 200v. Zener diode is heavily doped PN junction diode which is
operated in the reverse bias only. The operation depends on the Zener breakdown voltage. The breakdown
voltage is based on the doping concentration. If the doped concentration increases Zener breakdown
voltage decreases & vice versa.
If the Zener diode is operated in the forward bias, the characteristics are same as that of a rectifier
diode.
Zener diode is always operated in reverse bias mode.
Zener breakdown voltage is defined as the reverse voltage at which current increases suddenly&
sharply.
After breakdown takes place the voltage across Zener diode remains constant at Vz.
The main application of Zener diode is “VOLTAGE REGULATER”. The diode regulates the o/p voltage
according to the load.
ZENER DIODE
SPECIFICATIONS :
Breakdown voltage.
Wattage
Ex: 5.6v (ZBV);1W(Max. Power)
LIGHT EMITTING DIODE: It is a forward bias operated diode. The energy is required to generate an
electron hole pair, Due to recombination of this electrons & holes an energy is liberated from its junction in
the form of light. Light emitting device (LED) converts electrical energy into optical energy.
LED
23
IR LED: It is forward bias operated diode used to generate infrared rays. This type of LED’s are used in
remote control systems, light vision cameras. These are manufacture with Gallium Arsenide materials.
VCC
RESISTOR
IR LED
Laser Diode: It is forward operated diode used to generate Laser light. This type of are most widely used
in medical applications.
VCC
RESISTOR
LASER DIODE
Photo Diode: A Photo diode is a two terminal PN junction device which operates in the reverse bias on
“PHOTO CONDUCTIVE EFFECT”. When there is no light applied current in the diode is called Dark
current. As light intensity increases the reverse current also increases. Hence the diode current is directly
proportional to reverse bias current & light intensity.
VCC
RESISTOR
2
PHOTODIODE
1
Applications:
Light operated switches.
Light detector.
High speed counting & switching.
Encoders.
Decoders.
Alarm circuits.
TRANSISTORS:
Transistor is a three layers, two junction & three terminal semiconductor device. A transistor may be
regarded as two back to back PN junctions in a single piece of semiconductor. The two junctions give rise
to three regions. The middle region is called Base & the outer two regions are called as Emitter & Collector.
The PN junction b/w Emitter & Base is called Emitter Base region (or) Emitter region. The PN junction b/w
collector & base is called Collector region (or) Collector Base region. Emitter is one of the transistors which
24
emit majority charge carriers into base region. Physical area of emitter is < collector & > base. Doping
concentration is more than collector & base. Base is the middle region of the transistor which is very thin &
lightly doped as compared to either emitter or collector. Collector is third region which collects the charge
carriers emitted by the electrons trough the base. Doping concentration of Collector > Base <
Emitter>Collector.
Collector region is made physically larger than emitter & base to dissipate much heat generated.
Transistor is a variable resistor whose resistance between emitter and collector lies between zero
and infinity. The value of this resistance is continuously changes with changes in base current.
If there is no base current, then the transistor offers infinity resistance b/w collector & emitter. This state is
known as “Cut off state” acts as open switch. If the base current goes on increasing the resistance b/w
collector & emitter is decreases from infinity to zero. Then this state is known as ” Active state ”. In this state
transistor acts as an “amplifier”. If there is a maximum base current the R value is zero. It is known as
“Saturation state” and the transistor acts as “Closed Switch”. Depending on the type of material added the
transistors are classified into two types.
1) NPN transistor
2) PNP transistor
For NPN transistor arrow points from base to emitter mean’s that the base is at positive potential with
respect to emitter.
1 1
2 2 NPN
3 PNP 3
In transistor the emitter current IE is equal to sum of base current IB and collector current Ic i.e.
IE=IB+IC.
Transistor Testing:
With respect to base collector, emitter forward bias test>>B-C, B-E=Forward bias.
With respect to base collector, emitter forward bias test>>B-C, B-E=Reverse bias.
Collector & Emitter forward bias (or) Reverse bias.
Transistor Specifications:
Maximum collector to emitter voltage (Vce max).
Maximum collector current (Ic max)
Maximum power dissipation (PDmax)
Transistor Applications:
Used as amplifiers. 4. Modulators.
Oscillators. 5. Relay drivers.
Mixers. 6. Switching circuits.
These are the applications of a Transistor.
DIGITAL ELECTRONICS
In digital electronics the total circuit operations are performed by using Logic Gates. In Logic
Gates the most widely used gates are NAND and NOR gates. These gates are called
UNIVERSAL GATES as these are used to implement any gate such as AND, OR & NOT.
AND GATE:
It is used as multiplier. The output of this gate is HIGH only when the two inputs are
at active high. The output is LOW when any one of the input is low.
OR GATE:
It is used as adder. The output of this gate is HIGH when any one of the input is at active
high. The output is LOW when two inputs are at active low.
NOT GATE:
It used as inverter. If the input is high, the output is LOW. If the input is low, the
output is HIGH.
EX-OR GATE:
It is also called as EXCLUSIVE OR gate. Output of this gate is = A`B+AB`
25
POWER SUPPLIES
HALF WAVE:
D1
1 2
1 5
Capacitor
4 8
0V-12V
FULLWAVE:
1 5 1 2
6
+
1N4007
AC230V
4 8 1 2
Capacitor
12V-0V-12V 1N4007
-
1. The above figure shows Full Wave Rectifier.
2. Full Wave Rectifier consists of Center tapped transformer, 1N4007diodes (2).
3. The input is applied to the primary windings of the transformer and two diodes connected in
series to the secondary.
4. During the positive half cycle of the AC input signal the diode D1 is forward biased and diode
D2 is reverse biased which results the Positive cycle is rectified.
5. During the Negative half cycle of the AC input signal the diode D2 is forward biased and diode
D1 is reverse biased which results the negative half cycle is rectified.
6. Hence the full wave rectifier rectifies full cycle.
BRIDGE RECTIFIER:
7805
1
1 3
1 5 VIN VOUT
T7
GND
2 - + 4
AC 230V
4 8 330uF/25V 160uF/16V
2
26
5. During the Positive half cycle of the A.C input signal, the diodes D1 and D3 are forward biased &
D2 and D4 are reverse biased, which results the positive half cycle rectification.
6. During the Negative half cycle of the A.C input signal, the diodes D2 and D4 are forward biased
& D1 and D3 are reverse biased, which results the negative half cycle rectification.
7. Hence Bridge Rectifier rectifies the full cycle of the A.C input signal.
8. The output of the rectifier is connected to 7805 Regulator.
9. In this 78 represents the positive voltage and 05 represents 5v output.
10. Hence we obtain 5v at the output of bridge rectifier.
Operational amplifier:
The above block diagram shows the basic operational amplifier simply called as Op-Amp. The first
stage of an Op-Amp differential amplifier has high input impedance and large gain. The second stage is
intermediate stage provides the additional gain to the output of differential amplifier. A level shifting circuit /
level translate circuit is placed between second and final stage to eliminate DC component without entering
in to the output stage. By eliminating DC level at the final stage. The output voltage is varying between the
‘0’ to reference voltage. Thus preventing any undesired DC current entering into load.
7
3
+
6
2
-
IC 741
4
The above figure shows the symbol of Op-Amp in which it has two inputs namely non inverting input
with positive sign and inverting input with negative sign. If the signal is given to inverting input the OP-Amp
is said to be Inverting amplifier. If the input is given to the non inverting input then the Op-Amp is said to be
Non-inverting amplifier.
The above figure shows the pin diagram of the Op-Amp (IC 741) which is an 8 pin DIP IC.
27
Functions of Op-Amp:
1. inverting amplifier
2. Non- inverting amplifier
3. Summer
4. Sub tractor
5. Multiplier
6. Voltage follower
7. Current follower
8. Integrator
9. Differentiator
10. Comparator.
VCC
1K
4
7
R
DIS 3
2 Q
10K 6 TR
THR 1K LED
5
CV
NE555
1500uF/25V 0.1uF
The astable multivibrator using IC 555 is shown above during the charging period the
transistor it is held open by the flipflop and the capacitor charges through the resistor Ra& Rb when the
voltage across the capacitor reaches the reference level of the upper comparator the comparator changes
the state of the flipflop and this turns on the transistor.
The capacitor discharges through resistor Rb until its voltage reaches the reference level of
the comparator. This comparator changes the state of the flip-flop again which turns off the transistor the
charging time of the capacitor is determined by
T1= C[RA+RB]
The capacitor discharges from 2/3 VCC forwards 0 V hence the discharge period of the
capacitor is determined by T2= (CRB log 0-2/3 VCC) / 0-1/3 VCC
T2= 0.7 RB C
Applications:
28
Mono Stable Multivibrator:
VCC
10K
4
2
R
TR 3
7 Q
6 DIS
10K THR 1K LED
VCC 5
CV
NE555
47-^- 1500uF/25V 0.1uF
10uF/25V
3
2
1
TSOP 1738
Mono stable multivibrator using IC 555 is shown above. In the absence of trigger
input the timing capacitor C is held in the discharged state. In this state the output is low. If the trigger
voltage is above the threshold level then the state of the circuit may change. (VT>VTH) when the negative
going trigger pulse is applied at trigger terminal and if it is greater than 1/3 VCC then the flipflop will set and
the transistor will cutoff. Causing discharge capacitor starts charging exponentially it is given by,
V=VCC (1-e-t/RC)
When the voltage at the threshold terminal is greater than 2/3 VCC the flip flop will
reset which makes transistor T1 to ON. Causing discharge of the capacitor C. the trigger pulse width must
be less than the timing signal for proper operation of the timer. The mono stable timing period can be varied
by a voltage applied to the control terminal and is given by,
T=1.1 RC
Applications:
1. It produces stretched rectangular wave hence is used in timing circuits and control circuits.
2. It is used in auto cut voltage stabilizer.
Opto-coupler:
330-^- 10K
2
Vout
LED PHOTODIODE
1
29
Principle:
An opto-coupler is a solid state component which light emitter (led) the light path and the light
detector are contained in a light tight encapsulation. The photo detector may be photo diode, photo
transistor or a photo thermistor.
Working:
When current flows in the diode the emitted light is directed to the photo transistor and causes
current flow in transistor since the coupling is optical. There is a high degree of isolation. Typically the
transistor current is about 60% of the led input current
The Opto isolator provides complete isolation between the i/p & o/p signals. This feature
allows it to be used as an interface between high voltage and low voltage systems.
Applications:
1. The above fig(a) shows the pin diagram of the LM393 comparator
2. This diagram comparator internally consists of two comparators
3. The main application of the LM393 comparator is, it compares the input voltage and gives the
output as active high or active low
10K
VCC
VCC
4
10K
3
V+
+
3.3K 1
OUT
2
V-
- LED
LM393
11
1
4.7K
t
2
30
Working:
VCC
10K
VCC
VCC
4
10K
3
V+
+
3.3K 1
OUT
2
V-
- LED
LM393
11
1
4.7K
t
2
Working:
31
SENSORS:-A sensor is a device that measures physical input from its environment and
converts it into data that can be interpreted by either a human or a machine. Most sensors
are electronic (the data is converted into electronic data), but some are more simple, such as
a glass thermometer, which presents visual data.
ALCOHOL Sensor:- An alcohol sensor detects the attentiveness of alcohol gas in the
air and an analog voltage is an output reading. The sensor can activate at temperatures
ranging from -10
10 to 50° C with a power supply is less than 150 Ma to 5V. The sensing range
is from 0.04 mg/L to 4 mg/L, which is su
suitable for breathalyzers.
2. IR Sensors
An infrared (IR) sensor is an electronic device that measures and detects infrared radiation in
its surrounding environment. Infrared radiation was acciden accidentally
tally discovered by an
astronomer named William Herchel in 1800. While measuring the temperature of each color
of light (separated by a prism), he noticed that the temperature just beyond the red light was
highest. IR is invisible to the human eye, as its wavelength is longer than that of visible light
(though it is still on the same electromagnetic spectrum). Anything that emits heat
(everything that has a temperature above around five degrees Kelvin)) gives off infrared
radiation.
32
IR sensor
Working of IR Sensor: Active infrared sensors work with radar technology and they both
emit and receive infrared radiation. This radiation hits the objects nearby and bounces back
to the receiver of the device. Through this technology, the sensor can not only detect
movement in an environment but also how far the object is from the device.
3: UV Sensors
These sensors measure the intensity or power of the incident ultraviolet radiation. This form
of electromagnetic radiation has wavelengths longer than x-rays but is still shorter than
visible radiation. An active material known as polycrystalline diamond is being used for
reliable ultraviolet sensing. UV sensors can discover the exposure of environment to
ultraviolet radiation.
Working
The UV sensor accepts one type of energy signal and transmits different type of energy
signals.To observe and record these output signals they are directed to an electrical meter. To
create graphs and reports, the output signals are transmitted to an analog-to-digital converter
(ADC), and then to a computer with software
When light strikes the photodiode, it energizes the electrons, which causes an electric
current. The electric current will be stronger in response to brighter light.
33
The electrical current can then be measured and transformed into a digital or analog output.
Application:
• Measures the portion of the UV spectrum which sunburns human skin
• Pharmacy
• Automobiles
• Robotics
4.Touch sensor
A touch sensor is a type of device that captures and records physical touch or embrace on a
device and/or object. It enables a device or object to detect touch or near proximity,
typically by a human user or operator.
Working :-
A touch sensor works like a switch, where when there's contact, touch, or pressure on the
surface of a touch sensor, it opens up an electrical circuit and allows currents to flow through it
Partially conductive materi
34
5. IR obstacle Sensor:- The Infrared Obstacle Avoidance Sensor has a pair of infrared
transmitting and receiving sensors. The infrared LED emits Infrared signals at certain
frequency and when an obstacle appears on the line of infrared light, it is reflected back by
the obstacle which is sensed bythe receiver.
Working :- The Infrared Obstacle Avoidance Sensor has a pair of infrared transmitting and
receiving sensors. The infrared LED emits Infrared signals at certain frequency and when an
obstacle appears on the line of infrared light, it is reflected back by the obstacle which is
sensed by the receiver.
Soil moisture sensors measure the volumetric water content in soil. Since the direct
gravimetric measurement of free soil moisture requires removing, drying, and weighing of a
sample, soil moisture sensors measure the volumetric water content indirectly by using some
other property of the soil, such as electrical resistance, dielectric constant, or interaction with
neutrons.
35
Working:
The Soil Moisture Sensor module is made up of two conductive plates that act as a probe and
together act as a variable resistor. When the sensor is inserted into the water, the resistance
will decrease, and you will get better conductivity between the plates. The above figure
shows the functional principle of the soil moisture sensor module.
1. Volumetric moisture sensors The first type of soil moisture sensors we are going to mention
is the volumetric sensor. ...
2. Tensiometer The only way for the soil to keep moisture is to keep the water in it. And that
can be done either by friction or tension. ...
3. Solid state sensors
Application:
7. Rain Sensor:
A sensor that is used to notice the water drops or rainfall is known as a rain sensor. This kind
of sensor works like a switch. This sensor includes two parts like sensing pad and a sensor
module. Whenever rain falls on the surface of a sensing pad then the sensor module reads the
data from the sensor pad to process and convert it into an analog or digital output. So the
output generated by this sensor is analog (AO) and digital (DO).
Rain sensor
Working:
The rain sensor working principle is pretty simple. The sensing pad includes a set of
uncovered copper traces which mutually work like a variable resistor or a potentiometer.
Here, the sensing pad resistance will be changed based on the amount of water falling on its
surface. So, here the resistance is inversely related to the amount of water.
36
When the water on the sensing pad is more, the conductivity is better & gives less resistance.
Similarly, when the water on the surface pad is less, the conductivity is poor & gives high
resistance. So the output of this sensor mainly depends on the resistance.
8. Smoke Sensor:
When creating our devices, we leave nothing to chance, which is why the carefully made
Smoke Sensor not only protects you and your loved ones, but also embodies an elegant and
stylish detail for any room. Quite impressive for such a small smoke sensor. Smoke sensor
are important home safety tools because they increase your chance of escaping from a house
fire. Properly functioning sensors give you an early warning that makes escape more likely,
but the unit is more than just an alarm.
Working:
Optical smoke sensor, also known as a photoelectronic smoke sensor, works best to detect
smoldering fires—especially those that begin with a long time of smoldering. That is why
sometimes, it is called a smoldering sensor as well. It sounds when the LED light inside the
alarm chamber is broken. It is similar to a door or window photoelectronic alarm where an
invisible beam of light passes through the sensors. They are not connected physically but the
alarm sounds when the beam is broken. Photoelectric smoke sensors: The basic detection
principle of optical sensors is the making or breaking of a circuit in the presence of smoke.
Smoke can affect the intensity of light beam passing through the air by obscuring or
scattering.
9. Turbidity Sensor: The Turbidity Sensor measures the turbidity of fresh-water or seawater
samples in NTU (Nephelometric Turbidity Units, the standard unit used by most water
collection agencies and organizations). Its small, sleek design and simple setup make it easy
to use at the collection site. A turbidity sensor is an analytical sensor that measures turbidity,
which is an optical characteristic that refers to the degree of clarity of a liquid.
37
Working: The sensor operates on the principle that when the light is passed through a
sample of water, the amount of light transmitted through the sample is dependent on the
amount of soil in the water. As the soil level increases, the amount of transmitted light
decreases.
Application:
• Washing machines,
• Dishwashers,
• industrial site control,
• environmental sewage collection
• Water quality monitoring using IoT
Flow Sensor :-
A flow sensor (more commonly referred to as a “flow meter”) is an electronic device that
measures or regulates the flow rate of liquids and gasses within pipes and tubes. Flow
sensors are generally connected to gauges to render their measurements, but they can also be
connected to computers and digital interfaces.
Working:-
Magnetic flow sensors operate on the principle that the movement of a conductor through a
magnetic field induces a voltage. They consist of a flow tube which generates the magnetic
field in the pipeline, and an electronic converter that measures induced voltage.
A flow sensor is a component that measures the flow of a fluid such as a gas or liquid. Flow
sensors utilize both mechanical and electrical subsystems to measure changes in the fluid's
physical attributes and calculate its flow. Measuring these physical attributes depends on the
fluid's physical attributes.
MICRO CONTROLLERS:
1. P-type
2. N- type
38
Step:-3 from this impure semiconductors
1. PN Junction Diodes
2. PNP, NPN Transistors
3. FETS, MOSFETS are designed
1. AND
2. OR
3. NOT
4. NAND
5. XOR
6. NOR
1. Flip flops
2. Decoders
3. Encounters
4. Multiplexers
1. Timers
2. Counters
3. Registers
4. Adders
5. Subtractors
6. Multiplexers
Step 7-: By using all the above timers, registers, counters, adders, subtractors we design
1. Micro processors
2. Micro controllers
39
The Fundamental Requirements of Micro Processor Based Design :
1.Micro Processor
2.Power Supply
3.Oscillator
5.BIOS
6.RAM
If 1hz is given then the operation done with 10,000 seconds because already it has 10,000
clock cycles and it uses one cycle a second and produces output at 10000 seconds
If 1khz is given then the operation done with 10 seconds because already it has 10,000 clock
cycles and it uses 1000 cycles a second and produces output at 10 seconds
10,000 1 hz 10000sec
BIOS :-
EE Prom: EEPROM is a type of non-volatile ROM that enables individual bytes of data to
be erased and reprogrammed. That is why EEPROM chips are known as byte erasable chips.
EEPROM is usually used to store small amounts of data in computing and other electronic
devices.
EE Prom :- EEPROM is a type of non-volatile ROM that enables individual bytes of data to
be erased and reprogrammed. That is why EEPROM chips are known as byte erasable
chips. EEPROM is usually used to store small amounts of data in computing and other
electronic devices.
PIN CONFIGURATION:-
43
Microprocessor reads the information from the BIOS & RAM is a temporary storage device
which store the temporary instructions that are going to be executed.
CONFIGURATION SUMMARY:-
SUMMARY:
Features ATMEGA328p
Pin count 28/32
Flash (bytes) 32k
SRAM (bytes) 2k
EEPROM(bytes) 1k
General purpose I/O lines 23
SPI 2
TWI 1
USART 1
ADC 10-bit 15ksps
ADC channels 8
8-bit timer/counter 2
16- bit timer/counter 1
BLOCK DIAGRAM:-
44
ALU – Arithmetic Logic Unit
The high-performance
performance AVR ALU operates in direct connection with all the 32 general
purpose working registers. Within a single clock cycle, arithmetic operations between
general purpose registers or between a register and an immediate are executed. The ALU
operations are divided into three main categories arithmetic, logical, and bit-functions.
bit Some
implementations of the architecture also provide a powerful multiplier supporting both
signed/unsigned multiplication and fractional format.
Status Register
The Status Register contains information about the result of the most recently executed
arithmetic instruction.
nstruction. This information can be used for altering program flow in order to
perform conditional operations. The Status Register is updated after all ALU op operations, as
specified in the Instruction Set Reference. This will in many cases remove the need for using
the dedicated compare instructions, resulting in faster and more compact code. The Status
Register is not automatically stored when entering an interrup
interruptt routine and restored when
returning from an interrupt. This must be handled by software.
Status Register
When addressing I/O Registers as data space using LD and ST instructions, the provided
offset must be used. When using the I/O specific commands IN an and OUT, the offset is
reduced by 0x20, resulting in an I/O address offset within0x00 - 0x3F.
Name: SREG
Offset: 0x5F
Reset: 0x00
Property:
45
Bit 5 – H: Half Carry Flag
The Half Carry Flag H indicates a Half Carry in some arithmetic operations. Half Carry Flag
is useful in BCD arithmetic.
Stack Pointer
The Stack is mainly used for storing temporary data, for storing local variables and for
storing return addresses after interrupts and subroutine calls. The Stack is implemented as
growing from higher to lower memory locations. The Stack Pointer Register always points to
the top of the Stack. The Stack Pointer points to the data SRAM Stack area where the
Subroutine and Interrupt Stacks are located. A Stack PUSH command will decrease the
Stack Pointer. The Stack in the data SRAM must be defined by the program before any
subroutine calls are executed or interrupts are enabled. Initial Stack Pointer value equals the
last address of the internal SRAM and the Stack Pointer must be set to point above start of
the SRAM. See the table for Stack Pointer details.
General Purpose Register File
The Register File is optimized for the AVR Enhanced RISC instruction set. In order to
achieve the
required performance and flexibility, the following input/output schemes are supported by
the Register
File:
• One 8-bit output operand and one 8-bit result input
• Two 8-bit output operands and one 8-bit result input
• Two 8-bit output operands and one 16-bit result input
• One 16-bit output operand and one 16-bit result input
SRAM Data Memory
The following figure shows how the device SRAM Memory is organized.
The device is a complex microcontroller with more peripheral units than can be supported
within the 64locations reserved in the Opcode for the IN and OUT instructions. For the
Extended I/O space from 0x60- 0xFF in SRAM, only the ST/STS/STD and LD/LDS/LDD
46
instructions can be used. The lower 2303 data memory locations address both the Register
File, the I/O memory, Extended I/O
memory, and the internal data SRAM. The first 32 locations address the Register File, the
next 64location the standard I/O memory, then 160 locations of Extended I/O memory, and
the next 2K locations address the internal data SRAM. The five different addressing modes
for the data memory cover:
• Direct
The direct addressing reaches the entire data space.
• Indirect with Displacement
The Indirect with Displacement mode reaches 63 address locations from the base address
given by the Y- or Z-register.
• Indirect
In the Register File, registers R26 to R31 feature the indirect addressing pointer registers.
• Indirect with Pre-decrement
The address registers X, Y, and Z are decremented.
• Indirect with Post-increment
The address registers X, Y, and Z are incremented.
The 32 general purpose working registers, 64 I/O Registers, 160 Extended I/O
Registers, and the 2Kbytes of internal data SRAM in the device are all accessible through
all these addressing modes.
EEPROM Data Memory
The ATmega328/P contains 1K bytes of data EEPROM memory. It is organized as a
separate data space, in which single bytes can be read and written. The EEPROM has an
endurance of at least100,000 write/erase cycles. The access between the EEPROM and the
CPU is described in the following, specifying the EEPROM Address Registers, the
EEPROM Data Register, and the EEPROM Control Register.
IRQ (Interrupt Request) :-It is used to control the traffic that microprocessor is going to
execute.
PIC -: Programmable Interrupt Controller
If an interrupt task occurs this PIC will execute the highest priority task and the interrupt task
is waited until the highest priority task executed after that interrupt task executed
PIT :-In computing and in embedded systems, a programmable interval timer (PIT) is a
counter that generates an output signal when it reaches a programmed count. The output
signal may trigger an interrupt.
UART :-universal asynchronous receiver transmitter
It will sends serial data out and it will rakes the serial data in
It is used for serial communications over a computer or peripheral device serial port. One or
more UART peripherals are commonly integrated in microcontroller chips. Specialized
UARTs are used for automobiles, smart cards and SIMs.
47
1. LED BLINKING / 10 TIMES BLINKING / INTENSITY CONTROL
#define LED 9
//**************************************
48
void setup()
pinMode (LED,OUTPUT);
//***************************************
void loop()
digitalWrite(LED,1);
delay(1000);
digitalWrite(LED,0);
delay(1000);
//****************************************
#define LED 9
int i=0;
//*****************************
void setup()
{
49
pinMode(LED,OUTPUT);
//****************************
void loop()
for(i=0;i<10;i++)
digitalWrite(LED,1);
delay(500);
digitalWrite(LED,0);
delay(500);
while(1);
//********************************
#define LED 9
//**************************************
void setup()
pinMode(LED,OUTPUT);
//***************************************
50
void loop()
analogWrite(LED,0);
delay(3000);
analogWrite(LED,1);
delay(3000);
analogWrite(LED,50);
delay(3000);
analogWrite(LED,100);
delay(3000);
analogWrite(LED,150);
delay(3000);
analogWrite(LED,200);
delay(3000);
analogWrite(LED,255);
delay(3000);
//****************************************
51
2. LED / BUZZER / RELAY CONTROL CIRCUIT
#define LED 9
52
#define RLY 6
#define BUZZER 13
int i=0;
//*****************************
void setup()
pinMode(LED,OUTPUT);
pinMode(RLY,OUTPUT);
pinMode(BUZZER,OUTPUT);
//****************************
void loop()
for(i=0;i<10;i++)
digitalWrite(LED,1);
digitalWrite(RLY,1);
digitalWrite(BUZZER,1);
delay(1000);
digitalWrite(LED,0);
digitalWrite(RLY,0);
digitalWrite(BUZZER,0);
delay(1000);
while(1);
//********************************
53
3. THEFT ALARM CIRCUIT
#define LED 9
#define RLY 6
#define BUZZER 13
//**************************************
void setup()
{
54
pinMode(LED,OUTPUT);
pinMode(RLY,OUTPUT);
pinMode(BUZZER,OUTPUT);
pinMode(IRSENSOR,INPUT);
digitalWrite(IRSENSOR,1);
//***************************************
void loop()
if (digitalRead(IRSENSOR)==0)
digitalWrite(LED,1);
delay(30);
digitalWrite(RLY,1);
delay(30);
digitalWrite(BUZZER,1);
delay(15000);
digitalWrite(LED,0);
delay(30);
digitalWrite(RLY,0);
delay(30);
digitalWrite(BUZZER,0);
delay(30);
//****************************************
55
4. VOICE OPERATED ON OFF CONTROLS CIRCUIT
String readString;
#define MOTOR 10
#define LIGHT 6
#define BUZZER 13
#define FAN 9
//**************************************
void setup()
{
56
pinMode(MOTOR,OUTPUT);
pinMode(LIGHT,OUTPUT);
pinMode(BUZZER,OUTPUT);
pinMode(FAN,OUTPUT);
Serial.begin(9600);
digitalWrite(BUZZER,1);
delay(500);
digitalWrite(BUZZER,0);
delay(500);
digitalWrite(BUZZER,1);
delay(500);
digitalWrite(BUZZER,0);
delay(500);
}
//***************************************
void loop()
{
while(Serial.available())
{
delay(3);
char c = Serial.read();
readString+=c;
}
//-------------------------
if(readString.length() >0)
{
//-------------------------
if(readString == "light on")
{
digitalWrite(LIGHT,1);
delay(500);
57
}
else if(readString == "light off")
{
digitalWrite(LIGHT,0);
delay(500);
}
//-------------------------
else if(readString == "motor on")
{
digitalWrite(MOTOR,1);
delay(500);
}
else if(readString == "motor off")
{
digitalWrite(MOTOR,0);
delay(500);
}
//-------------------------
else if(readString == "fan on")
{
digitalWrite(FAN,1);
delay(500);
}
delay(500);
}
//--------------------------------
delay(500);
}
58
else if(readString == "motor speed")
{
analogWrite(MOTOR,250);
delay(500);
}
//--------------------------------
else{
delay(100);
}
readString = "";
}
}
//****************************************
59
5. 16 X 2 LCD DISPLAY PROGRAM
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
#define MOTOR 6
#define BUZZER 13
60
void setup()
{
lcd.begin(16,2);
pinMode(MOTOR, OUTPUT);
pinMode(BUZZER, OUTPUT);
delay(1000);
}
//---------------------------
void loop()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" GEC -ECE ");
lcd.setCursor(0,1);
lcd.print(" MICROLINK ");
delay(3000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("TRAINING PROGRAM");
lcd.setCursor(0,1);
lcd.print("ON E.S DESIGNING");
delay(3000);
}
//------------------------------
61
6. ULTRA SONIC DISTANCE MEASUREMENT /SPEED CONTROL
LiquidCrystal lcd(12,11,2,3,4,5);
#define MOTOR 6
#define BUZZER 13
#define TRIGGER 7
#define ECHO 8
float TIME=0,DISTANCE=0;
//---------------------
void setup()
62
lcd.begin(16,2);
pinMode(MOTOR, OUTPUT);
pinMode(BUZZER, OUTPUT);
pinMode(TRIGGER,OUTPUT);
pinMode(ECHO,INPUT);
delay(1000);
lcd.clear();
}
//---------------------------
void loop()
{
lcd.setCursor(0,0);
lcd.print("TARGET: ");
lcd.setCursor(0,1);
lcd.print("DISTANCE ");
GET_DISTANCE();
lcd.setCursor(8,0);
lcd.print(DISTANCE);
//---------------------------
if(DISTANCE<50)
{
digitalWrite(BUZZER,1);
}
else
{
digitalWrite(BUZZER,0);
}
//----------------------
delay(1000);
}
//---------SUB PROGRAMS---------
63
void GET_DISTANCE()
{
digitalWrite(TRIGGER,LOW);
delayMicroseconds(2);
digitalWrite(TRIGGER,HIGH);
delayMicroseconds(10);
digitalWrite(TRIGGER,LOW);
delayMicroseconds(2);
TIME=pulseIn(ECHO,HIGH);
DISTANCE=TIME * 340/20000;
}
//----------------------
#define MOTOR 10
#define BUZZER 13
#define TRIGGER 7
#define ECHO 8
float TIME=0,DISTANCE=0;
//---------------------
void setup()
{
lcd.begin(16,2);
pinMode(MOTOR, OUTPUT);
64
pinMode(BUZZER, OUTPUT);
pinMode(TRIGGER,OUTPUT);
pinMode(ECHO,INPUT);
delay(1000);
lcd.clear();
}
//---------------------------
void loop()
{
lcd.setCursor(0,0);
lcd.print("TARGET: ");
lcd.setCursor(0,1);
lcd.print("DISTANCE ");
GET_DISTANCE();
lcd.setCursor(8,0);
lcd.print(DISTANCE);
//---------------------------
if(DISTANCE<50)
{
digitalWrite(BUZZER,1);
}
else
{
digitalWrite(BUZZER,0);
}
//----------------------
if(DISTANCE>250)
{
digitalWrite(MOTOR,1);
}
else
65
{
analogWrite(MOTOR,DISTANCE*2);
}
delay(1000);
}
//---------SUB PROGRAMS---------
void GET_DISTANCE()
{
digitalWrite(TRIGGER,LOW);
delayMicroseconds(2);
digitalWrite(TRIGGER,HIGH);
delayMicroseconds(10);
digitalWrite(TRIGGER,LOW);
delayMicroseconds(2);
TIME=pulseIn(ECHO,HIGH);
DISTANCE=TIME * 340/20000;
}
//----------------------
66
7. POTENTIOMETER VOLTAGE/ ROTATION MEASUREMENT
LiquidCrystal lcd(12,11,2,3,4,5);
unsigned int potvalue;
unsigned int z;
void setup()
{
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
67
lcd.print(" POTENTIOMETER ");
lcd.setCursor(0,1);
lcd.print("POT : ");
lcd.setCursor(0,1);
lcd.print("VALUE ");
}
//--------------------------------------
void loop()
{
for(z=0;z<10;z++)
{
potvalue=analogRead(3);
delay(100);
}
potvalue=map(potvalue,0,1023,0,290);
lcd.setCursor(7,0);
lcd.print(" ");
lcd.setCursor(7,0);
lcd.print(potvalue);
}
68
8. DRUNK AND DRIVE DETECTION
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
unsigned int AL_VALUE;
unsigned int z;
#define LED 9
#define MOTOR 10
69
//----------------------
void setup()
{ lcd.begin(16,2);
pinMode(LED,OUTPUT);
pinMode(MOTOR,OUTPUT);
lcd.clear();
lcd.setCursor(0,0);
delay(3000);
lcd.setCursor(0,0);
lcd.print("ALCOHAL %: ");
lcd.setCursor(0,1);
lcd.print(" ");
digitalWrite(MOTOR,1);
}
//--------------------------------------
void loop()
{
for(z=0;z<10;z++)
{
AL_VALUE=analogRead(4);
delay(100);
}
AL_VALUE=map(AL_VALUE,0,1023,0,100);
lcd.setCursor(11,0);
lcd.print(" ");
lcd.setCursor(11,0);
lcd.print(AL_VALUE);
70
//------------------------
if (AL_VALUE>40)
{
digitalWrite(MOTOR,0);
}
else
{
digitalWrite(MOTOR,1);
//-------------------------
71
9. TEMPERATURE MEASUREMENT / TEMPERATURECONTROLLED FAN
//TEMPERATURE MEASUREMENT
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
{
72
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" TEMPERATURE ");
lcd.setCursor(0,1);
lcd.print("TEMP: ");
lcd.setCursor(0,1);
lcd.print("VALUE ");
}
void loop()
{
for(z=0;z<10;z++)
{
TEMP_VALUE=analogRead(1);
delay(100);
}
TEMP_VALUE=(TEMP_VALUE-512+25);
lcd.setCursor(7,0);
lcd.print(" ");
lcd.setCursor(7,0);
lcd.print(TEMP_VALUE);
}
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
unsigned int z;
#define FAN 10
73
void setup()
{ lcd.begin(16,2);
pinMode(FAN,OUTPUT);
lcd.clear();
lcd.setCursor(0,0);
delay(3000);
lcd.setCursor(0,0);
lcd.print("TEMP: ");
lcd.setCursor(0,1);
lcd.print("VALUE ");
}
//--------------------------------------
void loop()
for(z=0;z<10;z++)
{
TEMP_VALUE=analogRead(1);
delay(100);
}
TEMP_VALUE=(TEMP_VALUE-512+25);
lcd.setCursor(7,0);
lcd.print(" ");
lcd.setCursor(7,0);
lcd.print(TEMP_VALUE);
analogWrite(FAN,TEMP_VALUE);
}
74
11. AUTO INTENSITY CONTROLLED LED
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
pinMode(LED,OUTPUT);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" LIGHT ");
lcd.setCursor(0,1);
lcd.setCursor(0,0);
lcd.print("LIGHT: ");
lcd.setCursor(0,1);
void loop()
{
for(z=0;z<10;z++)
{
LIGHT_VALUE=analogRead(0);
delay(100);
}
LIGHT_VALUE=map(LIGHT_VALUE,0,1023,0,255);
lcd.setCursor(7,0);
lcd.print(" ");
lcd.setCursor(7,0);
lcd.print(LIGHT_VALUE);
analogWrite(LED,255-LIGHT_VALUE);
}
76
11. SOIL MOISTURE CONTROL
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
unsigned int MOI_VALUE,A_VAL=0;
unsigned int z;
#define LED 9
#define RLY 6
//----------------------
void setup()
{ lcd.begin(16,2);
77
pinMode(LED,OUTPUT);
pinMode(RLY,OUTPUT);
lcd.clear();
lcd.setCursor(0,0);
delay(3000);
lcd.setCursor(0,0);
lcd.print("MOISTURE %: ");
lcd.setCursor(0,1);
lcd.print("LEVEL ");
}
//--------------------------------------
void loop()
{
A_VAL=0;
for(z=0;z<10;z++)
{
MOI_VALUE=analogRead(5);
A_VAL=A_VAL+MOI_VALUE;
delay(100);
}
MOI_VALUE=A_VAL/10;
MOI_VALUE=map(MOI_VALUE,0,1023,100,0);
lcd.setCursor(11,0);
lcd.print(" ");
lcd.setCursor(11,0);
lcd.print(MOI_VALUE);
78
//------------------------
if (MOI_VALUE>30)
{
digitalWrite(RLY,0);
}
else
{
digitalWrite(RLY,1);
//-------------------------
79
12. GSM POLLUTION MONITORING
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
#define RLY 6
#define MOTOR 10
80
#define BUZZER 13
//----------------------
void setup()
{
lcd.begin(16,2);
Serial.begin(9600);
pinMode(LED,OUTPUT);
pinMode(RLY,OUTPUT);
pinMode(MOTOR,OUTPUT);
pinMode(BUZZER,OUTPUT);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" POLLUTION MONIT.");
lcd.setCursor(0,1);
lcd.print("CONTROL SYSTEM ");
delay(3000);
lcd.setCursor(0,0);
lcd.print("POL. %: ");
lcd.setCursor(0,1);
lcd.print("LEVEL ");
}
//--------------------------------------
void loop()
{
for(z=0;z<10;z++)
{
POL_LEVEL=analogRead(4);
delay(100);
}
POL_LEVEL=map(POL_LEVEL,0,1023,0,100);
81
lcd.setCursor(11,0);
lcd.print(" ");
lcd.setCursor(11,0);
lcd.print(POL_LEVEL);
//------------------------
if (POL_LEVEL>30)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" POLLUTION level.");
lcd.setCursor(0,1);
lcd.print("is too HIGH.... ");
digitalWrite(BUZZER,1);
delay(3000);
digitalWrite(MOTOR,0);
lcd.clear();
lcd.setCursor(0,0);
sendsms1();
delay(1000);e
sendsms2();
dial2();
delay(10000);
dial1();
delay(3000);
dial1();
82
lcd.clear();
lcd.setCursor(0,0);
lcd.print("POL. %: ");
lcd.setCursor(0,1);
lcd.print("LEVEL ");
}
else
{
digitalWrite(MOTOR,1);
digitalWrite(BUZZER,0);
}
}
//---------------------
void sendsms1()
{
Serial.print("AT+CMGD=1\r");
delay(3000);
Serial.print("AT+CMGF=1\r");
delay(1000);
Serial.println("AT+CMGS=\"+917093962924\"");
delay(1000);
Serial.print(" POLLUTION LEVEL IN CAR NO:AP16EF 9966 IS TOO HIGH PLEASE CHECK.
POL.LEVEL IS: ");
Serial.println(POL_LEVEL);
delay(1000);
Serial.println((char)26);
delay(1000);
Serial.println();
delay(3000);
}
//-------------------
void sendsms2()
{
Serial.print("AT+CMGD=1\r");
83
delay(3000);
Serial.print("AT+CMGF=1\r");
delay(1000);
Serial.println("AT+CMGS=\"+918309476148\"");
delay(1000);
Serial.print(" POLLUTION LEVEL IN CAR NO:AP16EF 9966 IS TOO HIGH PLEASE CHECK.
POL.LEVEL IS: ");
Serial.println(POL_LEVEL);
delay(1000);
Serial.println((char)26);
delay(1000);
Serial.println();
delay(3000);
}
//-------------------
void dial1()
{
Serial.print("AT\r");
delay(4000);
Serial.print("ATD7093962924;\r");
delay(15000);
Serial.print("ATH\r");
Serial.print("ATH\r");
delay(4000);
}
void dial2()
{
Serial.print("AT\r");
delay(4000);
Serial.print("ATD8309476148\r");
delay(15000);
Serial.print("ATH\r");
Serial.print("ATH\r");
delay(4000);
}
84
13. Women Security System Using GPS & GSM
SoftwareSerial gps(7,8);
#include<LiquidCrystal.h>
LiquidCrystal lcd(12,11,2,3,4,5);
#define sensor A0
float tempc;
float vout;
String buffer;
int gps_status=0;
85
float latitude=0;
float logitude=0;
String Speed="";
String gpsString="";
char *test="$GPRMC";
int s1p,x,y,x1,y1;
int temp=0;
int i=0,k=0,nt=0;
#define buz 13
void setup()
{
lcd.begin(16,2);
Serial.begin(9600);
gps.begin(9600);
lcd.print("WOMEN SAFETY ");
lcd.setCursor(0,1);
gsm_init();
lcd.clear();
lcd.print("wait......");
Serial.println("AT+CMGF=1");
delay(3000);
Serial.println("AT+CMGD=1");
delay(3000);
Serial.println("AT+CMGD=2");
delay(3000);
Serial.println("AT+CNMI=2,2,0,0,0");
delay(3000);
Serial.println("AT+CNMA");
delay(3000);
lcd.clear();
86
lcd.print("GPS Initializing");
lcd.setCursor(0,1);
lcd.clear();
lcd.print("GPS Range Found");
lcd.setCursor(0,1);
lcd.print("GPS is Ready");
delay(2000);
lcd.clear();
lcd.print("System Ready");
temp=0;
pinMode(buz,OUTPUT);
pinMode(sensor,INPUT);
digitalWrite(sensor,1);
void loop()
{
s1p=digitalRead(sensor);
delay(1000);
if (s1p==1)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("PLEASE....... ");
lcd.setCursor(0,1);
lcd.print("WAITING FOR SEN.");
digitalWrite(buz,LOW);
87
if(s1p==0)
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("SENSOR ACTIVATED");
lcd.setCursor(0,1);
lcd.print("I AM IN DAGER ");
digitalWrite(buz,HIGH);
delay(4000);
for(nt=0;nt<100;nt++)
{
get_gps();
//show_coordinate();
//coordinate2dec();
tracking();
delay(4000);
tracking1();
dial1();
delay(4000);
dial2();
delay(10000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Resending.......");
lcd.setCursor(0,1);
lcd.print(nt);
delay(5000);
}
}
}
//--------------------------------
88
String readSIM900A()
{
String buffer;
while (Serial.available())
{
char c = Serial.read();
buffer.concat(c);
delay(10);
}
return buffer;
}
//-----------------------------------
void gpsEvent()
{
gpsString="";
while(1)
{
gpsString+= inChar; //store incoming data from GPS to temparary string str[]
i++;
// Serial.print(inChar);
if (i < 7)
{
if(gpsString[i-1] != test[i-1]) //check for right string
{
i=0;
gpsString="";
}
}
if(inChar=='\r')
{
if(i>60)
89
{
gps_status=1;
break;
}
else
{
i=0;
}
}
}
if(gps_status)
break;
}
Serial.println(gpsString);
//-----------------------------
void gsm_init()
{
lcd.clear();
lcd.print("Finding Module..");
boolean at_flag=1;
while(at_flag)
{
Serial.println("AT");
while(Serial.available()>0)
{
if(Serial.find("OK"))
at_flag=0;
delay(1000);
}
lcd.clear();
90
lcd.print("Module Connected..");
delay(1000);
lcd.clear();
lcd.print("Disabling ECHO");
boolean echo_flag=1;
while(echo_flag)
{
Serial.println("ATE0");
while(Serial.available()>0)
{
if(Serial.find("OK"))
echo_flag=0;
}
delay(1000);
}
lcd.clear();
lcd.print("Echo OFF");
delay(1000);
lcd.clear();
lcd.print("Finding Network..");
boolean net_flag=1;
while(net_flag)
{
Serial.println("AT+CPIN?");
while(Serial.available()>0)
{
if(Serial.find("+CPIN: READY"))
net_flag=0;
}
delay(1000);
}
lcd.clear();
lcd.print("Network Found..");
delay(1000);
91
lcd.clear();
}
//------------------------------
void get_gps()
{
lcd.clear();
lcd.print("Getting GPS Data");
lcd.setCursor(0,1);
lcd.print("Please Wait.....");
gps_status=0;
int x=0;
while(gps_status==0)
{
gpsEvent();
delay(2000);
int str_lenth=i;
coordinate2dec();
delay(2000);
show_coordinate();
i=0;x=0;
str_lenth=0;
}
}
//*************************
void show_coordinate()
{
lcd.clear();
lcd.print("Lat:");
lcd.print(latitude);
lcd.setCursor(0,1);
lcd.print("Log:");
lcd.print(logitude);
// Serial.print("Latitude:");
92
// Serial.println(latitude);
// Serial.print("Longitude:");
// Serial.println(logitude);
delay(2000);
}
//*******************************
void coordinate2dec()
{
String lat_degree="";
for(i=20;i<=21;i++)
lat_degree+=gpsString[i];
//Serial.println(lat_degree);
String lat_minut="";
for(i=22;i<=28;i++)
lat_minut+=gpsString[i];
//Serial.println(lat_minut);
String log_degree="";
for(i=32;i<=34;i++)
log_degree+=gpsString[i];
String log_minut="";
for(i=35;i<=41;i++)
log_minut+=gpsString[i];
Speed="";
for(i=45;i<48;i++) //extract longitude from string
Speed+=gpsString[i];
minut=minut/60;
float degree=lat_degree.toFloat();
93
latitude=degree+minut;
minut= log_minut.toFloat();
minut=minut/60;
degree=log_degree.toFloat();
logitude=degree+minut;
//Serial.println(latitude,6);
// Serial.println(logitude,6);
//**************************************
void init_sms()
{
Serial.println("AT+CMGF=1");
delay(400);
Serial.println("AT+CMGS=\"+919912906262\"");
delay(400);
}
void init_sms1()
{
Serial.println("AT+CMGF=1");
delay(400);
Serial.println("AT+CMGS=\"+916281601463\"");
delay(400);
}
Serial.println(message);
delay(200);
}
//------------------------
void send_sms()
94
{
Serial.write(26);
}
//-------------------------
void lcd_status()
{
lcd.clear();
lcd.print("Message Sending.");
delay(2000);
lcd.clear();
lcd.print("Message Sent");
delay(2000);
lcd.clear();
lcd.print("System Ready");
return;
}
void tracking()
{
init_sms();
Serial.print(latitude,6);
Serial.print(",");
Serial.print(logitude,6);
//Serial.println();
//send_data("Please take some action soon..\nThankyou");
send_sms();
delay(2000);
lcd_status();
}
void tracking1()
{
95
init_sms1();
//send_data("Child Tracking:");
Serial.print(",");
Serial.print(logitude,6);
//Serial.println();
lcd_status();
}
void dial1()
{
Serial.print("AT\r");
delay(4000);
Serial.print("ATD+919912906262;\r");
delay(15000);
Serial.print("ATH\r");
delay(4000);
}
void dial2()
{
Serial.print("AT\r");
delay(4000);
Serial.print("ATD+916281601463;\r");
delay(15000);
Serial.print("ATH\r");
delay(4000);
}
//***********************************************************************
96
14. IOT BASED TEMPERATURE / LIGHT MONITORING
#include <LiquidCrystal.h>
//-----------------------------------------------------------------------------------------------------------------------------------
SoftwareSerial esp(7, 8);
97
float h;
float t;
//---------------------------------------------------------------------------
String g1_level_string = "";
String g2_level_string = "";
pinMode(rlytemp,OUTPUT);
pinMode(ledlight,OUTPUT);
pinMode(rlyhum,OUTPUT);
pinMode(rlysoil,OUTPUT);
Serial.begin(9600);
esp.begin(115200);
lcd.begin(16,2);
esp.println("AT+RST");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("IOT BASED TEMP ");
lcd.setCursor(0,1);
lcd.print("LIGHT MONITOR");
98
delay(6000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("TEMP : ");
lcd.setCursor(0,1);
lcd.print("LIGHT : ");
}
//-----------------------------------------------------------------------------------------------------------------------------------
void loop()
{
sense_loop();
post();
delay(700);
}
//-----------------------------------------------------------------------------------------------------------------------------------
void post()
{
String cmd = "AT+CIPSTART=\"TCP\",\"";
if(esp.find("ERROR"))
{
//Serial.println("AT+CIPSTART error");
return;
}
delay(100);
//------------------------add fields--------------------
99
String getStr = "GET /update?api_key=";
getStr += ApiKey;
getStr += field1;
getStr += g1_level_string;
getStr += field2;
getStr += g2_level_string;
getStr += "\r\n\r\n";
// Serial.print(getStr);
//------------------------------------------------------
cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
//cmd += String(str.length());
esp.println(cmd);
if(esp.find(">"))
{
esp.print(getStr);
//esp.print(str);
delay(2000);
}
}
//-----------------------------------------------------------------------------------------------------------------------------------
void sense_loop()
{
delay(2000);
x=analogRead(0);
y=analogRead(1);
z=analogRead(2);
100
x1=map(x,0,1023,0,255);
y1=map(y,0,1023,0,255);
z1=map(z,0,1023,0,255);
delay(500);
x1=x1-114;
lcd.setCursor(13,0);
lcd.print(" ");
lcd.setCursor(13,0);
lcd.print(x1);
lcd.setCursor(13,1);
lcd.print(" ");
lcd.setCursor(13,1);
lcd.print(y1);
if ((x1>50)||(y1>50))
{
digitalWrite(buzzer,1);
digitalWrite(rlytemp,1);
}
else
{
digitalWrite(buzzer,0);
digitalWrite(rlytemp,0);
//*****************************************************************
101