ES&IOT Final Lab Manual
ES&IOT Final Lab Manual
COLLEGE OF ENGINEERING
AND TECHNOLOGY
TIRUPUR – 641665
(AN ISO 9001:2015 CERTIFIED INSTITUTION)
BONAFIDE CERTIFICATE
Register Number……………………………………………..
…………………………………………………………………………………………………… of B.E.
Computer Science And Engineering branch for the 06 semester during the academic
Signature of Signature of
1
INDEX
1
8051 assembly language experiments
using simulator
2
EX NO: 1
8051 ASSEMBLY LANGUAGE
DATE:
EXPERIMENTS USING SIMULATOR
AIM:
To Write 8051 Assembly Language experiments using simulator.
SOFTWARE REQUIRED:
1. EDSIM51
2. PC
PROCEDURE:
STEP 1 : Initialize Port 1 as an output port.
STEP 2 : Enter an infinite loop labeled as "LOOP."
STEP 3 : The delay subroutine is called "DELAY."
⚫ Initialize register R2 with the value 0xFF (255 in decimal).
⚫ Enter a loop labeled as "DELAY_LOOP."
STEP 4 : The program continues to loop indefinitely, creating a
blinking LED effect on P1.0.
PROGRAM 1 :
ORG 0x00
MOV P1, #0x00 ; Initialize Port 1 as output
LOOP:
SETB P1.0 ; Turn on LED at P1.0
3
ACALL DELAY ; Call the delay subroutine
CLR P1.0 ; Turn off LED at P1.0
ACALL DELAY ; Call the delay subroutine
SJMP LOOP
DELAY:
MOV R2, #0xFF
DELAY_LOOP:
DJNZ R2, DELAY_LOOP
RET
4
OUTPUT:
5
OBJECTIVE:
PROCEDURE:
PROGRAM:
ORG 0x00
MOV P1, #0x00 ; Initialize Port 1 as output LOOP:
SETB P1.0 ; Turn on LED at P1.0
ACALL DELAY ; Call the delay subroutine
CLR P1.0 ; Turn off LED at P1.0
ACALL DELAY ; Call the delay subroutine
SJMP LOOP
DELAY:
6
MOV R2, #0xFF
DELAY_LOOP:
DJNZ R2, DELAY_LOOP
RET
OUTPUT:
7
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
8
EX NO: 2
DATA TRANSFER BETWEEN REGISTER
DATE:
AND MEMORY
AIM:
SOFTWARE REQUIRED:
1.Edsim51
PROCEDURE:
DEFINITION:
9
PROGRAM:
MAIN:
; Move a value (e.g., 0xAA) from register R0 to a memory location
(e.g., 0x30)
MOV A, #0xAA ; Load the accumulator with the value 0xAA
MOV R0, A ; Move the accumulator content to Register R0
MOV 0x30, R0 ; Move the content of Register R0 to memory
location 0x30
END
10
OUTPUT:
11
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
Thus the data transfer between registers and memory by using
simulator was successfully tested.
12
EX NO: 3
PERFORM ALU OPERARTIONS
DATE:
AIM:
PROCEDURE:
13
PROGRAM:
ORG 0x0000
; Addition
ADD A, R0 ; A = A + R0
; Result of addition will be stored in the Accumulator (A)
; Subtraction
MOV R2, A ; Store the result of addition in R2
SUBB A, R1 ; A = R2 (Result of addition) - R1
; Result of subtraction will be stored in the Accumulator (A)
; Multiplication
MOV R2, A ; Store the result of subtraction in R2
MUL AB ; Multiply A by B (R2), Result will be in ACC (A,
lower byte) and B (higher byte)
; Result of multiplication will be stored in the Accumulator (A)
; Division
MOV R2, A ; Store the result of multiplication in R2
DIV AB ; Divide ACC (A) by B (R2), Quotient will be in ACC
(A), Remainder in B
; Result of division will be stored in the Accumulator (A) and B
(Remainder)
END
14
OUTPUT:
15
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
16
EX NO: 4
WRITE BASIC AND ARITHEMATIC
DATE:
PROGRAM USING EMBEDDED C.
AIM:
BASIC PROGRAM:
Blinking LED
OBJECTIVE:
ALGORITHM:
17
PROGRAM IN EBEDDED C:
#include <avr/io.h>
#include <util/delay.h>
int main(void) {
// Set the LED pin as output
DDRB |= (1 << LED_PIN);
while (1) {
// Toggle the LED pin
PORTB ^= (1 << LED_PIN);
return 0;
}
OUTPUT:
18
LIGHT IS GLOWING AFTER THE EXECUTING OF THE
PROGRAM.
PROGRAM:
ARITHMETIC PROGRAM:
Addition of Two Numbers
ALGORITHM :
19
PROGRAM:
#include <stdio.h>
int main() {
int num1, num2, sum;
return 0;
}
20
OUTPUT:
21
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
22
EX NO: 5
INTRODUCTION TO ARDUINO
DATE:
PLATFORM AND PROGRAMMING
AIM:
To develop a Platform and Programming by using arduino.
SOFTWARE REQUIRED
1. Arduino IDE software with PC
2. Arduino board
3. Bread Board and Connecting Wires
INTRODUCTION:
Arduino is an open-source electronics platform that has gained
immense popularity among beginners, students, hobbyists, and
professionals for its simplicity and versatility. This introduction provides an
overview of the Arduino platform and its programming aspects.
What is Arduino?
Arduino is a versatile microcontroller-based hardware and software
platform that enables users to create interactive and programmable
electronic projects. It consists of two main components:
Hardware: Arduino boards are the physical computing devices at the core
of the platform. They come in various shapes and sizes but share common
elements, including a microcontroller, digital and analog input/output pins,
power supply, and communication interfaces.
23
Software: The Arduino Integrated Development Environment (IDE) is a
user-friendly programming environment for writing, compiling, and
uploading code to Arduino boards. It uses a simplified version of the C and
C++ programming languages.
Open Source: Arduino's hardware and software are open source, meaning
the designs and source code are freely available. This encourages a vibrant
community of users and developers who share their knowledge and
contribute to its growth.
24
Expansion Capability: Arduino can be easily extended by adding
"shields" – additional boards that provide extra functionality. These shields
can be stacked on top of the Arduino board.
25
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
26
EX NO: 6 EXPLORE DIFFERENT COMMUNICATION
METHODS WITH IOTDEVICES (ZIGBEE,
DATE:
GSM, BLUETOOTH)
AIM:
ZIGBEE:
Environmental Monitoring:
27
➢ In environmental monitoring projects, Zigbee sensor nodes can be
strategically deployed throughout an area. These nodes can
continuously collect data and irelessly transmit it to a central hub for
real-time analysis and control.
➢ The low-power characteristics of Zigbee devices are advantageous for
applications that require extended battery life.
Industrial Automation:
28
➢ It allows you to track the location of vehicles, shipping containers, or
equipment using GPS and GSM connectivity. This is invaluable in
logistics, transportation, and fleet management.
➢ The ability to transmit location data over wide areas ensures assets
can be tracked even in remote or mobile scenarios.
Security Systems:
29
➢ The ubiquity of GSM networks makes it a dependable choice for
critical security applications.
BLUETOOTH:
30
Smartphone Integration:
31
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
32
EX NO : 7
INTRODUCTION TO RASPBERRY PI PLATFORM AND
DATE :
PYTHON PROGRAMMING
AIM:
To develop a Raspberry Pi Platform And Python Programming
SOFTWARE REQUIRED:
• Raspberery pi
• HDMI to VGA Cable
• Power cable
• Monitor
PROCEDURE
o Look at your Raspberry Pi. Can you find all the things labelled on the diagram?
USB ports — these are used to connect a mouse and keyboard. You can also
connect other components, such as a USB drive.
SD card slot — you can slot the SD card in here. This is where the operating
system software and your files are stored.
GPIO ports — these allow you to connect electronic components such as LEDs
and buttons to Raspberry Pi
If you have an SD card that doesn’t have the Raspberry Pi OS operating system on it
yet, or if you want to reset your Raspberry Pi, you can easily install Raspberry Pi OS
yourself. To do so, you need a computer that has an SD card port — most laptop and
desktop computers have one.
o Click on the link for the Raspberry Pi Imager that matches your operating system
34
o When the download finishes, click it to launch the installer
Anything that’s stored on the SD card will be overwritten during formatting. If your
SD card currently has any files on it, e.g. from an older version of Raspberry Pi OS,
you may wish to back up these files first to prevent you from permanently losing
them.
When you launch the installer, your operating system may try to block you from running it.
For example, on Windows I receive the following message:
35
If this pops up, click on More info and then Run anyway
Follow the instructions to install and run the Raspberry Pi Imager
Insert your SD card into the computer or laptop SD card slot
In the Raspberry Pi Imager, select the OS that you want to install and the SD
card you would like to install it on
Note: You will need to be connected to the internet the first time for the the
Raspberry Pi Imager to download the OS that you choose. That OS will then be
stored for future offline use. Being online for later uses means that the Raspberry Pi
imager will always give you the latest version.
36
Then simply click the WRITE button
Wait for the Raspberry Pi Imager to finish writing
Once you get the following message, you can eject your SD card
37
Connect your Raspberry Pi
Let’s connect up your Raspberry Pi and get it running.
o Check the slot on the underside of your Raspberry Pi to see whether an SD card is
inside.
If no SD card is there, then insert an SD card with Raspbian installed (via NOOBS)
Note: Many microSD cards come inside a larger adapter — you can slide the smaller card
out using the lip at the bottom.
38
o Find the USB connector end of your mouse’s cable, and connect the mouse to a
USB port on your Raspberry Pi (it doesn’t matter which port you use).
Use a cable to connect the screen to the Raspberry Pi’s HDMI port — use an adapter if
necessary.
Raspberry Pi 4
Connect your screen to the first of Raspberry Pi 4’s HDMI ports, labelled HDMI0.
Note: nothing will display on the screen, because the Raspberry Pi is not running yet.
o If you want to connect the Pi to the internet via Ethernet, use an Ethernet cable to
connect the Ethernet port on the Raspberry Pi to an Ethernet socket on the wall or
on your internet router. You don’t need to do this if you want to use wireless
connectivity, or if you don’t want to connect to the internet.
40
o If your screen has speakers, your Raspberry Pi can play sound through these. Or you
could connect headphones or speakers to the audio port.
o Plug the power supply into a socket and connect it to your Raspberry Pi’s power
port.
You should see a red LED light up on the Raspberry Pi, which indicates that
Raspberry Pi is connected to power. As it starts up (this is also called booting), you
will see raspberries appear in the top left-hand corner of your screen.
41
Finish the setup
When you start your Raspberry Pi for the first time, the Welcome to Raspberry Pi
application will pop up and guide you through the initial setup.
42
o Enter a new password for your Raspberry Pi and click Next.
43
Note: if your Raspberry Pi model doesn’t have wireless connectivity, you won’t see this
screen.
o Click Next let the wizard check for updates to Raspbian and install them (this might
take a little while).
o Click Done or Reboot to finish the setup. Note: you will only
need to reboot if that’s necessary to complete an update.
44
A tour of Raspberry Pi
45
o Click on File, then choose Save, and then click on Desktop and save the file as .
46
o In the window that appears, type:
ls
and then press Enter on the keyboard.
You can now see a list of the files and folders in your directory.
o Now type this command to change directory to the
Desktop:
cd Desktop
You have to press the Enter key after every command.
Then type:
ls
Can you see the text file you created?
o Close the terminal window by clicking on the X.
o Now drag to the Wastebasket on the desktop so the Raspberry Pi will be tidy for the
next person using it.
47
Browsing the web
You might want to connect your Raspberry Pi to the internet. If you didn’t plug in an
ethernet cable or connect to a WiFi network during the setup, then you can connect now.
o Click the icon with red crosses in the top right-hand corner of the screen, and select
your network from the drop-down menu. You may need to ask an adult which
network you should choose.
o Type in the password for your wireless network, or ask an adult to type it for you, then click OK.
o When your Pi is connected to the internet, you will see a wireless LAN symbol instead of the red crosses.
System
In this tab you can change basic system settings of your Raspberry Pi.
49
• Camera — enable the Raspberry Pi Camera Module
• SSH — allow remote access to your Raspberry Pi from another
computer using SSH
Performance
If you need to do so for a particular project you want to work on, you can change the
performance settings of your Raspberry Pi in this tab.
Warning: Changing your Raspberry Pi’s performance settings may result in it behaving
erratically or not working.
50
Overclock — change the CPU speed and voltage to increase performance
Localization
This tab allows you to change your Raspberry Pi settings to be specific to a country or
location.
Locale — set the language, country, and character set used by your Raspberry Pi
Time zone — set the time zone
Keyboard — change your keyboard layout
Wi-Fi Country — set the Wi-Fi country code
51
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
52
EX NO : 8
DATE : INTERFACING SENSORS WITH RASPBERRY PI
AIM:
SOFTWARE REQUIRED:
PROCEDURE:
With your Raspberry Pi turned off, build the circuit as per this diagram.
The DS18B20 is placed into the breadboard so that the flat side faces you.
• The black jumper cable goes from GND, which is the third pin down on the right
column to the first pin of the DS18B20.
• The yellow jumper cable goes from the fourth pin down on the left column and is
connected to the middle pin of the DS18B20.
• The red jumper cable goes from the top left pin of the Raspberry Pi to the far right
pin of the DS18B20.The Resistor connects the RIGHT pin to the MIDDLE pin.
This is called a pull up resistor and is used to ensure that the middle pin is always
on. In the diagram I had to use a spare red wire to show this connection. But in
reality, using the resistor to make the connection, as per this photo is the best way.
Now attach your keyboard, mouse, HDMI and power to your Raspberry Pi and boot to
the desktop.
Configuring the Raspberry Pi
We now need to take two steps to enable our DS18B20 for use.
Install the Python Library
Firstly we need to install a Python library, pre-written code that enables the Python code
that we shall later write to talk to the sensor. The Python library is called
like...
When the terminal opens, enter the following to install the library, just press ENTER to start.
When it opens, click on the Interfaces tab and then click on Enable for the 1-Wire
interface.
Now click on Ok and you will be asked to reboot, so go ahead and do that, and let the
Raspberry Pi reboot to the desktop.
Writing the Python Code
Our project will gather the temperature from the DS18B20 sensor every one second and
print it to the screen. The code will run forever.
To write the code we shall use the Python 3 Editor found in the Programming menu.
When the application opens, click on File >> New to create a new blank document. In
this new window, click on File >> Save and call the project temperature-sensor.py
Remember to save your work often!
Importing the libraries
The first step in any Python project that uses libraries is to import the libraries that we
wish to use. In this case we import time to control how often the sensor data is collected,
and we import w1thermsensor to enable our project to talk to the sensor. So lets import
the libraries.
Our next line is to create an object to store a connection the sensor. So rather than
typing W1ThermSensor() everytime we want to use the sensor, we store the connection in an
object called sensor .
sensor = W1ThermSensor()
Running in a loop
while True:
Now the next lines of code are indented , this is how Python shows that this code belongs inside
import time
from w1thermsensor import W1ThermSensor
Sensor
We'd like to get the temperature sensor data every second, and run forever. So let's use a
while True loop to run the code inside of it forever.
the loop that we have just created.
The first thing to do in our loop is to get the current temperature from the DS18B20
sensor, and then store it in a variable called temperature. Variables are boxes /
containers into which we can store any data.
temperature = sensor.get_temperature()
Now that we have the data, lets print it to the screen using the print() function. But lets use the
data in the form of a sentence that will tell the us what the temperature is in celsius. For
this we use a little Python trick called string formatting, where we would like the
temperature data to be printed in the sentence, we use an %s which will format the
mathematical equations)
Our last line of Python code will tell the Raspberry Pi to wait for 1 second between takin ga
temperature reading.
time.sleep(1)
That's all of the code, so make sure that you save your work.
Complete Code Listing
temperature data from an float (a number with a decimal place) to a string (text,
characters that can be printed but not used in any
Check that your code matches the code below before moving on.
import time from w1thermsensor
import W1ThermSensor sensor =
W1ThermSensor()
while True:
temperature = sensor.get_temperature()
print("The temperature is %s celsius" %
temperature) time.sleep(1)
Run the Code!
To run the code, click on Run >> Run Module and you will see the Python Shell
window pop up and start displaying temperature data!
58
59
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
Thus the temperature Sensor was Successfully Interface with Raspberry Pi.
60
EX NO : 9 COMMUNICATE BETWEEN ARDUINO AND
DATE : RASPBERRY PI USING ANY WIRELESS MEDIUM
AIM:
PROCEDURE:
1.Download Raspbian:
Your Pi needs an OS. Download Raspbian from Raspberrypi.org ‘s download section:
https://www.raspberrypi.org/downloads/raspbian/
4.Configure Wi-Fi:
It’s easier to make two devices talk to each other if they are in the same network. An
ethernet cable can easily make your laptop’s network available to the Pi. But we don’t
have one. So, we are going to add a file to the SD card so that the Pi boots with a wifi
pre-configured.
The SD card mounts as two volumes boot and rootfs . Open the boot volume and create a
file named wpa_supplicant.conf on booting the RPi, this file will be copied to
61
/etc/wpa_supplicant directory in /rootfs partition. The copied file tells the Pi the WIFI
setup information. This would overwrite any existing WIFI configuration, so if you had
already configured WIFI on the pi, then that will be overwritten.
A typical wpa_supplicant.conf file is as follows:
ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdevupdate_config=1country=US network={
ssid="«your_SSID»" psk="«your_PSK»" key_mgmt=WPA-PSK} NOTE: Your SSID
is your WIFI’s name. And psk is the password of the WI-FI.
5) Enable SSH
We will later access the Pi using a secured shell (SSH), SSH is disabled by default in
Raspbian. To enable SSH, create a file named ssh in the boot partition. If you are on
Linux, use the touch command to do that.
62
7) SSH into your Pi:
To create a secured shell connection in Linux we can use the ssh command. If you are on
windows, try downloading Putty from https://www.putty.org/
63
Access Pi remotely:
Sometimes it doesn’t feel right if we can’t use the mouse. For that, we need to look
into the Raspian desktop.
We need to setup VNC (Virtual Network Connection) to see and control Pi
graphically. Let’s do that.
To access the remote desktop, you need VNC-viewer (client) for your laptop.
Fortunately,
RealVNC is available for a lot of OSes, pick one
for your OS from https://www.realvnc.com/en/connect/download/viewer/
64
10) Now open VNC Viewer on your remote computer :
65
Arduino boards using the NRF24L01. And measure distance with ultrasonic
sensor and transmit it to another Arduino with transceiver module.
Wiring Instructions:
To wire your NRF24L01+ wireless Sender to your Arduino, connect the following pins:
Connect the VCC pin to 3.3 Volts
Connect the GND pin to ground (GND)
Connect the CE pin to Arduino 9
Connect the CSN pin to Arduino 10
Connect the SCK pin to Arduino 13
Connect the MOSI pin to Arduino 11
Connect the MISO pin to Arduino 12
To wire your ultrasonic sensor to your Arduino, connect the following pins:
Connect the VCC pin to Arduino 5Volts
Connect the GND pin to ground (GND)
Connect the Trig pin to Arduino 4
Connect the Echo pin to Arduino 3
Schematic Diagram for wiring of Arduino Uno with ultrasonic sensor and
NRF24L01 To wire your NRF24L01+ wireless sender to your Arduino, connect
the following pins: Connect the VCC pin to 3.3 Volts
Connect the GND pin to ground (GND)
Connect the CE pin to Arduino 9
Connect the CSN pin to Arduino 10
Connect the SCK pin to Arduino 13
Connect the MOSI pin to Arduino 11
Connect the MISO pin to Arduino 12
66
Schematic Diagram for wiring of Arduino Uno NRF24L01
NOTE: RF24 module is mandatory for the code to run so you can add the library accordingly Start Arduino IDE
then add the Downloaded Library from Here :
5.2 . Code :
67
Receiving the data:
69
Make it executable: chmod +x install.sh
8. Run it and choose your options:
70
Schematic Diagram:
71
72
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
Thus the Temperature Sensor with Raspberry Pi was interfaced successfully.
73
EX NO : 10 SETUP A CLOUD PLATFORM TO LOG THE
DATE : DATA
AIM:
To Setup a cloud platform to log the data by using Arduino and Raspberry Pi.
SOFTWARE REQUIRED:
Google Cloud PROCEDURE:
74
• Click Next
• In the next page, click – Yes, I’m in
• In the next page, agree to the T&C
Step 2 – Log in to GCP console
• Agree the terms and conditions and you now have a free tier account for GCP
Step 3 – Enable Billing to receive $300 credits
75
• On top of your screen you will see the link to enable billing
• Click on the Activate Button to go to the next page
In the next page – select your country and Agree to the T&C and click Continue
76
NOTE – Ensure that your card supports auto debit. I have seen a few instances where debit
cards were rejected as they don’t support auto debit.
• Once after setting project successfully & enabled the billing for it.
• On your google cloud home page, top left corner click 3dash symbol as shown below
You will see various services offered by google.
• Now scroll down list of services until you see “Compute Engine” then click on it
• It will pop up with various other services under compute engine as show below
77
Now click on “VM Instances”
78
Machine type: ( choose the appropriate capacity as per the requirement )
79
Now click on “create” at the bottom.
80
• To create more VMs, repeat same process Port from VPC Networks
Step 5:
1: Source
On the filter should be
navigation selected
menu to IP
on the ranges.
left, scroll down and go to Networking
Step -Click on–the
> VPC3:network
section > VPC networks.
Edit link.
Step 6: Select Allow all from Protocols and ports and click save.
Program 40
Result 20
Record 20
Total 100
RESULT:
AIM:
To Log Data Using Raspberry Pi and Upload To The Cloud Platform
SOFTWARE REQUIRED:
• Raspberry Pi
• DHT11 Sensor Jumper Cables Procedure:
Click on signup if you don’t have account and if you already have account click on sign
in. After clicking on signup fill your details.
After this verify your E-mail id and click on continue.
After clicking on “New Channel”, enter the Name and Description of the data you want
to upload on this channel. For example I am sending my CPU data (temperature), so I
named it as CPU data.
Now enter the name of your data (like Temperature or pressure) in Field1. If you want to
use more than one Field you can check the box next to Field option and enter the name
and description of your data.
After this click on save channel button to save your details.
84
Now copy your “Write API Key”. We will use this API key in our code.
python /path/filename.py
Case 1: If you are using monitor screen then just use the given code.
Now install all libraries:
85
If there are any errors uploading the data, you will receive “connection failed” message.
Case 2: If you are using “Putty” then you should follow these commands:
First update your pi using:
nano cpu.py
After creating this file copy your code to this file and save it using CTRL + X and then ‘y’
and Enter.
After this install all libraries using:
86
After installing libraries run your python code using:
python cpu.py
If the code runs properly you will see some CPU temperature values as shown in above
image.
Like this you can send any sensor data connected with Raspberry pi to the Thing Speak
Cloud. In next article we will connect LM35 temperature sensor with Raspberry Pi and
send the temperature data to thing Speak, which can be monitored from anywhere.
Complete Python code for this Raspberry Pi Cloud Server is given below. Code is easy
and self-explanatory to understand.
87
Code
import httplib import urllib import
time key = "ABCD" # Put your
API Key here def thermometer():
while True:
#Calculate CPU temperature of Raspberry Pi in Degrees C
temp = int(open('/sys/class/thermal/thermal_zone0/temp').read()) / 1e3 # Get
Raspberry Pi CPU temp
params = urllib.urlencode({'field1': temp, 'key':key }) headers
= {"Content-typZZe": "application/x-www-form-urlencoded","Accept":
"text/plain"} conn =
httplib.HTTPConnection("api.thingspeak.com:80")
try:
conn.request("POST", "/update", params,
headers) response = conn.getresponse()
print temp
print response.status,
response.reason data =
response.read() conn.close()
except: print "connection
failed" break if __name__ ==
"__main__": while True:
thermometer()
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
Thus the data was uploaded Sucessfully in the Cloud by using Raspberry Pi .
88
EX NO :12
DATE : DESIGN AN IOT BASED SYSTEM
AIM
Hardware Requirements
1. Arduino UNO board
5. LED
Software requirements
1. Arduino software
2. Android Studio
PROCEDURE:
In this project, there are three main components used; an Android Smartphone, Bluetooth
transceiver, and an Arduino.
The Android app is built to send serial data to the Bluetooth Module HC-05 by
pressing ON button. As Bluetooth Module HC-05 works on serial communication. It
receives the data from the app and sends it through TX pin of Bluetooth module to RX
pin of Arduino. The uploaded code inside Arduino checks the data received. If the
receive data is 1, the LED turns ON, and if the received data is 0 the LED turns OFF.
89
Digital circuit diagram
TX --------------------------------> RX (Pin 0)
RX --------------------------------> TX (Pin 1)
VCC --------------------------------> 5v
GND --------------------------------> GND
LED Pin ARDUINO UNO
Pin1-------------------------------->GND
Pin 2 --------------------------------> Pin 13
For doing the programming for Arduino board, we need to download Arduino software.
This can be done from Arduino official site https://www.arduino.cc/
90
Download the Arduino software according to your OS compatibility (Windows Installer).
Click Download
After successful download, run the setup and follow the instructions.
91
When it asks to install the driver software, click to install
92
After installation, open the software, and if it generates a security alert then allow it.
93
Write a program for Arduino UNO board, if received data is equal to 1, LED turns on
and if data is equal to 0, LED turns OFF.
94
Connect your Arduino device to your Laptop (or Monitor) via Arduino UNO USB
cable. Remove all the other connections with Arduino UNO device such as Bluetooth
Module and LED while uploading the program in Arduino UNO.
After compiling the code, upload it in Arduino UNO device. Before uploading the
code in Arduino, UNO device makes sure that your Arduino serial port is selected
otherwise, it generates an error message "Serial port not selected".
To select your serial port, open Device Manager > Ports >Arduino Uno, and then upload
your code.
95
Download the Android app's .apk file and install it on your Android smartphone. Click
Here to Download
1. Open Bluetooth connecter app and allow turning on Bluetooth of the device.
96
2. Search for Bluetooth device for making the pair.
97
5. Control LED device.
While clicking "ON" button it sends data 1 to Bluetooth module and this data is
transmitted from the Bluetooth module to Arduino device and it turns ON the LED.
When clicking "OFF", Android app sends data 0 to Bluetooth module, and this data is
transmitted from the Bluetooth module to Arduino and it turns OFF the LED.
98
Performance 20
Program 40
Result 20
Record 20
Total 100
RESULT:
99