You are on page 1of 31

Microcontroller Based

Trainer Kit

Prepared By:
- Vrushank Shah
Rushvi Rajan
Krina Patel
What Is Trainer Kit ?

• Trainer Kit in general sense is defined as


a device which is capable to perform many
kinds of microcontroller operations ranging
from a simple LED glow to a quite
complicated applications.
• In More specified way, Trainer Kit serves
the purpose of explaining the students of
technical institutes and colleges various
microcontroller practicals.
Why we choose this project ?
• Our approach is to gain knowledge of Interfacing
different devices with Microcontroller for useful
applications and to fulfill the the Hardware
Module requirement of college authorities.
• Trainer Kit is such a project which can be used
to perform any kind of application depend on the
modules which are interfaced.
• These leads us to Microcontroller Based Trainer
Kit.
Block Diagram
REAL TIME DAC ————►‌‌
CLOCK ————►‌‌
LEDS
————►‌‌

S ————►‌‌
E A 8051
N D
S 40
C
O PIN
R DIP

LCD
DISPLAY

4×4 MATRIX KEYBOARD


4 SWITCHES
• In a Trainer Kit we can Interfaced a number of
Modules such as

» LED and 7-segment Display


» LCD
» Keyboard
» Real Time Clock (RTC)
» DAC
» ADC
» Sensors
» EEPROM
» RS-232
• 89C51 Microcontroller Pin Diagram
P1.0 1 40 +5V
P1.1 2 39 P0.0(AD0)
P1.2 3 38 P0.1(AD1)
P1.3 4 37 P0.2(AD
P1.4 5 36 P0.3(AD3)
2)
P1.5 6 35 P0.4(AD
P1.6 7 34 P0.5(AD5)
4)
P1.7 8 33 P0.6(AD6)
RST 9 40 PIN 32 P0.7(AD7)
P3.0(RXD) 1 DIP 31 EA/(VPP)
P3.1(TXD) 1 30 ALE(PROG)
01
P3.2(INT0) 12 29 PSEN
P3.3(INT1) 13 28 P2.7(A15)
P3.4(T0) 14 27 P2.6(A14)
P3.5(T1) 15 26 P2.5(A13)
P3.6(WR) 16 25 P2.4(A12)
P3.7(RD) 17 24 P2.3(A11)
XTAL2 18 23 P2.2(A10)
XTAL1 19 22 P2.1(A9)
VSS 20 21 P2.0(A8)
Features and Specifications:
• 89C51 Central Processing Unit with 40 pin DIP.
• On chip Flash Programme Memory of 4k ROM
and 128 bytes of RAM.
• Speed upto 33 Mhz
• 6 Interrupt Sources
• Four 8-Bit I/O Ports
• 1-Serial Port
• Two 16-bit Timers/Counters
• +5v Vcc
Light Emitting diode
• It is single light display that include
incandescent and are treated as single
binary points to be switched off and on by
program instructions.
• It has two pins, first is connected to port
and second one is grounded (vss).
• It requires a high logic to glow from the
port pin.
Interfacing Led with 8051
Vcc

<
8051 <
<
<
< <
<
<
<
<
P0.0 ————►‌ ‌

P0.1 ————►‌‌
Led

<

< < <


7-Segment Display

• Seven-segment displays commonly contain LED


segments which arranged as an 8 with a
common lead (cathode or anode) and 7
individual leads for each segment.
• Block Diagram shows a common cathode type
of segment
• In common cathode to lit a segment a high input
logic is required.
• In common anode to lit a segment a low input
logic is required.
Interfacing of 7-segment with
8051 Vcc Vcc

8051
^^^^^^ ^^^^^^

P0.0 ^^^^^^
P0.1 ^^^^^^
P0.2 ^^^^^^
P0.3 ^^^^^^
P0.4 ^^^^^^
P0.5 ^^^^^^
P0.6 ^^^^^^
P0.7 ^^^^^^
Key Board
• Keyboards are the input devices and is
generally organized in a matrix of rows
and columns.
• When a key is pressed row makes a
contact with column, otherwise there is no
connection.
• Figure shows a 4×4 matrix keyboard
LCD
• It is an Intelligent Alphanumeric display which can be
used to display numbers, characters, and graphics.
• It has 14 pins as shown in pin diagram.
• Display contains 2 internal byte wide registers, one for
command (RS=0) and one for display (RS=1).
• There are certain commands to be send to the Lcd for
making some setting such as clear screen, force the
cursor to home position and blink the cursor.
• R/W pin is set to 1 for reading and to 0 for writing.
• EN pin is set to 1 for enabling display.
• DB0-DB7 are pins for 8-bit data bus.
Interfacing Lcd with 8051
8051

