0% found this document useful (0 votes)
35 views

Iot Record

The document describes a laboratory record notebook for an embedded systems and IoT lab. It contains information about the college, department, and lab experiments including writing assembly language programs, data transfer, ALU operations, basic C programs, and interfacing with IoT devices.

Uploaded by

SANDHIYA S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Iot Record

The document describes a laboratory record notebook for an embedded systems and IoT lab. It contains information about the college, department, and lab experiments including writing assembly language programs, data transfer, ALU operations, basic C programs, and interfacing with IoT devices.

Uploaded by

SANDHIYA S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

UNIVERSITY COLLEGE OF ENGINEERING TINDIVANAM

(A Constituent college of Anna University,Chennai)


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
B.E. SIXTH SEMESTER
RECORD FOR

CS3691-EMBEDDED SYSTEMS AND IOT


LABORATORY

NAME :

REG NO :

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


UNIVERSITY COLLEGE OF ENGINEERING TINDIVANAM
MELPAKKAM
TINDIVANAM-604001
UNIVERSITY COLLEGE OF ENGINEERING TINDIVANAM
(A Constituent college of Anna University,Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

LABORATORY RECORD NOTE BOOK


2024-2025
This is to certify that this is a bonafide record of the work done

by Mr. / Ms. Register Number

of the III year B.E., Department of Computer Science and Engineering

in the CS3691 EMBEDDED SYSTEMS AND IOT LABORATORY in the

VI Semester.

University Examination held on .

Staff in charge Head of the department

Internal Examiner External Examiner


INDEX
Page
S.no Date Title no Signature
1 Write 8051 Assembly language
experiments using simulators
Test data transfer between registers
2 and memory
Perform ALU operations
3

4 Write basic and arithmetic programs


using embedded C
5 Introduction to Arduino platform and
programming
6 Explore different communication
methods with Iot devices
(Zigbee, GSM, Bluetooth)
7 Introduction to Raspberry PI platform
and python programming
8 Interfacing sensors with Raspberry PI

9 Communicate between Arduino and


Raspberry PI using any wireless
medium
10 Setup a cloud platform to log the data

11 Log Data using Raspberry PI and


upload to the cloud platform
12 Design an IOT based system
STEPS TO CREATE AND COMPILE Keil µVision-3/4/5 PROJECT:
1. Double click on the keil icon on the desktop.
2. Close any previous projects that were opening using project—>close.
3. Start Project – New Project, and select the CPU from the device database(Database-
Atmel- AT89C51ED2 or AT89C51RD2 as per the board).On clicking ‘OK’, the
following option is displayed. Choose ‘No’.
4. Create a source file (using File->New), type in the assembly or C

Program and save this (filename.asm/filename.c) and add this source


fileto the project. using either one of the following two methods. (i)
Project->Manage- >Components, Environment Books-
>addfiles-> browse to the required file -> OK “OR” ii) right
click on the Source Group in the Project Window and the AddFiles to
Group option.

5. Set the Target options using -> Project – Options for Target opens the µ
Options forTarget – Target configuration dialog. Set the Xtal (Crystal frequency)
frequency to 11.0592 MHz, and also the Options for Target– Debug – use either
Simulator / Keil Monitor- 51 driver.

6. If Keil Monitor- 51 driver is used, click on Settings -> COM Port settings
select theCOM Port to which the board is connected and select the baud rate as
19200 or 9600
(recommended). Enable Serial Interrupt option if the user application is not using
on-chipUART, to stop program execution.
7. Build the project; using Project -> Build Project. application and links. Any
errors in the code are indicated by – “Target not created” in the Build window, along
with the errorline. Debug the errors. After an error free, to build go to Debug mode.

