xy
Microcontroller Based Systems
(MTS-310)
DE-39 Mechatronics
Syndicate –B
Group Members : Khubaib Waqar Khan
: Saad Bader
Lab Report 1 : a. Introduction to Proteus
: b. Hbridge & 8951Microcontroller Proteus
Submitted to : LD Muhammad Qasim
Lab1 Proteus & Microcontroller Khubaib & Saad
1
Lab1 Proteus & Microcontroller Khubaib & Saad
1a. Introduction to Proteus
Proteus is used to create schematics, simulate, design layouts for PCBs and 3D verification.
Figure 1 Proteus Window
Flowchart 1 Proteus Main Functions
Protues
ISIS ARES
VSM
Intelligent Schematic Advanced Routing and
Virtual System Modeling
Input System Editing Software
graphical SPICE allows
design and simulation of is a circuit board design simulation and animation
electric circuits software
directly in ISIS
Lab1 Proteus & Microcontroller Khubaib & Saad
Table 1 Modes in Proteus
Selection Mode : To Select
Component Mode : List of Components (P, find, double click adds components to list)
Junction Dote Mode
Wire Label Mode : Label wires for using of bus
Text Script Mode : For writing text
Bus Mode : Use Buses instead of wires
SubCircuit Mode
Terminal Mode : Power (fixed 5V) and Ground
Device Pin Mode
Graph Mode : To add graphs (drop probes to measure wrt time)
Active PopUp Mode
Generator Mode : DC/AC supplies (sine, pulse, audio etc.)
Probe Mode : To measure Voltage and current in a wire
Instrument Mode : Helping instruments like Oscilloscope, Timer etc.
Objectives:
To learn proteus basics i.e. circuit making, use of wires, power terminal and ground
To learn use of oscilloscope i.e. viewing waveforms, finding time period by grids and by
cursors
Making logic circuits using LOGICSTATE, LOGICPROBE and gates.
These objectives were completed using Task 1,2,3 and 4
2
Lab1 Proteus & Microcontroller Khubaib & Saad
Task1 Half Wave Rectifier
1. Place resister R1, diode D1, ground GND and SINE from GENERATOR mode and connect
via wire
2. Add OSCILLOSCOPE from INSTRUMENT mode, connect to input and output across diode
3. RUN and set by changing TIME KNOB of connected channels to view waveform
Figure 2 Negative Half Wave Rectification
Figure 3 Positive Half Wave Rectification
3
Lab1 Proteus & Microcontroller Khubaib & Saad
Task2 Full Wave Rectifier
1. Repeat task1 for the bridge rectifier and observe the result. See that diodes can be placed
horizontal or vertical and not diagonal.
2. Also note that output is almost Vo = Vin - 1.4 where Vo and Vin are amplitude of output and
input wave.
3. Find generic full bridge rectifier BRIDGE and see that both outputs are equal for the same
input but the generic bridge has a compact schematic and is quick to integrate in circuits.
Figure 4 Full Wave Rectifier
Figure 5 Generic Full Bridge Rectifier
4
Lab1 Proteus & Microcontroller Khubaib & Saad
Task3 Full Adder
Circuit can add three bits at a time. It has three inputs and two outputs.
1. Place XOR, AND and OR gate by giving them as KETWORDS in PICK DEVICES window
2. Add LOGICSTATE (logic input) and LOGICPROBE (logic input) to componant list
3. Make the circuit and verify the Truth Table
4. Also see that Red shows high logic state and blue show low gic state
Figure 6 Full Adder in state A=1, B=0 and Cin=1
Table 2 Truth Table
A B CarryIn Sum CarryOut
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
5
Lab1 Proteus & Microcontroller Khubaib & Saad
Task4 4-Bit Even-Odd Parity Checker
Even parity checker output is 0 for even number of ones
Odd parity checker output is 0 for odd number of ones
1. Place XOR, LOGICSTATE, LOGICPROBE, XNOR and NOT in component list.
2. Make the circuit diagram as follows and verify the functionality
3. For Odd Parity use XOR gates or use NOT after Even_Parity.
Figure 7 Even Parity
Figure 8 Odd Paraity by NOT of Even_Parity or by XNOR gates
6
Lab1 Proteus & Microcontroller Khubaib & Saad
1b. Hbridge & MicroController in Proteus
H-bridge
H-bridge is an electronic circuit that is used to drive motors by switching the voltage polarity
applied to the load. They are one of the most important component in robots as the control the
forward and reverse movement of motor.
Table 3 Working of H-bridge
Figure 9 Circuitry behind the bridge Figure 10 Motor Forward
These switches control the current flow. When S1, S4 close motor moves forward
Figure 11 Reverse direction
S3, S2 close so opposite polarity and hence Figure 12 Burning of the Bridge
reverse In such a case bridge burns
7
Lab1 Proteus & Microcontroller Khubaib & Saad
MicroController
A microcontroller is a single integrated circuit that is used to perform a dedicated task. There are
different microcontrollers due to difference in ARCHITECTURE.
Microcontroller Microprocessor
It has in-built ports along with memory units Ports, ROM, RAM not built in and must be
like ROM and RAM but as the controller. integrated
Eg. 8051uC uP used in computers and motherboard
provides ROM, RAM, ports etc.
PORTS are used for input (LOGICSTATES)
or ouput (LEDs)
Port1: P1.0 to P1.7. Can be used as individual
bits or a single byte
Port1, Port2 and Port3 are internally pulled up
but Port0 is not and it needs external VCC
RESET (pin9) it resets the data i.e. takes all
memory to 0 state
OSCILLATOR (pin 18,19) to provide
external clock
VCC and VSS (gnd) (pin 40 and 20)
PSEN, ALE, EA (pin 29, 30, 31) controller
has limited memory so use external memory
through these pins
It is available as AT89C51 in Proteus Figure 13 Pin COnfigration
Objectives:
Learn Hbridge to drive a motor
Learn ports of 8051MicroController and use them to drive LEDs or SWITCHes
Revise concept of pull and pull down resistance
Learn new components LEDSTRIP, RESPACK, DEPSWITCH and use BUS
8
Lab1 Proteus & Microcontroller Khubaib & Saad
Task1 H-Bridge using Two Relays, Two Transistor and
LogicState
1. Make the circuit diagram as shown. The
relays are connected by X-mirror.
2. Use PULSE GENERATOR. The PULSE
WIDTH controls the speed of the motor.
More the width more the speed
3. Relay energized by 12V DC
4. The direction of motor controlled by
LOGICSTATE
5. Set probes at RELAY COILS and see that
at logic 0 one side of motor at high
potential and other side at low so motor
rotates ANTICLOCK wise
6. At logic 1 motor rotates clockwise with
same speed
Figure 14 Pulse Width Generator Properties
Figure 15 Clockwise rotates (C=right B=left, C high potential wrt B)
9
Lab1 Proteus & Microcontroller Khubaib & Saad
Figure 16 Antilockwise rotates (C=right B=left, B high potential wrt C)
Problem Encountered:
As the relay coils were not energized by the
12V DC there was no voltage change in them
and hence no change in direction even when
logicstate was changed.
It was debugged and after wire was added
direction change started happening.
Figure 17 NO change in direction
10
Lab1 Proteus & Microcontroller Khubaib & Saad
Task2 MicroController port usage
NOTE:
PORT1, 2 and 3 are internally pulled up while
PORT0 is not
Double click on wire to create wire of same length
and direction
RED = HIGH
GREY = UNKNOWN
BLUE = LOW
Series of led replaced by LEDSTRIP
LEDSTRIP has 1 as anode side and 20 as
cathode side
Series of resistors by RESPACK
RESPACK has 1 as common
Series of switches by DIPSWITCH
Figure 19 8951 in Proteus
Figure 18 RESPACK, LEDSTRIP, DIPSWITCH
1. REQUIRED
a. PORT0 with LEDSTRIP
b. PORT1 with LEDSTRIP
c. PORT2 with DIPSWITCH
d. PORT3 with LOGICSTATES
2. Add AT89C51, LEDSTRIP, LOGICSTATE, DIPSWITCH and RESPACK to componant list
3. PORT0
a. Connect LEDSTRIP after pulling up with RESPACK. Use proper wire labeling when
using bus mode
4. PORT1
a. Connect LEDSTRIP after rotating and pulldown by RESPACK
5. PORT2
a. Connect DIPSWITCH with its common to POWER (5V) and pulled down by
RESPACK
11
Lab1 Proteus & Microcontroller Khubaib & Saad
6. PORT3
a. Connect LOGICSTATES by bus and use wire labeling
7. RUN to check
Figure 20 Complete Circuit
12
Lab1 Proteus & Microcontroller Khubaib & Saad
Conclusion
We learned
Making simple to complex circuits in Proteus
Simulation using OSCILOSCOPE
Making logic circuits
H-bridge and its debugging (finding error by checking probes)
A new generator input pulse
Using BUS mode
Pull up and pull down importance and
New components like RESPACK, DIPSWITCH etc. to save size
References
https://en.wikipedia.org/wiki/H_bridge
https://www.modularcircuits.com/blog/articles/h-bridge-secrets/h-bridges-the-basics/
https://en.wikipedia.org/wiki/Microcontroller
and notes taken during lab
13