0% found this document useful (0 votes)
5 views83 pages

ET3491 Laboratory Mannual and Record

The document outlines the curriculum and practical exercises for the ET3491 Embedded Systems and IoT course at Meenakshi College of Engineering, focusing on the Department of Electronics and Communication Engineering. It includes the vision, mission, program educational objectives, outcomes, and specific outcomes for the B.E. in Electronics and Communication program, along with detailed practical exercises using 8051 and ARM microcontrollers. Additionally, it provides course outcomes and examples of assembly language programs for various operations and interfacing tasks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views83 pages

ET3491 Laboratory Mannual and Record

The document outlines the curriculum and practical exercises for the ET3491 Embedded Systems and IoT course at Meenakshi College of Engineering, focusing on the Department of Electronics and Communication Engineering. It includes the vision, mission, program educational objectives, outcomes, and specific outcomes for the B.E. in Electronics and Communication program, along with detailed practical exercises using 8051 and ARM microcontrollers. Additionally, it provides course outcomes and examples of assembly language programs for various operations and interfacing tasks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 83

MEENAKSHI COLLEGE OF ENGINEERING

Accredited by NAAC
(Approved by AICTE, New Delhi. Affiliated to Anna University, Chennai)
WEST KK NAGAR, CHENNAI – 600078.

ET3491 EMBEDDED SYSTEMS AND IOT

RECORD MANUAL

NAME :

REGISTER NO :

YEAR / SEMESTER :

AS PER ANNA UNIVERSITY SYLLABUS

2021 REGULATION

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


MEENAKSHI COLLEGE OF ENGINEERING
12, Vembuli Amman Kovil Street, West K.K Nagar, Chennai –
78
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING
VISION

To offer quality education with value added teaching in the field of Electronics and
Communication Engineering and to develop confidence to meet the growing challenges in the
advanced technological revolution worldwide.

MISSION
The mission of the Department of Electronics and Communication Engineering is to,
• To Ensure effective teaching learning process and develop competent professionals in the
design and implementation of Electronics and Communication Engineering.
• To Equip the students with strong foundations to carryout R&D in the Electronics filed and
to enable them for continuing education.
• To Provide ethical and value based global education by promoting activities addressing the
societal needs.
• To Provide placement opportunities and to provide motivation for higher studies.
MEENAKSHI COLLEGE OF ENGINEERING
12,Vembuli Amman Kovil Street, West K.K Nagar, Chennai – 78

Department of Electronics & Communication Engineering

Program Name: B.E (Electronics and Communication)

PROGRAM EDUCATIONAL OBJECTIVES (PEOs)


MCE Bachelor of Electronics & Communication Engineering graduates are able to:

PEO1. Exhibit a strong foundation in the required sciences in order to pursue studies in Electronics and
Communication Engineering.
PEO2. Gain adequate knowledge to become good professional in electronic and communication
engineering associated industries, higher education, and research.
PEO3. Develop attitude in lifelong learning, applying, and adapting new ideas and technologies as their
field evolves.
PEO4. Critically analyze existing literature in an area of specialization and ethically develop
innovative and research-oriented methodologies to solve the problems identified.
PEO5. Practice a professional and ethical attitude and an ability to visualize the engineering issues in a
broader social context.
MEENAKSHI COLLEGE OF ENGINEERING
12,Vembuli Amman Kovil Street, West K.K Nagar, Chennai – 78
Department of Electronics &Communication Engineering
Program Name: B.E(Electronics and Communication )
PROGRAMME OUTCOMES (POs):
MCE B.E(ECE) students at the time of graduation are able to exhibit
PO 1 Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and
an engineering specialization to the solution of complex engineering problems.
PO 2 Problem analysis: Identify, formulate, review research literature, and analyze complex engineering
problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
PO 3 Design/development of solutions: Design solutions for complex engineering problems and design system
components or processes that meet the specified needs with appropriate consideration for the public health and
safety, and the cultural, societal, and environmental considerations.
PO 4 Conduct investigations of complex problems: Use research-based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of the information to provide
valid conclusions.
PO 5 Modern tool usage: Create, select, and apply appropriate techniques, resources ,and modern engineering
and IT tools including prediction and modeling to complex engineering activities with an understanding of the
limitations.
PO 6 The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
PO 7 Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development.
PO 8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the
engineering practice.
PO 9 Individual and team work: Function effectively as an individual, and as a member or leader in diverse
teams, and in multidisciplinary settings.
PO 10 Communication: Communicate effectively on complex engineering activities with the engineering
community and with society at large, such as, being able to comprehend and write effective reports and design
documentation, make effective presentations, and give and receive clear instructions.
PO 11 Project management and finance: Demonstrate knowledge and understanding of the engineering and
management principles and apply these to one’s own work, as a member and leader in a team, to manage
projects and in multidisciplinary environments.
PO 12 Life-long learning: Recognize the need for, and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
PROGRAM SPECIFIC OUTCOMES (PSOs)
PSO1: Design, develop and analyze electronic systems through application of relevant electronics,
mathematics and engineering principles.
PSO2: Design, develop and analyze communication systems through application of fundamentals from
communication principles, signal processing, and RF System Design & Electromagnetics.
PSO3: Adapt to emerging electronics and communication technologies and develop innovative solutions for
existing and newer problems.
SYLLABUS

PRACTICAL EXERCISES: 30 PERIODS

Experiments using 8051


1. Programming Arithmetic and Logical Operations in 8051.
2. Generation of Square waveform using 8051.
3. Programming using on – Chip ports in 8051.
4. Programming using Serial Ports in 8051.
5. Design of a Digital Clock using Timers/Counters in 8051.

Experiments using ARM


1. Interfacing ADC and DAC
2. Blinking of LEDs and LCD
3. Interfacing keyboard and Stepper Motor.

Mini projects for IoT