8. Now user can enter into Debug mode with Debug- Start / Stop Debug session
dialog. Or by clicking on the icon.
9. The program is run using the Debug-Run command & halted using Debug-
Stop Running. Also, the (reset, run, halt) icons can be used. Additional icons are
(step, stepover, and step into, run till cursor).
10. If it is an interface program the outputs can be seen on the LCD, CRO, motor, led
status, etc. If it is a part-A program, the appropriate memory window is opened using
View ->memory window (for data RAM & XRAM locations), Watch
window (for timer program), serial window, etc.
11. Note: To access data RAM area type address as D: 0020h. Similarly, to access the
DPTRregion (XRAM-present on chip in AT89C51ED2) say 9000h location type
inX:09000H.
EXP. NO:01 WRITE 8051 ASSEMBLY LANGUAGE EXPERIMENTS USING
SIMULATOR.
DATE:

AIM:
To write 8051 assembly language experiments using simulator.

PROCEDURE:
a. Create a new project, go to “Project” and close the current project “Close Project”.
b. Next Go to the Project New μVision Project and Create New Project Select Device
forTarget.
c. Select the device DS2250 or DS2251T or DS2252T.
d. Add Startup file Next go to “File” and click “New”.
e. Write a program on the editor window and save it with .asm extension.
f. Add this source file to Group and click on “Build Target” or F7.
g. Go to debugging mode to see the result of simulation by clicking Run or step run.
h. This program follows the above-mentioned steps to create and compile the project
i. To see the output go to the memory window and enter the memory location like
D:41H.

PROGRAM:
ORG 0000H

CLR C

//Addition

MOV A,#3H

MOV R0,#5H

ADD A,R0

MOV 50H,A

END
OUTPUT:

RESULT:
Thus, the assembly language program for 8051 simulators has been executed
successfully.
EXP.NO:02(i) TEST DATA TRANSFER BETWEEN REGISTERS TO
MEMORY.
DATE:

AIM:
To write and execute an Assembly language program to transfer data between registers
and memory.

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 and Create a New Project Select Device
for the Target.
3. Select the device DS2250 or DS2251T or DS2252T.
4. Add Startup file Next go to “File” and click “New”.
5. Write a program on the editor window and save it with .asm extension.
6. Add this source file to Group and click on “Build Target” or F7.
7. Go to debugging mode to see the result of the simulation by clicking Run or Step
run.
8. This program follows the above-mentioned steps to create and compile the project.
9. To see the output go to the memory window and enter the memory location like
D:50H.

PROGRAM:

MOV R0,#6DH

MOV R1,#3BH

MOV R2,#5AH

MOV 50H,R0

MOV 51H,R1

MOV 52H,R2

END
OUTPUT:

RESULT:
Thus, the assembly language program to Test data transfer between registers to
memory.
EXP.NO: 02(ii)
TEST DATA TRANSFER BETWEEN MEMORY TO
DATE: REGISTER.

AIM:
To write an assembly language program to test data transfer between memory and
register.
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 and Create a New Project Select
Devicefor the Target.
3.Select the device DS2250 or DS2251T or DS2252T.
4.Add Startup file Next go to “File” and click “New”.
5. Write a program on the editor window and save it with .asm extension.
6. Add this source file to Group and click on “Build Target” or F7.
7. Go to debugging mode to see the result of the simulation by clicking Run or Step
run.
8. This program follows the above-mentioned steps to create and compile the project.
9.To see the output go to the memory window and enter the memory
location likeD:50H.

PROGRAM:

MOV 50H,#5DH
MOV 51H,#6BH
MOV 52H,#3AH
MOV R0,50H
MOV R1,51H
MOV R2,52H
END
OUTPUT:

RESULT:
Thus, the assembly language program executes the data transfer between
memory to register.
EXP: NO:03
PERFORM ALU OPERATIONS.
DATE:

AIM:
To write an assembly language program to perform ALU operations.

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 and Create a New Project Select Device
for the Target.
3. Select the device DS2250 or DS2251T or DS2252T.
4. Add Startup file Next go to “File” and click “New”.
5. Write a program on the editor window and save it with .asm extension.
6. Add this source file to Group and click on “Build Target” or F7.
7. Go to debugging mode to see the result of the simulation by clicking Run or Step
run.
8. This program follows the above-mentioned steps to create and compile the project.
9. To see the output go to the memory window and enter the memory location like
D:50H.

