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

• 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 P1.1 2 P1.2 3 P1.3 4 P1.4 5 P1.5 6 P1.6 7 P1.7 8 RST 9 P3.0(RXD) 1 P3.1(TXD) 11 0 P3.2(INT0) 12 P3.3(INT1) 13 P3.4(T0) 14 P3.5(T1) 15 P3.6(WR) 16 P3.7(RD) 17 XTAL2 18 XTAL1 19 VSS 20 40 +5V 39 P0.0(AD0) 38 P0.1(AD1) 37 P0.2(AD 36 P0.3(AD3) 2) 35 P0.4(AD 34 P0.5(AD5) 4) P0.6(AD6) 33 32 P0.7(AD7) 31 EA/(VPP) 30 ALE(PROG) 29 PSEN 28 P2.7(A15) 27 P2.6(A14) 26 P2.5(A13) 25 P2.4(A12) 24 P2.3(A11) 23 P2.2(A10) 22 P2.1(A9) 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

• 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


D0 4×16 Character LCD Display

P1.7 P2.0 P2.1 P2.2


Gnd Vee Vcc +5v ^^^^^^ 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 SDA SCL DS1307 SQW\OUT GND RST crystal


Primary Power Supply Crystal Connection(32.768 khz) Ground +3 V Battery Input Serial Data Serial Clock Square wave out\ Output Driver

0 Seconds 1 Minutes 2 Hours 3 Day of Month 4 Date 5 Month 6 Year 7 Control Register 8 3FH 56×8 RAM

• 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 to 8051 +5v
P2.6 P2.5 P0.1 Vcc RD(OE) Vref(+) WR(SC) D0 IN0 o 2.56V

P0.7 P2.4 P2.3 P2.0 P2.2 P2.1

ADC 0808
D7 IN7 ALE INTR(EOC) Vref(-) A B C


From Sensors output

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 to 8051 +5V
+5v 8051 P1.0 Vcc D0 Vref (+) Out P1.7 D7 Vref(-) Gnd Vee Comp c1 R3 ^^^^^^ R1 ^^^^^^


R2 ^^^^^^

Vout C2


• 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.

• 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.