1. Garbage Segregator and Bin Level Indicator
2. Colour based Product Sorting
3. Image Processing based Fire Detection
4. Vehicle Number Plate Detection
5. Smart Lock System

CONTENT BEYOND THE SYLLABUS


IMPLEMENTING ZIGBEE PROTOCOL WITH ARM

INTERFACING TEMPERATURE SENSOR

COURSE OUTCOMES:

CO1: Explain the architecture and features of 8051.

CO2: Develop a model of an embedded system.

CO3: List the concepts of real time operating systems.

CO4: Learn the architecture and protocols of IoT.

CO5: Design an IoT based system for any application.


EXP NO:
BASIC ARITHMETIC AND LOGICAL OPERATIONS USING 8051

DATE: A. 8 BIT ADDITION


AIM:

To write a program to add two 8-bit numbers using 8051 microcontrollers.

ALGORITHM:

1. Clear Program Status Word.


2. Select Register bank by giving proper values to RS1 & RS0 of PSW.
3. Load accumulator A with any desired 8-bit data.
4. Load the register R 0 with the second 8- bit data.
5. Add these two 8-bit numbers.
6. Store the result.
7. Stop the program.
FLOW CHART:
Start

Clear PSW

Select Register

Load A and R0 with 8 – bit data‟s

ADD A & R0

Store the sum

Stop
PROGRAM:

Label Address Mnemonics Hex code Comments


Opcode Operand
START: 4100 CLR C C3 Clear CY Flag
4101 MOV A,#0A 74 0A Get the data1 in Accumulator
4103 ADDC A,#10 34 10 Add the data1 with data 2
4105 MOV DPTR,#4500 90 45 00 Initialize the memory location
4108 MOVX @DPTR,A F0 Store the result in memory location
L1 4109 SJMP L1 80 FE Stop the program

Address Output

RESULT:

Thus the 8051 Assembly Language Program for addition of two 8 bit numbers was
executed.
FLOW CHART:
Start

Clear Carry Flag

Get 1‟st Operation in ACCR

Subtract the 2‟nd operand


from

IS
CF=1

Increment the Borrow Register

Store Result in Memory

Stop
EXP NO: B. 8 BIT SUBTRACTION
DATE
AIM:

To perform subtraction of two 8 bit data and store the result in memory.

ALGORITHM:

1. Clear the carry flag.


2. Initialize the register for borrow.
3. Get the first operand into the accumulator.
4. Subtract the second operand from the accumulator.
5. If a borrow results increment the carry register.
6. Store the result in memory.

PROGRAM:

Label Address Mnemonics Hex code Comments


Opcode Operand

START: 4100 CLR C C3 Clear CY Flag


4101 MOV A,#0A 74 0A Get the data1 in Accumulator
4103 SUBB A,#05 94 05 Subtract data2 from data1
4105 MOV DPTR,#4500 90 45 00 Initialize memory location
4108 MOVX @DPTR,A F0 Store the difference in memory location
4109
L1 SJMP L1 80 FE Stop the program
Address Out
put

RESULT:

Thus the 8051 Assembly Language Program for subtraction of two 8 bit numbers was
executed.
FLOW CHART:

Start

Get Multiplier in ACCR

Get Multiplicand in B Register

Multiply A with B

Store Result in Memory

Stop

EXP NO: C. 8 BIT MULTIPLICATION


DATE

AIM:
To perform multiplication of two 8 bit data and store the result in memory.

ALGORITHM:

1. Get the multiplier in the accumulator.


2. Get the multiplicand in the B register.
3. Multiply A with B.
Store the product in memory
PROGRAM:

Label Address Mnemonics Hex code Comments


Opcode Operand
START: 4100 MOV A,#05 74 05 Store data1 in accumulator
4102 MOV B,#03 75 F0 03 Store data2 in B register
4105 MUL AB A4 Multiply both
4106 MOV DPTR,#4500 90 45 00 Initialize memory location
4109 MOVX @DPTR,A F0 Store lower order result
410A INC DPTR A3 Go to next memory location
410B MOV A,B E5 F0 Store higher order result
410D MOVX @DPTR,A F0
L1 410E SJMP L1 80 FE Stop the program

Address Output

RESULT:

Thus the 8051Assembly Language Program for multiplication of two 8 bit numbers was
executed.
FLOW CHART:
Start

Get Dividend in ACCR

Get Divisor in B Register

Divide A by B

Store Quotient & Remainder in


Memory

Stop

EXP NO: D. 8 BIT DIVISION


DATE

AIM:

To perform division of two 8 bit data and store the result in memory.

ALGORITHM:

1. Get the Dividend in the accumulator.


2. Get the Divisor in the B register.
3. Divide A by B.
Store the Quotient and Remainder in memory

PROGRAM:

Label Address Mnemonics Hex code Comments


Opcode Operand
START: 4100 MOV A,#15 74 15 Store data1 in accumulator
4102 MOV B,#03 75 F0 03 Store data2 in B register
4105 DIV AB 84 Divide
4106 MOV DPTR,#4500 90 45 00 Initialize memory location
4109 MOVX @DPTR,A F0 Store remainder
410A INC DPTR A3 Go to next memory location
410B MOV A,B E5 F0 Store quotient
410D MOVX @DPTR,A F0
L1 410E SJMP L1 80 FE Stop the program

Input Output

Memory Location Data Memory Location Data

RESULT:

Thus the 8051 8051Assembly Language Program for division of two 8 bit numbers was
executed.
FLOW CHART:
START

Get the first data

Get the second data

Logically AND first data with


second data

Initialize the memory

Move the resultant value into memory

STOP

EXP NO: D. MASKING BITS IN AN 8 – BIT NUMBER


DATE

AIM:
To write an assembly language program to mask bits o and 7 of an 8 – bit number and
store the result in memory using 8051 microcontrollers.