PROGRAM:

ORG 0000H

CLR C

//Addition

MOV A,#5

MOV R0,#3

ADD A,R0

MOV 50H,A
//Subtraction
SUBB A,R0
MOV 51H,A

//Multiplication
MOV A,#4

MOV B,#5

MUL AB
MOV 52H,A

//Division
MOV A,#20
MOV B,#5
DIV AB
MOV 53H,A
MOV 54H,B

//AND
MOV A,#1
MOV R0,#1
ANL A,R0
MOV 55H,A
//OR
MOV A,#0
MOV R0,#1
ORL A,R0
MOV 56H,A

//XOR
MOV A,#1
MOV R0,#0
XRL A,R0
MOV 57H,A
END
OUTPUT:

RESULT:
Thus, the assembly language program to perform an ALU operations has been
executed successfully.
EXP:NO: 04(i) WRITE BASIC PROGRAMS USING
EMBEDDED C.
DATE:

AIM:
To write basic program using embedded c.

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 and Create a New Project Select Device
for the Target.
3. Select the device DS2250 or DS2251T or DS2252T.
4. Add Startup file Next go to “File” and click “New”.
5. Write a program on the editor window and save it with .asm extension.
6. Add this source file to Group and click on “Build Target” or F7.
7. Go to debugging mode to see the result of the simulation by clicking Run or Step
run.
8. This program follows the above-mentioned steps to create and compile the project.
9. To see the output go to the memory window and enter the memory location like
D:50H.

PROGRAM:
#include<reg51.h>
int i,j;
sbit LED=P2^0;
void main()
{
while(1)
{
LED=0;
for(i=0;i<10000;i++)
LED=1;
for(j=0;j<10000;j++);
}
}
OUTPUT:

RESULT:
Thus, the arithmetic program using embedded c has been executed successfully
EXP.NO:4(ii)
WRITE ARITHMETIC PROGRAM USING EMBEDDED C
DATE:

AIM:
To write a arithmetic program using embedded C.

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 and Create a New Project Select
Devicefor the Target.
3. Select the device DS2250 or DS2251T or DS2252T.
4. Add Startup file Next go to “File” and click “New”.
5. Write a program on the editor window and save it with .asm extension.
6. Add this source file to Group and click on “Build Target” or F7.
7. Go to debugging mode to see the result of the simulation by clicking Run or Step
run.
8. This program follows the above-mentioned steps to create and compile the
project.
9. To see the output go to the memory window and enter the memory location like
D:50H.
PROGRAM:

#include<reg51.h>
void main(void)
{
unsigned char x,y,z,a,b,c,d,e,f,p,q,r;
//addition
x=0x12;
y=0x34;
P0=0x00;
z=x+y;
P0=z;
//subtraction
a=0x12;
b=0x34;
P1=0x00;
c=b-a;
P1=c;
//multiplication
d=0x12;
e=0x34;
P2=0x00;
f=d*e;
P2=f;
//division
p=0x10;
q=0x10;
P3=0x00;
r=p/q;
P3=r;
While(1);
}
OUTPUT:
RESULT:
Thus, the arithmetic program using embedded c has been executed successfully
EXP.NO: 05
INTRODUCTION TO ARDUINO PLATFORM AND
DATE: PROGRAMMING

INTRODUCTION IOT:

IOT stands for “Internet of Things”. The IOT is a name for the vast collection of
“things” that are being networked together in the home and workplace (up to 20
billion by 2020 according to Gardner, a technology consulting firm).
Characteristics of the IOT
Communications are important to IOT projects.