P1.0 D0
4×16 Character LCD Display

P1.7 D7
E RS R/W Gnd Vee Vcc
P2.0
P2.1 +5v
P2.2
^^^^^^
10k
Real Time Clock
• RTC is widely used device that provides
accurate time and date for many
applications.Figure shows interfacing of
RTC chip DS12887 to 8051.
• It has a total of 128 bytes of non volatile
RAM.
• It uses 14 bytes of RAM for clock calender
and control registers and other 114 bytes
of RAM for general purpose data storage.
RTC interfacing with 8051
VCC

8051
RST crystal
SDA
SCL
DS1307
SQW\OUT

GND
VCC Primary Power Supply

X1, X2 Crystal Connection(32.768 khz)


GND Ground
VBAT +3 V Battery Input
SDA Serial Data
SCL Serial Clock
SQW\ Square wave out\
OUT Output Driver
0 Seconds

1 Minutes

2 Hours
3 Day of Month
4 Date

5 Month
6 Year
7 Control Register

8 56×8
3FH RAM
ADC
• ADC0808 allows us to monitor upto 8 different analog
inputs using a single chip.
• 8 analog input s are multiplexed and selected using 3
address pins(A,B,C).
• SOC and EOC are for start of conversion and End of
conversion
• OE is for output Enable.
• IN0-IN7 pins are for analog inputs and D0-D7 are for
digital outputs.
• ADC converts analog data to digital by using Succesive
Approximation Method.
Interfacing of ADC+5vto 8051
Vcc
P2.6 RD(OE) Vref(+)
P2.5 o 2.56V
WR(SC)
P0.1 D0

}
IN0
ADC From Sensors
0808 output
8051
P0.7 D7
ALE IN7
P2.4
P2.3 INTR(EOC)
Vref(-)
P2.0

P2.2
P2.1

A B C
Digital to Analog convertor
• For Digital to Analog Conversion,
DAC0808 is used
• DAC0808 employs two methods for
converting Digital signal to Analog signal
1. binary weighted
2. R/2R Ladder Network
Interfacing DAC
+5V
to 8051
+5v

R1
8051 Vcc ^^^^^^
P1.0 D0 R3
Vref (+) ^^^^^^

Out - R2 Vout
^^^^^^
P1.7 D7 +
Vref(-) C2

Vee Gnd
Comp

c1

-12V
Sensors
• Sensors are the devices capable of converting
the physical data such as temperature, light
Intensity and pressure into the corresponding
voltage.
• TEMPERATURE SENSORS:
Thus Temperature Sensors are the devices
whose output voltage is proportional to input
temperature. In such sensors 0۬۬°C is set to 0
mv and for each degree change the output
voltage changes by 10mv.
figure shows LM35 temperature Sensor
• LM35 operates in a temperature range of -55°C to
+150°c.
• These device do not require any external
calibration, since it is internally calibrated.

• Signal Conditioning:
ø The output of all kind of sensors are in the form of
voltage,current,charge,capacitance and resistance.
ø However, we need to convert these signals to voltage in
order to send it to ADC. This conversion is commonly
called signal conditioning.
ø Signal conditioning may be current-to-voltage conversion or
it may be simply a signal amplication. These may be done
using a simple opamp circuit.
8255 programmable peripheral I/O
• 8051 Microcontroller has only 32 pins for
I/O which doesn’t meet our requirement of
interfacing all of the modules, these leads
to use 8255 PPI.
• 8255 is basically programmable peripheral
I/O which increases the I/O capability of
8051 upto 3 times i.e. 8 port pins of 8051
is converted to 24 port pins at 8255
output.
• Figure shows pins diagram of 8255 PPI
How To Proceed ?
• Initially we interfaced LED, 7-segment and
Keyboard and check programme which is
the purpose of trainer Kit.
• In these way we go step by step for each
module interface and accomplish the goal
of making a well-functioning Trainer Kit.
• Finally we add some features by
interfacing Sensors for temperature
controlling and RTC for a Digital clock.
Applications:

• Temperature Monitoring System.


• In Technical institutes and colleges,
Trainer kit is useful for student to perform
various microcontroller practicals.
Extended Features:

• A Data Acqitision system which includes


temperature, pressure and light can be
made.
• By interfacing DC MOTOR with
Microcontroller, we can make the trainer
kit which controls the fan.
• We can also generate various types of
waves such as square, triangular and
sawtooth in accordance with the
programme fed in 8051 chip.