APPARATUS REQUIRED:
8051 microcontroller kit
ALGORITHM:
Masking bits in a 8 bit number
• Start the process
• Get the two data values
• Get the second data
• Logically „AND‟ the two data values.
• Initialize the memory value and store the result in memory.
• Start the process

PROGRAM:

Label Address Mnemonics Hex code Comments


Opcode Operand
START 4100 MOV A,#87 74 87
4102 ANL A,#7E 54 7E

4104 MOV DPTR,#4500 90 45 00

4107 MOVX @DPTR,A F0

L1 4108 SJMP L1 80 FE

Output
Memory Location Data

RESULT:

Thus the 8051assembly language program for masking bits was executed and verified
a) 1‟s and 2‟s complement
START

Get the input value

Get the complement

Initialize the data pointer value

Move the data to data pointer

Increment the data value and


data point memory

Move the value to the memory

STOP
EXP NO: FIND 1”S & 2‟S COMPLEMENT OF A NUMBER
DATE
AIM:-
To write an assembly language to perform arithmetic, logical and bit manipulation instruction using
8051.

ALOGRITHM:
a) 1‟s and 2‟s complement
• Get the value
• Get the complement value of data.
• Initialize the data pointer value as memory.
• Move the complemented value to memory of data pointer.
• Increment the value and memory.
• Store the result in memory.
• Stop the process.

a) 1‟s and 2‟s


complement PROGRAM:
Label Address Mnemonics Hex code Comments
Opcode Operand
4100 MOV A, #02 74, 02 Get the initial value
4102 CPL A F4 Complement the value
4103 MOV DPTR, # 4200 90, 42, 00 Initialize the memory
4106 MOVX @ DPTR, A F0 Move the data to memory
4107 INC A 04 Increment Accumulator
4108 INC DPTR A3 Increment the memory
4109 MOVX @ DPTR, A F0 Move the value to memory
410A SJMP Continue the process.
ECE 80, FE
ECE:
1‟s and 2‟s complement

Output

Memory Location Data


RESULT:
Thus the assembly language program to find 1”s & 2‟s complement,was executed and verified
successfully using 8051 microcontroller.

EXP NO: INTERFACING OF DAC


DATE

AIM:
To interface the DAC with 8051 microcontroller and generate the square wave, saw tooth wave and
triangular wave.

REQUIREMENTS:

S.No Hardware & Software Requirements Quantity


1 8051 Trainer Kit 1No
2 Power Chord 1No
3 DAC interfacing board 1 No
4 CRO 1 No
CIRCUIT DIAGRAM:

WAVEFORMS:

SQUARE WAVE

ADDRESS LABEL MNEMONICS OPCODE COMMENTS

4100 MOV DPTR, # E0C0 90,FF,C8 Move the immediate


Data EOCO
4103 ST ART MOV A, # 00 74,00
Initialize the Accumulator
4105 MOVX @ DPTR, A F0 To zero
4106 LCALL DELAY 12,41,12 Long call the delay
4109 MOV A, # FF 74,FF Move the content of
Accumulator to FF
410B MOVX @ DPTR, A F0 Long call delay
410C LCALL DELAY 12,41,12 Long jump to start
410F LJMP START 02,41,03 Move the 05 data
To R register
4112 DELAY MOV R1, # 05 79,05 Decrement Jump NON zero
Return to main program
Short jump to start
4114 LOOP MOV R2, # FF 74,FF
4116 HE RE DJNZ R2, HERE DA,FE
4118 DJNZ R1, LOOP D9,FA
411A RET 22
411C SZMP START 80,E3

OBSERVATION:

AMPLITUDE TIME PERIOD


RESULT:
Thus, DAC with 8051 microcontroller and generate the square wave, saw tooth wave and triangular
wave has been verified.
EXP NO:
Programming using on-Chip ports in 8051.
DATE

AIM:
To Write a program to toggle all the bits of P0, P1,and P2 every 1/4 of a second.

Apparatus Required: S/W : KEIL µ5 IDE.

Program:
ORG 00h
SJMP
MAIN ORG
30H MAIN:
BACK: MOV A,#55H
MOV P0,A
MOV P1,A
MOV P2,A
ACALL QSDELAY ;Quarter of a second
MOV A,#0AAH
MOV P0,A
MOV P1,A MOV
P2,A
ACALL
QSDELAY SJMP
BACK QSDELAY:
MOV R5,#11
H3: MOV R4,#248
H2: MOV R3,#255
H1: DJNZ R3,H1 ;4 MC for DS89C4x0
DJNZ R4,H2
DJNZ R5,H3
RET
END
Result:

Thus, to toggle all the bits of P0, P1,and P2 every 1/4 of a second verified successfully.
EXP NO:
PROGRAMMING USING SERIAL PORTS IN 8051
DATE

AIM:
To send the data serially with the desired baud rate. (In assembly)

Apparatus Required: S/W : KEIL µ5 IDE

Program:
ORG 00h
SJMP
MAIN ORG
30H MAIN:
MOV TMOD,#20H ;timer 1,mode 2(auto reload)
MOV TH1,#-3 ;9600 baud rate
MOV SCON,#50H ;8-bit, 1 stop, REN enabled
SETB TR1 ;start timer 1
AGAIN: MOV A,#'E' ;transfer “E”
ACALL TRANS
MOV A,#'C' ;transfer “C”
ACALL TRANS
MOV A,#'E' ;transfer “E”
ACALL TRANS
SJMP AGAIN ;keep doing it
;serial data transfer subroutine
TRANS: MOV SBUF,A ;load SBUF
HERE: JNB TI,HERE ;wait for the last bit
CLR TI ;get ready for next byte
RET
END
Result:
Thus, the data serially with the desired baud rate verified successfully.
EXP NO: Digital Clock
DATE

AIM:
To display the digital clock specifically by displaying the hours, minutes and secondsusing 8051 kits.
PROGRAM:
Observation:
Input