In fact, communications are core to the whole genre. There is a trade-off for IOT
devices. The more complex the protocols and higher the data rates, the more powerful
processor needed and the more electrical power the IOT device will consume.
TCP/IP base communications (think web servers; HTTP-based commutation (like
REST servers); streams of data; UDP) provide the most flexibility and functionality at
a cost of processor and electrical power.
Low-power Bluetooth and Zigbee types of connections allow much lower power for
connections with the corresponding decrease in bandwidth and
functionality.
IOT projects can be all over the map with requirements for communication flexibility
and data bandwidth requirements.

Arduino in IoT
In IoT applications the Arduino is used to collect the data from the sensors/devices to
send it to the internet and receives data for purpose of control of actuators.

Arduino Uno
Introduction:
The Arduino Uno is an open-source microcontroller board based on the Microchip
ATmega328P microcontroller and developed by Arduino.cc. The board is equipped
with sets of digital and analog input/output (I/O) pins that may be interfaced to various
expansion boards (shields) and other circuits. The board has 14 digital I/O pins (six
capable of PWM output), 6 analog I/O pins, and is programmable with the Arduino
IDE (Integrated Development Environment), via a type B USB cable. It can be
powered by the USB cable or by an external 9-volt battery, though it accepts voltages
between 7 and 20 volts. The word "uno" means "one" in Italian and was chosen to mark
the initial release of Arduino Software.

Features of the Arduino :

1. Arduino boards are able to read analog or digital input signals from different
sensors and turn it into an output such as activating a motor, turning LED on/off,
connect to the cloud and many other actions.

2. The board functions can be controlled by sending a set of instructions to the


microcontroller on the board via Arduino IDE.
3. Arduino IDE uses a simplified version of C++, making it easier to learn to
program.
4. Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package.

Arduino IDE:

Introduction:
The Arduino Software (IDE) is easy-to-use and is based on the Processing
programming environment. The Arduino Integrated Development Environment (IDE)
is a cross-platform application (for Windows, macOS, Linux) that is written in
functions from C and C++. The open-source Arduino Software (IDE) makes it easy to
write code and upload it to the board. This software can be used with any Arduino
board.
The Arduino Software (IDE) – contains:
• • A text editor for writing code
• • A message area
• • A text consoles
• • A toolbar with buttons for common functions and a series of menus. It
connects to the Arduino hardware to upload programs and communicate with them.

Installation of Arduino Software (IDE)


Step1: Downloading
➢ To install the Arduino software, download this page:

http://arduino.cc/en/Main/Software and proceed with the installation by allowing the


driver installation process.
Step 2: Directory Installation

Choose the installation directory.

Step 3: Extraction of Files


➢ The process will extract and install all the required files to execute properly the
Arduino Software (IDE)

Step 4: Connecting the board


➢The USB connection with the PC is necessary to program the board and not just to
power it up. The Uno and Mega automatically draw power from either the USB or an
external power supply. Connect the board to the computer using the USB cable. The
green power LED (labelled PWR) should go on.
Step 5: Working on the new project

Open the Arduino IDE software on your computer. Coding in the Arduino language
will control your circuit.

Open a new sketch File by clicking on New

Step 6: Working on an existing project


➢ To open an existing project example, select File → Example → Basics → Blink.

Step 7: Select your Arduino board.


➢ To avoid any error while uploading your program to the board, you must select the
correct Arduino board name, which matches with the board connected to your
computer.
Go to Tools → Board and select your board.

Step 8: Select your serial port

Select the serial device of the Arduino board.


➢ Go to Tools → Serial Port menu. This is likely to be COM3 or higher (COM1 and
COM2 are usually reserved for hardware serial ports).
➢ To find out, you can disconnect your Arduino board and re-open the menu, the
entry that disappears should be of the Arduino board. Reconnect the board and select
that serial port.
Step 9: Upload the program to your board.

Click the "Upload" button in the environment

Wait a few seconds; you will see the RX and TX LEDs on the board, flashing

If the upload is successful, the message "Done uploading" will appear in the status
bar.

You might also like