Output:
Time is displayed in the RTC board as
! Hour ŀ Minutes ŀ seconds ŀ
X

RESULT:
Thus the digital clock program has been written and executed using 8086
microprocessor kit and the output of digital clock was displayed as [hours:
minutes: seconds] successfully.
EXP NO:
Interfacing ADC
DATE
Aim:
To write an embedded ‘C’ program to make the onboard LED’s to flash/blink according
to the ADC value.

Apparatus Required:
Hardware Requirement:
✓ Development Board (NXP LPC2148 MICROCONTROLLER) ✓ A ULINK
USB-JTAG Adapter.
✓ IBM-compatible PC with 2 USB port and cable to power the board and ULINK ✓
RS232 COM port for (ISP) via serial interface(Need Flash magic utility)

Software Requirement:

✓ Keil Professional Development Suite for ARM.(KEIL μVision-4)

Embedded ‘C’-Program:
#include <LPC214X.H>

#include <stdio.h>
extern void init_serial (void) ; /* Initialize Serial Interface */

extern int sendchar (int ch); /* Write character to Serial Port */

extern int getkey (void); /* Read character from Serial Port */

void sendhex (int hex) /* Write Hex Digit to Serial Port */

{ if (hex > 9) sendchar('A' + (hex - 10));

else sendchar('0' + hex);

void sendstr (char *p) /* Write string */


{ while (*p)
{ sendchar (*p++);

}
void delay (void) /* Delay function */
{ unsigned int cnt;
unsigned int val;

AD0CR |= 0x01000000; /* Start A/D Conversion */


do { val = AD0DR1; /* Read A/D Data Register */

}
/* Wait for end of A/D Conversion
while ((val & 0x80000000) == 0);
*/
AD0CR &= ~0x01000000; /* Stop A/D Conversion */

val = (val >> 6) & 0x03FF; /* Extract AIN0 Value */

sendstr ("\nAIN0 Result = 0x"); /* Output A/D Conversion Result */

sendhex((val >> 8) & 0x0F); /* Write 1. Hex Digit */

sendhex((val >> 4) & 0x0F); /* Write 2. Hex Digit */

sendhex (val & 0x0F); /* Write 3. Hex Digit */

val = (val >> 2) << 12; /* Adjust Delay Value */

for (cnt = 0; cnt < val; cnt++); /* Delay */


}

int main (void)

{ unsigned int n;

IODIR1 = 0x00FF0000; /* P1.16..23 defined as Outputs */

PINSEL1 = 0x01000000;

AD0CR = 0x002E0402; /* Setup A/D: 10-bit AIN1 @ 3MHz */


init_serial(); /* Initialize Serial Interface */

while (1) /* Loop forever */

{
/* Blink LED 0, 1, 2, 3, 4, 5, 6, 7
for (n = 0x00010000; n <= 0x00800000; n <<= 1) */
{

IOSET1 = n; /* Turn on LED */ delay(); /* Delay */

IOCLR1 = 0x00FF0000; /* Turn off LEDs */

}
Output:

Analog Digital
input output
RESULT:
Thus the embedded ‘C’ program to make the onboard LED’s to flash/blink according to
the ADC value has done successfully and verified the output onboard.
EXP NO:
Interfacing DAC
DATE

Aim:
To write an embedded ‘C’ program to interface dual scope DAC to convert the digital
value into analog wave form and to view the output in CRO.

Apparatus Required:
Hardware Requirement:

✓ Development Board (NXP LPC2148 MICROCONTROLLER) ✓ A ULINK USB-JTAG Adapter.


✓ IBM-compatible PC with 2 USB port and cable to power the board and ULINK
✓ RS232 COM port for (ISP) via serial interface(Need Flash magic utility)
✓ DAC interface board and external power supply Software Requirement:

✓ Keil Professional Development Suite for ARM.(KEIL μVision-4)

Embedded ‘C’-Program:

#include <lpc21xx.h>

void delay()

unsigned int i; for(i = 0; i

<= 10000; i ++);

int main()
{
PINSEL2 = 0x00000004; /*Configure the (p1.16-p1.23) lines as gpio
signals*/
/*Configure the gpio1 (p1.16-p1.23) as output
IODIR1 = 0x00ff0000; lines*/
while(1)

IOSET1 = 0x00ff0000; /*Output 0xff to gpio1 and 0x00 follwed with delay*/

delay();

IOCLR1 = 0x00ff0000;
delay();

Output:

Sine wave

RESULT:
Thus an embedded ‘C’ program to interface dual scope DAC to convert the digital
value into analog wave form has been written and corresponding output waveform is captured in
CRO.
EXP NO:
DATE LED & FLASHING OF LED”S

AIM:
To write and execute the program for LED & Flashing Led‟s with ARM7
(LPC2148) processor.

HARDWARE & SOFTWARE TOOLS REQUIRED:

S.No Hardware & Software Requirements Quantity

1 ARM Processor board 1


2 USB/FRC Connector few
3 LED Module 1
4 Power Supply adaptor (5V, DC) 1
5 Keil & flash magic Software 1

PROCEDURE

1. Create a New project, Go to “Project” and close the current project “Close Project”.
2. Next Go to the Project New μvision Project Create New Project Select Device for Target.
3. Select the data base NXP LPC2148.
4. Add Startup file and Next go to “File” and click “New”.
5. Write a program on the editor window and save as “Main.c”.
6. Add this source file to Group and click on “Build Target” or F7.
7. Create a Hex file from “Project” menu and click on “Rebuild all target Files”.
8. Open Flash magic and select the device LPC2148 in ARM 7 category, Choose the hardware
connected COM port, baud rate 9600, interface None [ISP], Oscillator frequency
12.0 MHz and click on erase of flash code Rd plot.
9. Next browse the path of hex file and select the file.
10. After selecting ISP mode on the Hardware Kit and click on start then device will start to
program
11.Finally can be see the finished indication and values in SPJ Terminal and Reset the device into
running mode.
LED INTERFACING:

CIRCUIT DIAGRAM:
P R O G RA M:

#include <lpc214x.h> int


i; int main()
{ IODIR0=(1<<3
);
while(1)
{ IOSET0=(1<<3
); for(i=0;i<120000;i++);
IOCLR0=(1<<3);
for(i=0;i<120000;i++);
}
}

|
FLASHING OF LED:
CIRCUIT DIAGRAM:

PROGRAM:

TYPE-I:

|
#include <lpc214x.h> int
i; int main()
{ IODIR0=0x000000F F;
while(1)
{ IOSET0=0x000000A
A; for(i=0;i<120000;i+
+);
IOCLR0=0x000000AA;
for(i=0;i<120000;i++);
}
}

TYPE-II:
#include <lpc214x.h> int
i,b;
int main()
{ IODIR0=0x000000F F;
while(1)
{ for(b=0;b<8;b+
+)
{ IOSET0=(1<<b
); for(i=0;i<120000;i++);
IOCLR0=(1<<b);
for(i=0;i<120000;i++);
}
}
}

|
TYPE-III

#include <lpc214x.h> int i;


int main()
{ IODIR0=(1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|
(1<<7
);
while(1)
{ IOSET0=(1<<0
); for(i=0;i<120000;i++);
IOCLR0=(1<<0); for(i=0;i<120000;i+
+); IOSET0=(1<<1);
for(i=0;i<120000;i++);
IOCLR0=(1<<1); for(i=0;i<120000;i+
+); IOSET0=(1<<2);
for(i=0;i<120000;i++);
IOCLR0=(1<<2); for(i=0;i<120000;i+
+); IOSET0=(1<<3);
for(i=0;i<120000;i++);
IOCLR0=(1<<3); for(i=0;i<120000;i+
+); IOSET0=(1<<4);
for(i=0;i<120000;i++);
IOCLR0=(1<<4); for(i=0;i<120000;i+
+); IOSET0=(1<<5);
for(i=0;i<120000;i++);
IOCLR0=(1<<5); for(i=0;i<120000;i+
+); IOSET0=(1<<6);
for(i=0;i<120000;i++);
IOCLR0=(1<<6); for(i=0;i<120000;i+
+); IOSET0=(1<<7);
for(i=0;i<120000;i++);
IOCLR0=(1<<7); for(i=0;i<120000;i+
+);
}
}

F RONT AN D BACK L ED:

#include <lpc214x.h> int


b,i;
int main()
{ IODIR0=0x000000F F;
while(1)
{ for(b=0;b<8;b+
+)
{ IOSET0=(1<<b
); for(i=0;i<120000;i++);
IOCLR0=(1<<b);
for(i=0;i<120000;i+
+); }
for(b=7;b>=0;b--)
{ IOSET0=(1<<b
); for(i=0;i<120000;i++);
IOCLR0=(1<<b); for(i=0;i<120000;i+
+);
}
}
}
SWITCHCONTROLLED LED (1-SWITCH): CIRC
UI T DIAGR A M:
P R O G RA M:

#include <lpc214x.h>
int i,b;
int
main()
{ IODIR0=0x000000
F F;
IODIR0=~(1<<16);
while(1)
{ if((IOPIN0&(1<<16))==0
)
{ for(b=0;b<8;b
++)
{ IOSET0=(1<<b
);
for(i=0;i<120000;i++);
IOCLR0=(1<<b);
for(i=0;i<120000;i++);
}}
els
e
{ IOCLR0=0x000000F
F;
}
}
}
SWITCH CONTROLLED LED (2-SWITCH):
CIRC UI T DIAGR A M:

PROGRAM:
#include <lpc214x.h>
int i,b; int
main()
{ IODIR0=0x000000F
F;
IODIR0=~(1<<16)&~(1<<23);
while(1)
{ if((IOPIN0&(1<<16))==0
)
{ for(b=0;b<8;b+
+)
{ IOSET0=(1<<b
);
for(i=0;i<120000;i++);
IOCLR0=(1<<b);
for(i=0;i<120000;i++);
}
}
else if((IOPIN0&(1<<23))==0)
{ for(b=7;b>=0;b--
)
{ IOSET0=(1<<b
);
for(i=0;i<120000;i++);
IOCLR0=(1<<b);
for(i=0;i<120000;i++);
}}
els
e
{ IOCLR0=0x000000F
F;
}
}
Output:
RESULT

The program for LED & Flashing Led‟s with ARM7 (LPC2148) processor was executed successfully.

EXP NO:
INTERFACING OF LCD
DATE

AIM:
To write and execute the program for LCD with ARM7 (LPC2148) processor.

HARDWARE & SOFTWARE TOOLS REQUIRED:

S.No Hardware & Software Requirements Quantity

1 ARM Processor board 1


2 USB/FRC Connector few
3 LED Module 1
4 Power Supply adaptor (5V, DC) 1
5 Keil & flash magic Software 1
PROCEDURE

1. Create a New project, Go to “Project” and close the current project “Close Project”.
2. Next Go to the Project New μvision Project Create New Project Select Device for Target.
3. Select the data base NXP LPC2148.
4. Add Startup file and Next go to “File” and click “New”.
5. Write a program on the editor window and save as “Main.c”.
6. Add this source file to Group and click on “Build Target” or F7.
7. Create a Hex file from “Project” menu and click on “Rebuild all target Files”.
8. Open Flash magic and select the device LPC2148 in ARM 7 category, COM port will be
COM 3, baud rate 9600, interface None [ISP], Oscillator frequency 12.0 MHz and c lick on
erase of flash code Rd plot.
9. Next browse the path of hex file and select the file.
10. After selecting ISP mode on the Hardware Kit and click on start then device will
start to program
11.Finally can be see the finished indication and values in SPJ Terminal and Reset the
device into running mode.

INTERFACING LCD:

CIRCUIT DIAGRAM:
Meenakshi College of
Engineering

PROGRAM:

#include <lpc214x.h>
#include <lcd.h>
int main()
{
LCD_INIT();
LCDSTR(0x00000084,"Meenakshi");
LCDSTR(0x000000C2,"Engineering College");
while(1)
{
}
}

LCD LAYOUT:

80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F

C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF

OUTPUT:
RESULT:
The program for LCD with ARM7 (LPC2148) processor was executed successfully.
EXP NO:
INTERFACING OF MATRIX KEYBOARD
DATE

AIM:
To write and execute the program for Matrix Keyboard with ARM7 (LPC2148) processor.
HARDWARE & SOFTWARE TOOLS REQUIRED:

S.No Hardware & Software Requirements Quantity

1 ARM Processor board 1


2 USB/FRC Connector few
3 LCD Module 1
4 Power Supply adaptor (5V, DC) 1
5 Keil & flash magic Software 1
6 Matrix Keypad Module 1

PROCEDURE

1. Create a New project, Go to “Project” and close the current project “Close Project”.
2. Next Go to the Project New μvision Project Create New Project Select Device for Target.
3. Select the data base NXP LPC2148.
4. Add Startup file and Next go to “File” and click “New”.
5. Write a program on the editor window and save as “Main.c”.
6. Add this source file to Group and click on “Build Target” or F7.
7. Create a Hex file from “Project” menu and click on “Rebuild all target Files”.
8. Open Flash magic and select the device LPC2148 in ARM 7 category, COM port will be
COM 3, baud rate 9600, interface None [ISP], Oscillator frequency 12.0 MHz and click on
erase of flash code Rd plot.
9. Next browse the path of hex file and select the file.
10. After selecting ISP mode on the Hardware Kit and click on start then device will
start to program
11.Finally can be see the finished indication and values in SPJ Terminal and Reset the
device into running mode.

KEYBOARD INTERFACING:

CIRCUIT DIAGRAM:
PROGRAM:

#include <lpc214x.h>
#include <lcd.h>
#include <keyboard.h>
int main()
{
LCD_INIT();
LCDSTR(0x00000080,"Matrix Keypad");
LCDSTR(0x000000C0,"Key Pressed: "); while(1)
{
IO0CLR = CLR; IO0SET = C1; delay_ms(10);
if(scan(R1))LCDSTR(0x000000CC,"0"); //K1
if(scan(R2))LCDSTR(0x000000CC,"4"); //K5
if(scan(R3))LCDSTR(0x000000CC,"8"); //K9
if(scan(R4))LCDSTR(0x000000CC,"C");
//K13
IO0CLR = CLR;
IO0SET = C2;
if(scan(R1))LCDSTR(0x000000CC,"1"); //K2
if(scan(R2))LCDSTR(0x000000CC,"5"); //K6
if(scan(R3))LCDSTR(0x000000CC,"9");
//K10
if(scan(R4))LCDSTR(0x000000CC,"D");
//K14
IO0CLR = CLR; IO0SET = C3;
if(scan(R1))LCDSTR(0x000000CC,"2"); //K3
if(scan(R2))LCDSTR(0x000000CC,"6"); //K7
if(scan(R3))LCDSTR(0x000000CC,"A");
//K11
if(scan(R4))LCDSTR(0x000000CC,"E");
//K15
IO0CLR = CLR;
IO0SET = C4;
if(scan(R1))LCDSTR(0x000000CC,"3"); //K4
if(scan(R2))LCDSTR(0x000000CC,"7"); //K8
if(scan(R3))LCDSTR(0x000000CC,"B");
//K12
if(scan(R4))LCDSTR(0x000000CC,"F");
//K16
}
}
Output:
RESULT:
The program for Matrix Keyboard with ARM7 (LPC2148) processor was executed successfully.
EXP NO: INTERFACING OF STEPPER MOTOR

DATE
AIM:
To write and execute the program for Stepper Motor with ARM7 (LPC2148) processor.

HARDWARE & SOFTWARE TOOLS REQUIRED:


S.No Hardware & Software Requirements Quantity

1 ARM Processor board 1


2 USB/FRC Connector few
3 Stepper Motor Module 1
4 Power Supply adaptor (5V, DC) 1
5 Keil & flash magic Software 1

PROCEDURE
1. Create a New project, Go to “Project” and close the current project “Close Project”.
2. Next Go to the Project New μvision Project Create New Project Select Device for Target.
3. Select the data base NXP LPC2148.
4. Add Startup file and Next go to “File” and click “New”.
5. Write a program on the editor window and save as “Main.c”.
6. Add this source file to Group and click on “Build Target” or F7.
7. Create a Hex file from “Project” menu and click on “Rebuild all target Files”.
8. Open Flash magic and select the device LPC2148 in ARM 7 category, COM port will be COM
3, baud rate 9600, interface None [ISP], Oscillator frequency 12.0 MHz and click on erase of flash
code Rd plot.
9. Next browse the path of hex file and select the file.
10. After selecting ISP mode on the Hardware Kit and click on start then device will start to
program
11. Finally can be see the finished indication and values in SPJ Terminal and Reset the
device into running mode.
STEPPER MOTOR: (FORWARD ROTATION)
CIRCUIT DIAGRAM:
P R O G RA M:

#include <lpc214x.h>
#include <delay.h>

int main()
{ IODIR0=(1<<16)|(1<<17)|(1<<18)|(1<<19
);
while(1)
{
//FORWARD DIRECTION
IOCLR0=(1<<16);
IOCLR0=(1<<17);
IOSET0=(1<<18);
IOSET0=(1<<19);
delay_ms(10);
IOCLR0=(1<<16);
IOSET0=(1<<17);
IOSET0=(1<<18);
IOCLR0=(1<<19);
delay_ms(10);
IOSET0=(1<<16);
IOSET0=(1<<17);
IOCLR0=(1<<18);
IOCLR0=(1<<19);
delay_ms(10);
IOSET0=(1<<16);
IOCLR0=(1<<17);
IOCLR0=(1<<18);
IOSET0=(1<<19);
delay_ms(10);
}
}
STEPPER MOTOR: (REVERSE ROTATION)
CIRCUIT DIAGRAM:
PROGRAM:
#include <lpc214x.h>
#include <delay.h>

int main()
{ IODIR0=(1<<16)|(1<<17)|(1<<18)|(1<<19
);
while(1)
{
//REVERSE DIRECTION
IOSET0=(1<<16);
IOCLR0=(1<<17);
IOCLR0=(1<<18);
IOSET0=(1<<19);
delay_ms(10);
IOSET0=(1<<16);
IOSET0=(1<<17);
IOCLR0=(1<<18);
IOCLR0=(1<<19);
delay_ms(10);
IOCLR0=(1<<16);
IOSET0=(1<<17);
IOSET0=(1<<18);
IOCLR0=(1<<19);
delay_ms(10);
IOCLR0=(1<<16);
IOCLR0=(1<<17);
IOSET0=(1<<18);
IOSET0=(1<<19);
delay_ms(10);
}
}
RESULT:
The program for Stepper Motor with ARM7 (LPC2148) processor was executed successfully.
Miniprojects for IOT:
1. Garbage Segregator and Bin Level Indicator
2. Colour based Product Sorting
3. Image Processing based Fire Detection
4. Vehicle Number Plate Detection
5. Smart Lock System

Objective:

To apply the knowledge, they gained in doing the experiments.

Team constitution:
A team size may be from 3 to 4 students.

Guidelines:

1. Students shall from a group and can do their mini project.

2. Student must buy their own hardware setup for doing Miniprojects.

3. If they are utilizing the college resource, they should get approval from HoD.

4. At the end, a report along with hardware must be submitted to college.

5. If required students need to present their work as presentation.


Garbage Segregator and Bin Level Indicator

IDEA:

With progress in human technology we have seen a substantial progress in the amount of waste
generated. Recycling is the only way to manage this huge amount of waste. But recycling requires
garbage to be segregated. Without segregation garbage cannot be recycled because different type
of garbage requires different recycling processes.

Also It is important to educate users and instruct them every time they come near the dustbin
about instructions about throwing the trash. For this purpose we design a garbage disposal system
that uses multiple dustbins with a voice based system that speaks to the user each time he she
stands before the dustbin.

The system makes use of a camera to detect presence if any person in front of the dustbin. If a
person is detected, the system issues voice instructions to the user about throwing right garbage in
the right bin. In case the dustbin is full it instructs the user to find another dustbin to throw
garbage in.

To develop this system we make use of a raspberry Pi controller. The controller is interfaced with
a camera and a voice speaker for detection and communication. The controller gets dustbin level
input using ultrasonic level sensors each having LED indicators interfaced to it. The level sensors
are used to constantly feed the raspberry pi with bin levels.

The raspberry pi is also interfaced with a Wifi module to transmit the level data over the internet.
The Level sensor panels are made to be easily mounted over any dustbin. This allows the system
to be easily screwed over any dustbin for instant installation.

The data is transmitted over IOT to IOT gecko platform which displays the bin level data over
internet. This indication can be used to alert the authorities that the garbage bins need to be
emptied. Thus the system automates garbage segregation and level monitoring to help counter the
garbage crisis using IOT.

Note: The Dustbins are not included in this kit. The sensors can be mounted over any open
dustbins.

Components

Raspberry Pi

Wifi Module
Ultrasonic Level Sensors
LED Indicators

Camera

Speaker

Wiring

Supporting Frame

Buttons & Switches

Screws & Bolts

Resistors

Capacitors

Diodes

IC‟s

Transistors

Connectors

PCB
Colour based Product Sorting

IDEA:

Color Based Object Sorting has a wide usage in fruit sorting as well as candy sorting industries.
This system puts forward a mechanism to detect color and sort items through ima ge processing.
Once identified a mechanism is used to sort the candies into particular bins baskets. We here
demonstrate this mechanism using a camera with electronic circuitry along with sorting
mechanism using 3 bins. The system uses raspberry pi connected to a controller circuit to achieve
this task. The controller circuit consists of a camera attached to it that detects color of a sma ll
object in front of it. A motor is used to feed an object to the camera chamber. As soon is the color
is detected a signal is sent to the sorter mechanism which uses a motor to position the sorting tube
towards respective section. A feeder is then used to push the object towards the tubs so that it gets
sorted and next object is pulled in by the feeder. The action details are sent to the IOT server using
iotgecko platform to keep track of the number of objects sorted in each section. Thus, we achieve
a completely automated IOT based sorting system.

Hardware Specifications

Raspberry Pi 3
Camera

Servo Motor

LCD Display

Resistors

Capacitors

Transistors

Cables and Connectors

Diodes

PCB and Breadboards

LED

Transformer/Adapter

Push Buttons

Switch
IC

IC Sockets

Connector Shaft

Bed Frame

Tubes

Screws & Joints

Supporting Frame

Software Specifications

Programming Language:

Python

IOTGecko

BLOCK DIAGRAM:
Image Processing based Fire Detection

IDEA:

The main advantage of Image Processing Based Fire Detection System is the early
warning benefit. This system can be installed just about anywhere in a commercial
building, malls and at many more public places for fire detection. This system uses camera
for detecting fires. So we do not need any other sensors to detect fire. System processes the
camera input and then processor processes it to detect fires. The heat signatures and fire
illumination patterns are detected in images to determine if it is a fire and take action
accordingly. On detecting fire system goes into emergency mode and sounds an alarm.
Also displays the status on the LCD display informing about the system.

Hardware Specifications

Raspberry Pi 3

Camera

Buzzer

LCD Display

Resistors
Capacitors

Transistors

Cables and Connectors

Diodes

PCB and Breadboards

LED

Transformer/Adapter

Push Buttons

Switch

IC

IC Sockets
Software Specifications

Linux

Programming Language: Python

BLOCK DIAGRAM:

Vehicle Number Plate Detection

IDEA:
SMART LOCKSYSTEM

IDEA:

From connected cars to connected wearables to home security, the Internet of Things is rapidly marking
its presence in every field. Now we have IoT enabled home automation and security devices that can
be controlled from anywhere in the world using the Internet of Things. There are many kinds of Wi-Fi
door lock available in the market which makes your home more secure and saves time in finding the
keys. Here we are also building a similar Wi-Fi door lock which can be controlled from the Smartphone

So in this project, we are going to make an IOT based Door Lock System using NodeMCU,
Solenoid Lock, and Adafruit IO. Here NodeMCU will act as the main controller and connect the
user to the door lock system using the Internet. This allows the user to lock/unlock his Home‟s
door lock by using a smartphone from anywhere in the world.

Components Required

NodeMCU ESP8266
Reference:
https://www.researchgate.net/publication/367087623_Smart_Door_Locking_System_Using_IoT
CONTENT BEYOND THE SYLLABUS
EXP NO: INTERFACING TEMPERATURE SENSOR

DATE
Aim
To write C Programs for running stepper motor either in clock-wise or
counterclockwise and the direction of the rotation of the stepper motor depends on the
variation in the temperature sensor.

Apparatus & Software Required 1.


LPC2148 syllabus board.

2. IAR IDE software.


3. Flash Magic.
4. temperature sensor.

Temperature Sensor
The temperature sensor that is used here is LM35. The LM35 series are precision
integrated-circuit temperature sensors, whose output voltage is linearly proportional to the
Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear
temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large
constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does
not require any external calibration.

Procedure
• Follow the steps 1 of How to create a New project
• Type the below code and save it with the name temp.c (anyname.c)
• Follow the steps 2 and 3 of How to create a New Project to compile and build the
program

• Follow the procedures in How to Download a Code to Our Controller to download


your code.
Program
/* - - - - - header files --------- */
#include<nxp\iolpc2148.h>
#include<stdio.h>
#include "uart.h"
#include "adc.h"
/* - - - - - user defined variables ---------- */ unsigned
int val=0,volt;

/* - - - - - main function --------- */ void


main(void)

{
PINSEL1_bit.P0_28=1;
init(); uart_inital(); adc();

PINSEL1=0X01000000; //ADC0.1
while(1)

{
while(AD0DR_bit.DONE==0); // Start A/D Conversion
val=AD0DR1_bit.RESULT; volt=val/3.07;

printf("Temperature = %ddegree \n\r",volt);


}
}

Procedure to see OUTPUT:


• Compile, Debug & Simulate the above code in IAR.
• Connect the RS232 cable / USB cable provided to the PC / Laptop and the VSK 2148
Board, and Power on the Board.
• For seeing the output in real-time, select the PROG mode, reset the board and
download the code in VSK-2148 board using Flash Magic through UART0.

• Now connect/interface the stepper motor at the motor port available in the VSK - 2148
Board with proper polarity.
• Now check the jumpers J4 and J6. Jumper J4 has to be left opened whereas jumper J6
has to be closed.

• Now change the Mode-Selection-Switch to EXEC position and reset the board.
• Open Win X- Talk and select the COM port and the desired baud rate as 9600.
• Heat the temperature sensor to view the variation in the temperature change the jumper
setting close the J6 and open the J4 jumper.

• View the output in PC-Hyper Terminal Link.

OUTPUT:

TEMPERARURE SNESOR:

Result:
Thus the interfacing of and temperature sensor has been executed and output is
verified.
EXP NO:
A/D INTERFACE WITH 8051
DATE
AIM:
To write an assembly language program for interfacing of ADC with 8051.

ALGORITHM: -

(i) Start the program


(ii) Make CS=0 and send a low to high pulse to WR pin to start the conversion.
(iii) Now keep checking the INTR pin. INTR will be 1 if conversion is not finished and INTR
will be 0 if conversion is finished.
(iv) If conversion is not finished (INTR=1) , poll until it is finished.
(v) If conversion is finished (INTR=0), go to the next step.
(vi) Make CS=0 and send a high to low pulse to RD pin to read the data from the ADC (vii)
Stop the program
PROCEDURE:

(i) Place jumper J2 in C position


(ii) Place jumper J5 in A position
(iii) Enter and execute the program
(iv) Vary the analog input (using trim pot) and view the corresponding digital value
in LED display,
FLOWCHART:
START

Make CS=0

keep checking the INTR pin

If conversion is not finished


(INTR=1)

If conversion is finished (INTR=0)

STOP

PROGRAM:

Label Address Mnemonics Comments


1000 MOV P1,#11111111B ; initiates P1 as the input port
MAIN: CLR P3.7 ; makes CS=0
1003 SETB P3.6 ;makes RD high
CLR P3.5
1005 ;makes WR low
SETB P3.5
WAIT: 1008 ;low to high pulse to WR for starting
JB P3.4, WAIT
;polls until INTR=0
CLR P3.7 conversion
CLR P3.6 ;ensures CS=0
MOV A,P1 ;high to low pulse to RD for reading
100A CPL A the data from ADC
MOV P0,A ;moves the digital data to
SJMP MAIN accumulator
END ;complements the digital data
100D ;outputs the data to P0 for the LEDs
;Jump to program
100F ;End

Jumper Details:-
From switch CH3

B B
Software A CH0 A
SOC C ALE C CH
From latch
Box
RESULT:

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