You are on page 1of 60

I

2021 Candidate Name USN


Under the
Guidance of
BHARATH D 1BI15EC201 R KRISHNA
TECHNOFLY Internship carried out at SOLUTIONS
#792/E, 1st Cross Address
3rd A Main Road
near TTMC bus stop
Hosahalli Extension, Vijayanagar
Bengaluru, Karnataka 560040
India

ks 50) Date of SIE


CIE (Max Marks 50) Report 25/Seminar 25
rnal Examiner Signature of External

STITUTE OF TECHNOLOGY
V .V Pura, Bengaluru -560004 Phone: 26613237/26615865, Fax:22426796
w.bit-bangalore.edu.in

Internship Guidelines and Evaluation Report

Department

of
Electronics and Communication Engineering
These guidelines are intended to give both students and faculty members at the Department
of Electronics and Communication Engineering a set of procedures and expectations that
will make the Internship evaluation process easier, more predictable,
Internship
Course Code : 15EC84 CIE:50 Marks (Report:25/Seminar:25) SIE:50
Marks
Industry oriented Duration :3 units Credits: 2

The Internship Regulations


One of the most important skills in which the Internship aim is to assess the student’s ability that
how he has accessed the working Principle /Administration/ governance and implementation
effectively of an organization / Industry / R&D Organization / Research Institute or Educational
Institute of Repute. As part of the assessment they are required to give a presentation and
demonstration of their selected internship work place to Internship Committee comprising of guide
& co evaluator.
1. The Internship shall be completed during the period specified in the scheme of Teaching
and Examination
2. The Internship can be carried out in any Industry/R&D Organization/Research Institute
/institution of national importance/professional bodies/Govt.or VTU Recognized research
institutes and centers/reputed private and public sectors
3. The presentation is a compulsory component of the Internship. The Internship committee
will not allocate marks for an internship unless there had been a formal presentation.
4. The department will nominate staff member to facilitate ,Guide and supervise student under
internship
5. The Internal Guide shall visit or monitor the progress of Internship Training and evaluate
periodically.
6. The student shall report the progress of the internship to the guide in regular intervals and
seek his/her advice
7. After the completion of Internship, student shall submit a report with completion and
attendance certification to the Head of the Department with the approval of both Internal
and External Guides.
8. There will be 50 marks for CIE (Seminar: 25, Internship report: 25) and 50 marks for Viva-
Voce conducted during SEE. The Minimum requirement of CIE marks shall be 50%of the
maximum marks.
9. The internal Guide shall award the marks for Seminar and Internship report after
Evaluation. He/she will be the internal examiner for Viva -Voce conducted during SEE.
10. The External Guide from the Industry shall be an examiner for Viva-Voce on Internship.
Viva Voce on Internship shall be conducted at the college and the date of Viva-Voce shall
be fixed in consultation with the external guide. The Examiners will jointly award the Viva-
Voce Marks
11. The students are permitted to carry out the internship anywhere in INDIA or abroad. The
university will not provide any kind of financial assistance to any student for carrying out
the internship
Guides will help students in the preparation of Internship report as well as presentation.
Presentation including a demonstration should be completed within a stipulated amount of time.
The organization / Industry / R&D Organization / Research Institute or Educational Institute of
Repute should be selected from the specialized domains like Wireless Communication, Signal
Processing, Embedded System, VLSI Design, Automation, Control Techniques, Communication
Systems, Computer Communication, Image Processing, Mobile Communication, Network
Security, Computer Architecture, IOT etc., but not limited to these topics.
COURSE LEARNING OBJECTIVES
Q Understand the process of applying engineering knowledge to produce product and provide
services._________________________________________________________________
0 Explain the importance of management and resource utilization
Q Comprehend the importance of team work, protection of environment and sustainable solutions.

COURSE OUTCOMES
Atter going through the internship the student will be able to: CO1: Apply engineering
and management principles
CO2: Analyze real-time problems and suggest alternate solutions CO3: Communicate effectively
and work in teams
CO4: Imbibe the practice of professional ethics and need for lifelong learning.

CO to PO& PSO MAPPING


PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 poll PO12 PSO1 PSO2 PSO
3
H M H M ... M ... ... ... L ... ... H ... H
COl

... H ... H M M ... L ... ... ... ... L L L


CO2

CO3 ... ... ... ... L ... M H H H ... ... ... M ...
... ... ... ... L ... H ... ... M H H M H M
CO4

Internship carried out at:

Marks
Candidate Contribution and Performance (Each category carries 5 Marks) allotment
Subject Matter
Selection of Industry for Internship
Understanding background of Industry
Specifies goals & Knowledge about the Industry
Summaries, about Industry
Technical Design Discussion and testing platforms
Summarize the ultimate findings of the Industry
Question and Answer
Internship Planning
Report Formation
Presentation skills
Total
Submission of soft copy/Hard copy/PPT to the departmental in charge Sign:
Comments |

Note: Attach the approved Internship report to this evaluation report


Date: Internship Co-Ordinator Guide

CO, PO & PSO JUSTIFICATION FOR THE COURSE 15EC84

PO PO PO PO PO PO1 PO1 PO1 PSO PSO PSO


PO2 PO4 PO5 PO6
l 3 7 8 9 0 1 2 1 2 3
JUSTIFICATION

Guidelines to prepare Internship Report


1. Students have to make a presentation on their internship activities in front of the departmental
committee and only upon approval of the presentation should the student proceed to prepare
and submit the hard copy of the internship final report. However interim or periodic reports
and reports as required by the industry / organization can be submitted as per the format
acceptable to the respective industry /organizations.
2. The reports shall be printed on bond paper - 80GSM, back to back print, with soft binding - A4
size with 1.5 spacing and times new roman font size 12.
3. The broad format of the internship final report shall be as follows.

1 Cover page
2 Certificate BIT, Industry/Organization
3 Acknowledgement/Synopsis/Table of Contents/list of Figures/list of Tables
• Institute Vision/Mission/QP/Long Term Goals
• Department Vision/Mission/PEOs/PSOs
$ Chapter 1 - Profile of the Organization - Organizational structure, Products, Services, Business
Partners, Financials, Manpower, Societal Concerns, Professional Practices.
6 Chapter 2 - Activities of the Department(Industry)
7 Chapter 3 - Tasks Performed - summaries the tasks performed during 4 week period
8 I Chapter 4 - Reflections - Highlight specific technical and soft skills that you acquired
9 References & Annexure
VISVESVARAYA TECHNOLOGICAL UNIVERSITY
JNANA SANGAMA, BELAGAVI-590 018

An Internship / Professional Practice Report On


“EMBEDDED SYSTEMS”
Submitted in Partial Fulfillment of the Requirements for the Award of Degree of
BACHELOR OF ENGINEERING
in
ELECTRONICS & COMMUNICATION ENGINEERING
Submitted by
BIIA RATIID
1BI15EC201
Internship Carried Out at
TECHNOFLY SOLUTIONS
1st Cross, 3rd A Main Rd, Vijayanagar BENGALURU 560011
Internal Guide: External Guide:
R KRISHNA
Associate Professor,
Department of ECE, BIT

Department of Electro^ unication Engineering


Bangalore Institute of Technology
K.R. Road, V.V. Puram, Bengaluru -560004
BANGALORE INSTITUTE OF TECHNOLOGY

K.R. Road, V.V. Puram, Bengaluru - 560004Phone:


26613237/26615865, Fax: 22426796
www.bit-bangalore. edu.in

Department of Electronics and Communication Engineering


CERTIFICATE

Certified that the Internship / Professional practice work entitled “EMBEDDED


SYSTEMS” carried out by Mr. BHARATH D bearing the USN: 1BI15EC201, a bonafide
student of Bangalore Institute of Technology, Bengaluru in partial fulfillment for the award
of Bachelor of Engineering in Electronics and Communication Engineering of the
Visvesvaraya Technological University, Belgaum during the year 2020-2021. It is certified
that all corrections/suggestions indicated for Internal Assessment have been incorporated in
the Report deposited in the department library. The Internship / Professional practice has
been approved as it satisfies the academic requirements in respect of Internship/
Professional practice work prescribed for the said Degree.

R KRISHNA Dr. K.V. Prasad


Associate Professor Professor & HOD

Dept. Of ECE, BIT, Dept. Of ECE, BIT,


Bengaluru
Bengaluru

External Viva

Name of the examiners Signature with date


TO WHOM IT MAY CONCERN
This is to certify that BHARATH D a student of BANGALORE
INSTITUTE OF TECHNOLOGY has completed 4 months / weeks of Internship
From 11 -03-2021 To 12-04-2021 in EMBEDDED SYSTEM Domain.
During this period of his internship programme with us he/her was
found punctual, hardworking and inquisitive, We wish him/her every succes in life.

Date 13-04-2021
Bangalore
ACKNOWLEDGEMENT

The time which I had spent in Techno fly Solutions as an intern from 15 th of March to 12th April
2021 was a memorable one for me as it was rich in experience sharing and helpedme discover
my potential. I have had so many rich experiences and opportunities that I personally believe will
forever shape and influence my professional life while fostering personal growth and
development.

I would like to express my gratitude to Dr. M.U. ASWATH, Principal, Bangalore Institute of
Technology for providing me with excellent facilities and academic ambience which has helped
me in satisfactory completion of this Bachelor's Degree.

I extend my thanks to Dr. K.V. PRASAD, Professor and Head of the Department, Electronics &
Communication Engineering, B.I.T, who in his capacity gave us all possible support and
assistance for the completion of the report.

I express my deep sense of gratitude to R KRISHNA, Assistant Professor, Department of


Electronics & Communication Engineering for his constant encouragement, support and
guidance.

I also thank Dr. HEMANTH KUMAR, Professor, Internship Practice Coordinator, Department of
Electronics and Communication Engineering, B.I.T, Bangalore for motivation and regular source
of encouragement.

This acknowledgement will be incomplete without thanking my parents for their co-operation
and even thanking teaching and non-teaching staffs, Department of Electronics &
Communication, B.I.T, who contributed either, directly or indirectly.

BHARATH D 1BI15EC201
BANGALORE INSTITUTE OF TECHNOLOGY

Vision

To establish and develop the Institute as a Centre of higher learning, ever abreast with expanding
horizon of knowledge in the field of engineering and technology, with entrepreneurial thinking,
leadership excellence for life-long success and solve societal problem.

Mission

• Provide high quality education in the engineering disciplines from the undergraduate to
doctoral levels with creative academic and professional programs.

• Develop the Institute as a leader in Science, Engineering, Technology and management,


Research and apply knowledge for the benefit of society.

• Establish mutual beneficial partnerships with industry, alumni, local, state and central
governments by public service assistance and collaborative research.

• Inculcate personality development through sports, cultural and extracurricular activities and
engage in the social, economic and professional challenges.
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
BANGALORE INSTITUTE OF TECHNOLOGY

Vision

Imparting Quality Education to achieve Academic Excellence in Electronics and


Communication Engineering for Global Competent Engineers.

Mission
• Create state of art infrastructure for quality education.
• Nurture innovative concepts and problem-solving skills.
• Delivering Professional Engineers to meet the societal needs

Program Educational Objectives (PEOS)

, Prepare graduates to be professionals, practicing engineers and entrepreneurs in the field of


Electronics and Communication Engineering.
e To acquire sufficient knowledge base for innovative techniques in design and development
of systems.
a Capable of competing globally in multidisciplinary field.
, Achieve personal and professional success with awareness and commitment to ethical and
social responsibilities as an individual as well as a team.

Program Specific Outcomes (PSOS)

, PSO1: The graduates will be able to apply the principles of Electronics and
Communication Engineering in core areas.
a PSO2: An ability to use latest hardware and software tools in Electronics and
Communication Engineering.
, PSO3: Preparing Graduates to satisfy industrial needs and pursue higher studies withsocial-
awareness and universal moral values.
COURSE OUTCOMES OF INTERNSHIP (15EC84)

CO1: Apply engineering and management principles.

CO2: Analyze real time problems and suggest alternate solutions.


CO3: Communicate effectively and work in teams.
CO4: Imbibe the practice of professional ethics and need for lifelong learning.

CO to PO & PSO MAPPING

PO PO PO PO PO PO P PO PO PO PO PO PSO PSO PSO


O
1 2 3 4 5 6 8 9 1 11 12 1 2 3
7 0
CO1 H M H M ... M ... ... ... L ... ... H ... H

CO2 __ H ... H M M ... L ... ... ... ... L L L


_
CO3 ... ... ... ... L ... M H H H ... ... ... M ...

CO4 __ ... ... ... L ... H ... ... M H H M H M


_
Table of Contents

Chapter 1............................................................................................................................................................ 1
1.1 About company................................................................................................................................... 1
1.2 Company profile.................................................................................................................................. 1
1.3 Services of Technofly...........................................................................................................................2
1.3.1 Embedded Software engineering Services.....................................................................................2
1.3.2 Engineering Departments and services..........................................................................................2
1.3.3 S oftware Engineering Department...............................................................................................4
Chapter 2............................................................................................................................................................. 5
2.1 Definition of Embedded System...........................................................................................................5
2.1.1 Embedded System Hardware........................................................................................................5
2.1.2 Embedded System Software..........................................................................................................6
2.1.3 Real Time Operating System.........................................................................................................6
2.1.4 Characteristics of Embedded Systems...........................................................................................6
2.1.5 Applications of Embedded Systems..............................................................................................7
2.1.6 Advantage s and Di sadvantage s..................................................................................................7
2.2 Introduction to ARM Micro controller.................................................................................................8
2.2.1 ARM v7........................................................................................................................................8
2.2.2 Features of LPC 2148....................................................................................................................9
2.3 Arduino UNO 1.8.5 ...........................................................................................................................10
2.3.1 Features of Arduino UNO 1.8.5..................................................................................................10
Chapter 3.......................................................................................................................................................... 11
3.1 Light Emitting Diode (LED)...............................................................................................................11
3.1.1 Advantages of LED.....................................................................................................................11
3.1.2 Disadvantages of LED.................................................................................................................11
3.1.3 Applications of Light Emitting Diodes........................................................................................12
3.1.4 Interfacing of LED to Arduino UNO...........................................................................................12
3.1.5 Pseudo code or Algorithm...........................................................................................................12
3.2 Liquid Crystal Display (LCD)............................................................................................................13
3.2.1 Advantages of LCD.....................................................................................................................14
3.2.2 Disadvantages of LCD ...............................................................................................................14
3.2.3 Applications of Light Emitting Diodes .......................................................................................14
3.2.4 Interfacing LCD to Arduino UNO...............................................................................................15
3.2.5 Pseudo code or Algorithm...........................................................................................................15
3.3 DC Motor...........................................................................................................................................16
3.3.1 Advantages of DC Motors...........................................................................................................16
3.3.2 Interfacing DC motor to Arduino UNO.......................................................................................16
x
i
3.3.3 Pseudo code or Algorithm...........................................................................................................17
3.4 Sensors............................................................................................................................................... 18
3.4.1 Different Types of Sensors..........................................................................................................18
3.5 Universal asynchronous receiver-transmitter......................................................................................32
3.5.1 UART Communication...............................................................................................................32
3.5.2 Applications of UART................................................................................................................33
3.6 Radio Frequency Identification (RFID)..................................................................................33
3.7 GSM (Global System forMobileCommunication)..............................................................................34
Chapter 4Project................................................................................................................................................35
4.1 Obstacle avoidance Robot...................................................................................................................35
4.2 Hardware Required.............................................................................................................................35
4.3 Software used......................................................................................................................................35
4.4 Circuit Diagram..................................................................................................................................36
4.5 Working Principle...............................................................................................................................37
4.5.1 Operation of the ultrasonic sensor...............................................................................................37
4.6 Working..............................................................................................................................................38
Chapter 5...........................................................................................................................................................39
5.1 Flow chart...........................................................................................................................................39
5.2 Interfacing robot program...................................................................................................................40
5.3 Pseudo code or Algorithm...................................................................................................................42
5.4 Result..................................................................................................................................................43
5.5 Applications........................................................................................................................................43
Outcomes of Internship.....................................................................................................................................44
Chapter 7 Reflection..........................................................................................................................................45
Conclusion.........................................................................................................................................................46

xi
i
Acronyms

RFID : Radio Frequency Identification

LCD : Liquid Crystal Display

IR sensor : Infrared Sensor

LDR : Light dependent resistor

ARM ; Advanced RISC Machine

LED : Light Emitting Diode

v
i
Embedded systems 2020-21

Chapter 1

Introduction

1.1 About company


Technofly Solutions
Technofly Solutions is a leading electronics product design, development and services company. The
professionals with industrial experience in embedded technology, real time software, process control and
industrial electronics held the company.
The company is the pioneers in design and development of Single Board Computers, Compilers for
micro-controllers within India. Talented professional in the field of embedded hardware, software design
and development toil to reach its excellence.
Technofly Solutions and Consulting was found in year 2017 by a team with 14+ years of experience
in embedded systems domain. Technofly Solutions focuses globally on automotive embedded
technologies and VLSI Design, Corporate Training and Consulting. Till now we have delivered more
than 15+ Corporate Trainings for companies working in Embedded Automotive Technologies in India.
Also involved in the Development of OBD2 (On Board Diagnose Product for Passenger cars) for clients
in India.

1.2 Company profile


TechnoFly Solutions was formed by professionals with formal qualifications and industrial
experience in the fields of embedded systems, real-time software, process control and industrial
electronics. The company is professionally managed and supported by qualified experienced specialists
and consultants with experience in embedded systems - including hardware and software.
Initially, the company Developed system software tools; . Later Single Board Comput- ers(SBCs) -
were developed and are still manufactured. Such hardware boards support a broad range of processors -
including 8 bit, 16 and 32 bit processor.
Since 2015, company also started offering design and development services. This includes a complete
spectrum of activities in product development life cycle that is idea generation, requirement gathering to
prototype making, testing and manufacturing. Company has so far provided product design services for
various sectors which include the Industrial automation, Instrumentation, Automotive, Consumer and
Defense sector.

Dept Of ECE, BIT, Bengaluru 1


1.3 Services of Technofly
1.3.1 Embedded Software engineering Services
When you don't have enough time, or the right skills on hand, you can supplement your team with expert
embedded engineers from Technofly, who can tackle your projects with confidence, take out the risk, and hit
your milestones. We'll take as much ownership as you want us to, and make sure your project is done right,
on time and on budget. Go ahead, check our reputation for on-time, on-budget delivery. We've earned it, time
and again.
We can help you cut risk on embedded systems R and D, and accelerate time to mar ket. Technofly is your
best choice for designing and developing embedded products from concept to delivery. Our team is well-
versed in product life cycles. We build complex software systems for real-time environments and have
unique expertise and core competencies in the following domains: Wireless, Access and IOT/Cloud.
Technofly solution also offer services which includes

1. Developing client / server applications to run on Windows / Linux

2. Develop / Test Internet based applications

3. Test suite development for applications and network protocols

4. Developing Networking tools for the enterprises

5. Verification Validation of Enterprise applications

6. Software maintenance of enterprise applications

1.3.2 Engineering Departments and services


Technofly solution offers services in the areas of Real-Time Embedded Systems, Low power VLSI
design, Verification and Software Engineering Services. Its strong team of around 30 engineers is equipped
with the right tools and right processes to deliver the best. Technofly solution also offers customization of its
products.

1.3.2.1 Real Time Embedded System and Low power VLSI design Department

Technofly solution embedded software, hardware, system development, system integration,


verification and product realization services to customers in automotive electronics and consumer
electronics segments worldwide. Technofly solution has more than 14 years of experience in embedded
systems on a variety of platforms such as Microprocessors, Programmable Logic Devices (PLDs) and
ASICs. Accord develops applications based on the various commercially available real time and
embedded operating systems.
Technofly solution provides services in the following areas:

2
Embedded systems 2020-21
1. Design Services

2. Product Realization

Design Services: Technofly solution offer services in the areas of

1. Hardware design and development: Hardware design and development services are related to

a) High-speed digital design

b) Mixed signal design

c) Analog and RF design

d) PLD (FPGA/EPLD/CPLD) based design

e) Processor (Micro-controllers, DSP) based design

2. Software design and development: Software design and development services are related to Real-
time Embedded Application Development

a) Device Driver Development

b) BSP Development

c) Processor/OS Porting Services

d) RTOS based development

e) Board bring-up

f) Digital Signal Processing Algorithms

g) Porting across platforms

Product Realization: Product Realization services are provided in the areas of

1. Consumer Electronics

2. Automotive

3. Space

4. Defense

5. Simulation/Emulation

6. Temperature and Humidity Chamber

Dept Of ECE, BIT, Bengaluru 3


1.3.3 Software Engineering Department
Technofly solution has a dedicated group specializing in providing productivity tools for work group
collaboration, which also handles software projects for small and medium scale enterprises.
Our Work group productivity software suite Smart Works consists of software applications which can
help you plan and track your projects, manage meetings and Track various issues to its closures. Smart
Works is affordably priced and uses TCP/IP based client server architecture at its core. Smart Works server
runs on all the windowing plat- forms (Windows 95/98/NT/2000/ME). Efforts are on to make Smart works
available on other platforms as well.
Technofly solution also offer services which includes

1. Developing client/server applications to run on Windows/Linux

2. Develop / Test Internet based applications

3. Test suite development for applications and network protocols

4. Developing Networking tools for the enterprises

5. Verification and Validation of Enterprise applications

6. Software maintenance of enterprise applications

Following are the skill sets Technofly solution has garnered in the area of software:

1. Programming Languages: C, C++, Java, ASP.Net, PHP, Perl, Python, Assembly Language and Ada.

2. Operating Environments: Real Time Operating Systems such as, GreenHills Integrity and Micro C-OS.
DSP OS, VDK, OASYS and MS-WINCE, MS-Windows, Unix/Linux and MPE/iX are the operating
systems that Accord provides services.

Chapter 2
Introduction to Embedded system

2.1 Definition of Embedded System


An embedded system is one kind of a computer system mainly designed to perform several tasks like
to access, process, store and also control the data in various electronicsbased systems.
Embedded systems are a combination of hardware and software where software is usually known as
firmware that is embedded into the hardware.

4
Embedded systems 2020-21

2.1.1 Embedded System Hardware


As with any electronic system, an embedded system requires a hardware platform on which it
performs the operation. Embedded system hardware is built with a microprocessor or micro controller.
The embedded system hardware has elements like input output (I/O) interfaces, user interface, memory
and the display. Usually, an embedded system consists of:

1. Power Supply

2. Processor

3. Memory

4. Timers

5. Serial communication ports

6. System application specific circuits

2.1.2 Embedded System Software


The embedded system software is written to perform a specific function. It is typically written in a high
level format and then compiled down to provide code that can be lodged within a non-volatile memory
within the hardware. An embedded system software is designed to keep in view of the three limits:

1. Availability of system memory

2. Availability of processor's speed

3. When the system runs continuously, there is a need to limit power dissipation for events like stop, run
and wake up.

2.1.3 Real Time Operating System


A system is said to be real time, if it is essential to complete its work and deliver its service on time. Real
Dept Of ECE, BIT, Bengaluru 5
time operating system manages the application software and affords a mechanism to let the processor run.
The Real Time operating system is responsible for handling the hardware resources of a computer and host
applications which run on the computer.

2.1.4 Characteristics of Embedded Systems


1. Application-specific functionality - specialized for one or one class of applications

2. Deadline constrained operation - system may have to perform its function(s) within specific time
periods to achieve successful results

3. Resource challenged - systems typically are configured with a modest set of resources to meet the
performance objectives

4. Power efficient - many systems are battery-powered and must conserve power to maximize the usable
life of the system.

5. Form factor - many systems are light weight and low volume to be used as components in host systems

6. Manufacturable - usually small and inexpensive to manufacture based on the size and low complexity
of the hardware.

2.1.5 Applications of Embedded Systems


Embedded systems find numerous applications in various fields such as digital electronics,
telecommunications, computing network, smart cards, satellite systems, military defense system
equipment, research system equipment, and so on.

2.1.6 Advantages and Disadvantages


Advantages

1. Small size and faster to load

2. More specific to one task

3. Easy to manage

4. Low cost

5. Spend less resources

6. Good performance

6
Embedded systems 2020-21
Disadvantages

1. Difficult to upgrade

2. Nearly not scalable

3. Hardware is limited

4. Troubleshooting is difficult

5. If any problem occurs then we need to reset settings

6. Difficult to transfer data from one system to another system

Dept Of ECE, BIT, Bengaluru 7


2.2 Introduction to ARM Micro controller
The ARM stands for Advanced RISC machine and it is a 32-bit reduced instructions set computer (RISC)
microcontroller. It was first introduced by the Acron computers' organization in 1987. The ARM is a family
of the microcontroller developed by the different manufacturers such as ST microelectronics, Motorola and
so on .The ARM microcontrollers are cost sensitive and high performance devices which are used in a wide
range of application such as industrial instrument control systems, wireless networking and sensors and
automotive body system etc. The ARM microcontroller architecture come with a few different versions such
as ARMv1, ARMv2 etc and each one has its own advantage and disadvantages.

2.2.1 ARM v7

ARM7 is one of the widely used micro-controller family in embedded system application. This section is
humble effort for explaining basic features of ARM-7. LPC2148 is the widely used IC from ARM-7 family.
It is manufactured by Philips and it is preloaded with many inbuilt peripherals making it more efficient and a
reliable option for the beginners as well as high end application developer.

2.2.2 Features of LPC 2148


1. 16-bit/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 package.

2. 8kB to 40kB of on-chip static RAM and 32kB to 512kB of on-chip flash memory.

8
Embedded systems 2020-21
3. 128-bit wide interface/accelerator enables high-speed 60 MHz operation

4. In-System Programming/In-Application Programming (ISP/IAP) via on-chip boot loader software.

5. Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip
Real Monitor software and high-speed tracing of instruction execution.

6. Single 10-bit DAC provides variable analog output

7. Two 32-bit timers/external event counters, PWM unit and watchdog.

8. Low power Real-Time Clock with independent power and 32 kHz clock input.

9. Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 Kbit/s), SPI and
SSP with buffering and variable data length capabilities.

10. Vectored Interrupt Controller with configurable priorities and vector addresses.

11. Up to 45 of 5 V tolerant fast general purpose I/O pins in a tiny LQFP64 package.

12. Up to 21 external interrupt pins available.

13. 60 MHz maximum CPU clock available from programmable on-chip PLL with settling time of 100
microseconds.

14. On-chip integrated oscillator operates with an external crystal from 1 MHz to 25 MHz .

15. CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 ) with 5 V tolerant I/O pads.

2.3 Arduino UNO 1.8.5


Arduino UNO is an open source microcontroller board based on the microchip AT- mega328P
microcontroller and developed by Arduino.cc. The board is equipped with sets of digital and analog
input/output pins that can may be interfaced to various expansion boards and other circuits.
The board has 14 digital pins, 6 analog pins and programmable with the Arduino IDE (Integrated
Development Environment) via type B USB cable. It can be powered by the USB cable or by an external 9
volt battery. It accepts voltages between 7 and 20 volts.

Dept Of ECE, BIT, Bengaluru 9


Figure 2.1: Arduino UNO

2.3.1 Features of Arduino UNO 1.8.5

Micro controller: ATmega328


Operating Voltage: 5V
Input Voltage (recommended): 7-12V
Input Voltage (limits): 6-20V
Digital I/O Pins: 14 (of which 6 provide PWM output)
Analog Input Pins: 6
DC Current per I/O Pin: 40mA
DC Current for 3.3V Pin: 50mA
Flash Memory: 32 KB of which 0.5 KB used by bootloader
SRAM: 2 KB (ATmega328)
EEPROM: 1 KB (ATmega328)
Clock Speed: 16 MHz

Chapter 3
Task performed

3.1 Light Emitting Diode (LED):


A light-emitting diode (LED) is a two-lead semiconductor light source device used for indicating the
output status by making it ON or OFF An LED is nothing but a p- n junction diode, which emits light
when provided with power supply. This effect of emitting energy in form of photons is called
electroluminescence.

10
Embedded systems 2020-21

Figure 3.1: LED

3.1.1 Advantages of LED:


1. The cost of LED's is less and they are tiny.

2. By using the LED's the electricity is controlled.

3. The intensity of the LED differs with the help of the microcontroller

3.1.2 Disadvantages of LED:


1. High up-front costs

2. Transformer compatibility.

3. Potential color shift over lamp life.

4. Overheating can cause reduced lamp life.

3.1.3 Applications of Light Emitting Diodes:


1. LED is used as a bulb in the homes and industries.

2. The light emitting diodes are used in the motorcycles and cars.

3.1.4 Interfacing of LED to Arduino UNO


Program
in t l ed p in = 1 3 ;
void setup ()
{
pinMode ( ledpin , OUTPUT) ;
}
Dept Of ECE, BIT, Bengaluru 11
void loop ()
{
d i g i t a l W r i t e ( ledpin , LOW) ;
delay ( 1 0 0 0 ) ;
d i g i t a l W r i t e ( ledpin , HIGH) ;
delay ( 1 0 0 0 ) ;

3.1.5 Pseudo code or Algorithm


• Initialize pin no of Arduino to which led is connected(ledpin=13).

• void setup()

Initialize digital pin LED BUILTIN as an output.

• void loop()-[the loop function runs over and over again forever]

Turn the LED off by making the voltage LOW.

Delay 1 second.

Turn the LED ON by making the voltage HIGH.

Delay 1 second.

12
Embedded systems 2020-21

3.2 Liquid Crystal Display (LCD)


A liquid-crystal display (LCD) is a flat-panel display or other electronically modulated optical device
that uses the light-modulating properties of liquid crystals. Liquid crystals do not emit light directly,
instead using a back light or reflector to produce images in colour or monochrome. LCD's are available to
display arbitrary images or fixed

ooiu
(/) 0 LU (/)< OrN(H IDQSOO z1 E £
LU QDQQQQQQLULU

0
0

Figure 3.2: Pins of LCD


images with low information content, which can be displayed or hidden, such as pre-set words, digits, and
seven-segment displays, as in a digital clock. They use the same basic technology, except that arbitrary images
are made up of a large number of small pixels, while other displays have larger elements. Liquid crystal display
is composed of several layers which include two polarized panel filters and electrodes. LCD technology is used
for displaying the image in notebook or some other electronic devices like mini computers.

Figure 3.3: LCD displayD


3.2.1 Advantages of LCD:
1. LCD's consumes less amount of power compared to CRT and LED

2. LCD's are consist of some micro watts for display in comparison to some mill watts for LED's

Dept Of ECE, BIT, Bengaluru 13


3. LCDs are of low cost

4. Provides excellent contrast.

3.2.2 Disadvantages of LCD:


1. Require additional light sources of temperature is limited for operation

2. Low reliability

3. Speed is very low

4. LCD's need an AC drive

3.2.3 Applications of Light Emitting Diodes:


1. Liquid crystal thermometer

2. Optical imaging

3. The liquid crystal display technique is also applicable in visualization of the radio frequency waves in the
wave guide

4. Used in the medical applications

14
Embedded systems 2020-21
3.2.4 Interfacing LCD to Arduino UNO

Program

#in c lu d e < Liq uid Crystal . h>


Liq uid Crystal l c d ( 10 , 9 , 8 , 7 , 6 , 5 ) ;

void setup ()
{
l c d . begin ( 16 , 2);

l c d . p r in t (” h e l lo , world ! ” ) ;
}

void loop () {
l c d . set Cursor ( 0 , 1);
l c d . p r in t ( m i l l i s ( )/ 1 0 0 0 ) ;
}

3.2.5 Pseudo code or Algorithm

• Include inbuilt library files of LCD.

• Initialize LCD with following connections.

• void setup()

Setup LCD Size: Columns, Rows.

Display a message on the LCD.

• void loop()-[the loop function runs over and over again forever]

Set position of the cursor to column 0, line 1(Counting starts from 0).

Displays the number of seconds since reset.

Dept Of ECE, BIT, Bengaluru 15


3.3 DC Motor
A DC motor is any of a class of rotary electrical machines that converts direct current
electrical energy into mechanical energy. The most common types rely on the forces produced
by magnetic fields. Nearly all types of DC motors have some internal mechanism, either
electromechanical or electronic; to periodically change the direction of current flow in part of the
motor.

Figure 3.4: DC Motor

3.3.1 Advantages of DC Motors


There are two primary advantages to DC motors:

1. Speed Variation

2. Torque

3.3.2 Interfacing DC motor to Arduino UNO

Program
const in t pwm = 2 ;
const in t in 1 = 8 ; const in t in 2 = 9 ;

void setup () {
pinMode (pwm,OUTPUT) ; pinMode ( in 1 ,OUTPUT) ; pinMode ( in 2 ,OUTPUT) ; }

16
Embedded systems 2020-21

void loop ()
{
d i g i t a l W r i t e ( in 1 , HIGH) ;
d i g i t a l W r i t e ( in 2 ,LOW) ;
analog Write (pwm, 2 5 5 ) ;
delay ( 3000 ) ;

d i g i t a l W r i t e ( in 1 , HIGH) ;
d i g i t a l W r i t e ( _in 2 , HIGH) ;
delay ( 1000 ) ;

d i g i t a l W r i t e ( in 1 ,LOW) ;
d i g i t a l W r i t e ( in 2 , HIGH) ;
delay ( 3000 ) ;

d i g i t a l W r i t e ( in 1 , HIGH) ;
d i g i t a l W r i t e ( _in 2 , HIGH) ;
delay ( 1000 ) ;
}

3.3.3 Pseudo code or Algorithm


• initialize pin 2 as pwm.

• provide logic to L298 IC to choose the direction of the DC motor.

• void setup()

set PWM pin as output.


Logic pins are set as output.

• void loop()-[the loop function runs over and over again forever]
To rotate in Clock wise motion set, in 1 =High, in 2=Low. pwm of the motor is set
to 255 to change the speed of rotation. delay 3 seconds.
For stop condition set,in 1=High,in 2=High.
To rotate in Clock wise motion set, in 1=Low, in 2=High.
For stop condition set,in 1=High,in 2=High.

Dept Of ECE, BIT, Bengaluru

17
3.4 Sensors
A sensor is a device, module, or subsystem whose purpose is to detect events or changes in
its environment and send the information to other electronics, frequently a computer processor.

3.4.1 Different Types of Sensors


1. Distance measurement Ultrasonic sensor

2. Temperature Sensor

3. Humidity Sensor

4. Moisture sensor

5. Rain sensor

6. Gas sensor

7. Fire sensor

18
Embedded systems 2020-21

3.4.1.1 Distance measurement Ultrasonic Sensor


1. ultrasonic sensor is an electronic device that measures the distance of a target object by
emitting ultrasonic sound waves, and converts the reflected sound into an electrical signal.

2. It is designed to measure the distance of any object by using an ultrasonic transducer.

3. This kind of measurement is particularly applicable to inaccessible areas where traditional


means cannot be implemented high temperature , pressure zones etc.

4. It uses an ultrasonic module interfaced to Arduino UNO.

5. An ultrasonic transducer comprising of a transmitter and receiver.

6. The transmitted waves are reflected back from the object and received by the transducer again.

7. Then the distance is calculated and displayed on an LCD screen.

8. Ultrasonic sensors are used primarily as proximity sensors.

9. They can be found in automobile self-parking technology and anti-collision safety systems.

Dept Of ECE, BIT, Bengaluru 19


3.4.1.2 Temperature Sensor
The LM35 generates higher output voltage than thermocouples and may not require that the
output voltage be amplified. It has an output voltage that is proportional to the Celsius
temperature.The scale factor of LM35 is 0.1 V/oC. The LM35 draws only 60 micro amps from its
supply and possesses a low self heating capability. The sensor self
heating causes less than 0.1 oC temperature rise in still air.

3.4.1.3 Features of LM35 Temperature Sensor


• Calibrated directly in Celsius (Centigrade).

• Rated for full l 55 to +150C range.

• Suitable for remote applications.

• Low cost due to wafer-level trimming.

• Operates from 4 to 30 volts.

• Low self-heating

Program
in t s e n s o r=A0 ;
f l o a t vals en ;
f l o a t tempc ;
void setup ()

20
Embedded systems 2020-21

{
S e r i a l . begin ( 9 6 0 0 ) ;
}

void loop ()
{
vals e n = analogRead ( s e n s o r ) ;
vals e n =( vals e n 500 )/ 1 0 2 3 ;
tempc=vals e n ;
S e r i a l . p r in t (” Temperature = ” ) ;
S e r i a l . p r in t ( tempc ) ;
delay ( 1 0 0 0 ) ;
}

3.4.1.4 Pseudo code or Algorithm


• Initialize pin of Arduino to which the sensor is connected(sensor=A0).

• Initialize float value to store value of sensor (float valsen).

• Initialize float value to store value detected from sensor (float tempc).

• void setup()
Define baud rate for serial communication to 9600.

• void loop()-[the loop function runs over and over again forever]
Read the analog pin.
convert output to readable Celsius.
Store the value of sensor in tempc variable.
print the temperature status.

Dept Of ECE, BIT, Bengaluru 21


3.4.1.5 Humidity Sensor

Soil moisture sensor measure the water content in soil. Measuring soil moisture is important in
agriculture to help farmers manage their irrigation systems more effi- ciently.Farmers also able to
increase yields and the quality of the crop by better management of soil moisture during critical plant
growth stages.The module uses LM393 comparator to compare the soil moisture level with the pre-
set threshold. When the soil moisture deficit module outputs a high level, and vice versa.

3.4.1.6 Features of DHT11 Humidity Sensor


• Operating Voltage: 3.5V to 5.5V.

• Operating current: 0.3mA (measuring) 60uA (standby)

• Output: Serial data

• Temperature Range: 0°C to 50°C

• Humidity Range: 20

• Resolution: Temperature and Humidity both are 16-bit

Program
#in c lu de "DHT. h"
DHT dht ;
void setup ()

22
Embedded systems 2020-21

S e r i a l . begin ( 9 6 0 0 ) ;
Serial.println();
S e r i a l . p r i n t l n (” Status \ tHumidity (%)\ tTemperature (C)\ t (F) ” ) ;
dht.setup ( 2) ;
}

void loop ()
{
delay ( dht . getMinimumSamplingPeriod ( ) ) ;
f l o a t humidity = dht . get Humidity ( ) ;
f l o a t temperature = dht . get Temperature ( ) ;

S e r i a l . p r in t ( dht . g e t Sta tu s Str in g ( ) ) ;


S e r i a l . p r in t (” \ t ” ) ;
S e r i a l . p r in t ( humidity , 1);
S e r i a l . p r in t (”\t \ t ” ) ;
S e r i a l . p r in t ( temperature , 1);
S e r i a l . p r in t (”\ t \ t ” ) ;
S e r i a l . p r i n t l n ( dht . to Fahrenheit ( temperature ) , 1) ;
}

3.4.1.7 Pseudo code or Algorithm


• Include the library of DHT11 temperature and humidity sensor.

• Selecting the type of DHT sensors..

• void setup()
Define baud rate for serial communication to 9600.
The sensor will start working.
Set pin for data communication.

• void loop()-[the loop function runs over and over again forever]
Delay is given by amount equal to sampling period.
Get humidity value Get temperature value.
print the temperature and humidity status.
Convert temperature to Fahrenheit units.

Dept Of ECE, BIT, Bengaluru 23


3.4.1.8 Moisture Sensor
Soil moisture sensors measure the volumetric water content in soil. The relation between the
measured property and soil moisture must be calibrated and may vary depending on environmental
factors such as soil type, temperature, or electric conductiv- ity.Reflected microwave radiation is
affected by the soil moisture and is used for remote sensing in hydrology and agriculture. Portable
probe instruments can be used by farmers or gardeners.

3.4.1.9 Features of LM35 Soil Moisture Sensor


• Operating Voltage: 3.3V to 5V DC.

• Operating Current: 15mA.

• Output Digital - 0V to 5V,

• Output Analog - 0V to 5V

• LED's indicating output and power

• PCB Size: 3.2cm x 1.4cm

Program
const in t s e n s o r_p in = A1 ;
void setup () {
S e r i a l . begin ( 9 6 0 0 ) ;

24
Embedded systems 2020-21

void loop ()
{
f l o a t m o i s ture pe rce nta ge ;
in t s e n s o r a n a lo g ;
s e n s o r a n a lo g = analog Read ( s e n s o r p in ) ;
mo i s ture _pe rce nta ge = ( 100 - ( ( s e n s o r a n a lo g / 1023.00 ) * 100 ) );
S e r i a l . p r in t (” Moisture Percentage = ”) ;
S e r i a l . p r in t ( mo i s ture pe rce ntage ) ;
S e r i a l . p r in t (”%\n\n ” ) ;
delay ( 1 0 0 0 ) ;
}

3.4.1.10 Pseudo code or Algorithm

• Initialize pin of Arduino to which the sensor is connected(sensor pin=A1).

• void setup()
Define baud rate for serial communication to 9600.

• void loop()-[the loop function runs over and over again forever]
Initialize float value to store value of sensor (moisture percentage)
Initialize the value to store analog value of sensor.
Calculate the moisture percentage by using formula.
Print the moisture status.

Dept Of ECE, BIT, Bengaluru 25


3.4.1.11 Rain Sensor

The rain sensor is an easy tool for rain detection. It can be used as a switch when raindrop falls
through the raining board and also for measuring rainfall intensity. The module features, a rain board
and the control board that is separate for more convenience, power indicator LED and an adjustable
sensitivity though a potentiometer.

3.4.1.12 Features of LM35 Rain Sensor

• Working voltage: 5V

• Output format: Digital switching output (0 and 1) Analog voltage output AO

• driving ability: over 15mA

• Small board PCB size: 3.2cm x 1.4cm

Program
const in t sensor Min = 0 ;
const in t sensorMax = 1024 ;
void setup ()
{
S e r i a l . begin ( 9 6 0 0 ) ;
}

void loop ()

in t sensor Reading = analogRead (A0 ) ;


in t range = map( sensor Reading , sensorMin , sensorMax , 0,3);

{
26
Embedded systems 2020-21

switch ( range )
{
case 0:
S e r i a l . p r i n t l n ("RAINING" ) ;
break ;

case 1:
S e r i a l . p r i n t l n ("RAIN WARNING" ) ;
break ;

case 2:
S e r i a l . p r i nt l n ("NOT RAINING" ) ;
break ;
}
delay ( 1 0 0 0 ) ;
}

3.4.1.13 Pseudo code or Algorithm

• Initialize the lowest and highest sensor readings with type as an integer and variable
name.

• void setup()
Define baud rate for serial communication to 9600.

• void loop()-[the loop function runs over and over again forever]
Code reads the analog signal at A0 pin from Rain sensor and maps those measured value
with initialized values.
Checks the measured value with pre-stored condition and displays the weather condition
like RAINING, RAIN WARNING NOT RAINING.
case 0: Sensor getting completely wet it displays “RAINING".
case 1: Sensor getting partially wet it displays “RAIN WARNING". case 2: Sensor dry it
displays “NOT RAINING".

3.4.1.14 Gas Sensor


A gas sensor is a device which detects the presence or concentration of gases in the
atmosphere.Based on the concentration of the gas the sensor produces a corresponding potential
difference by changing the resistance of the material inside the sensor, which can be measured as

Dept Of ECE, BIT, Bengaluru 27


output voltage.

3.4.1.15 Features of MQ2 Gas Sensor

• Operating Voltage is +5V

• Can be used to Measure or detect LPG, Alcohol, Propane, Hydrogen, CO and even methane

• Analog output voltage: 0V to 5V

• Digital Output Voltage: 0V or 5V (TTL Logic)

• Preheat duration 20 seconds

• Can be used as a Digital or analog sensor

• The Sensitivity of Digital pin can be varied using the potentiometer

Program

#d e f in e MQ2pin ( 0 )
fl o a t sensor Value ;
void setup ()

S e r i a l . begin ( 9 6 0 0 ) ;
S e r i a l . p r i n t l n (” Gas s e ns o r warming up ! ” ) ;
delay ( 2 0 0 0 0 ) ; m up
}

28
Embedded systems 2020-21

void loop ()
{
sensor Value = analogRead ( MQ2pin ) ;
S e r i a l . p r in t (” Sensor Value : ”);
S e r i a l . p r in t ( sensor Value ) ;

if(sensor Value > 300)


{
S e r i a l . p r in t (” | Smoke detected ! ” ) ;
}

Serial.println(””);
delay ( 2 0 0 0 ) ;
}

3.4.1.16 Pseudo code or Algorithm

• Define pin MQ2.

• Declare variable to store sensor value.

• void setup()
Define baud rate for serial communication to 9600.

• void loop()-[the loop function runs over and over again forever]
Read analog input pin of sensor
case : If sensor value is greater than 300 it displays “Smoke detected!”
Print the Gas sensor status.

Dept Of ECE, BIT, Bengaluru 29


3.4.1.17 Fire Sensor

A fire detector works by detecting smoke.These devices respond to the presence of smoke or
extremely high temperatures that are present with a fire.After the device has been activated, it will
send a signal to the alarm system to perform the programmed response for that zone.

3.4.1.18 Benefits of fire Sensor

• A primary/secondary power supply, including batteries

• A sensitive carbon monoxide and/or smoke detector

• Audible alerts, flashing lights, and other notifications

• Pull stations, smoke alarms, and other initiating devices

• A control panel for constant monitoring and dispatch management

30
Embedded systems 2020-21

Program
const in t buzzer Pin = 1 2 ;
const in t f lame Pin = 1 1 ;
in t Flame = HIGH;

void setup ()
{
pinMode ( buzzer Pin , OUTPUT) ;
pinMode ( f lame Pin , INPUT) ;
S e r i a l . begin ( 9 6 0 0 ) ;
}

void loop ()
{
Flame = d ig i ta l Re a d ( f lame Pin ) ;
i f ( Flame== LOW)
{
S e r i a l . p r i n t l n (" Fire ! ! ! " ) ;
d i g i t a l W r i t e ( buzzer Pin , HIGH) ;
}
else
{
S e r i a l . p r i n t l n ("No w o r r i e s " ) ;
d i g i t a l W r i t e ( buzzer Pin , LOW) ;
}
}

3.4.1.19 Pseudo code or Algorithm

• Define pins for Flame sensor=11, buzzer=12 which are connected to Arduino.

• void setup()

pinMode() function is used to configure Buzzer and Flame pin to behave as Output
and Input respectively.
Define baud rate for serial communication to 9600.

• void loop()-[the loop function runs over and over again forever]

If case 1: Flame== LOW it displays “Fire!!!".


Else case 2: Flame== HIGH it displays “No worries".

Dept Of ECE, BIT, Bengaluru 31


3.5 Universal asynchronous receiver-transmitter
A universal asynchronous receiver-transmitter (UART) is a computer hardware device for
asynchronous serial communication in which the data format and transmission speeds are
configurable. The electric signalling levels and methods are handled by a driver circuit external
to the UART. A UART is usually an individual (or part of an) integrated circuit (IC) used for
serial communications over a computer or peripheral device serial port. One or more UART
peripherals are commonly integrated in microcontroller chips.

3.5.1 UART Communication


In UART communication, two UARTs communicate directly with each other. The
transmitting UART converts parallel data from a controlling device like a CPU into serial form,
transmits it in serial to the receiving UART, which then converts the serial data back into parallel
data for the receiving device. Only two wires are needed to transmit databetween two UARTs.
Data flows from the Tx pin of the transmitting UART to the Rx pin of the receiving UART:

Figure 3.7: Block diagram of UART communication


3.5.2 Applications of UART
UARTs are commonly seen in microcontrollers. In microcontrollers, UARTs are used for

32
Embedded systems 2020-21

specific purposes. UARTs are also found in devices such as Bluetooth modules, wireless
communication, GPS units, modems and many other day-to-day applications.

3.6 Radio Frequency Identification (RFID)


RFID (radio frequency identification) is a form of wireless communication that incor-
porates the use of electromagnetic or electrostatic coupling in the radio frequency portion of
the electromagnetic spectrum to uniquely identify an object, animal or personThere are two
main types of RFID tags: active RFID and passive RFID. An active RFID tag has its own
power source, often a battery. A passive RFID tag, on the other hand, does not require
batteries; rather it receives its power from the reading antenna, whose electromagnetic wave
induces a current in the RFID tag's antenna.

Figure 3.8: RFID reader

3.6.0.1 RFID frequencies: Types of RFID systems

There are three main types of RFID systems:

1. Low frequency (LF)

2. High frequency (HF)

3. Ultra-high frequency (UHF).

Dept Of ECE, BIT, Bengaluru 33


3.6.1 RFID applications and use cases
RFID dates back to the 1940s; it was used more frequently in the 1970s. However, the high
cost of the tags and readers has prohibited widespread commercial use. As hardware costs have
decreased, RFID adoption has increased. The most common RFID application is for tracking and
management. This includes pet and livestock tracking, inventory management and asset tracking,
cargo and supply chain logistics, and vehicle tracking. RFID can also be used in retail for
advertising customer service and loss control; in the supply chain for improved visibility and
distribution; and in security situations for access control. Multiple industries use RFID
applications, including healthcare, manufacturing, retail, business and home use.

3.7 GSM (Global System for Mobile Communication)


GSM is a digital mobile telephony system. GSM digitizes and compresses data, then sends it
down a channel with two other streams of user data, each in its own time slot. It operates at
either the 900 MHz or 1800 MHz frequency band.
The below figure shows how to interface the GSM with microcontroller. The GSM module
communicate the microcontroller with mobile phones through UART. To communicate over
UART or USART, we just need three basic signals which are namely, RXD (receive), TXD
(transmit), GND (common ground).
GSM modem interfacing with microcontroller for SMS control of industrial equipment's. The
sending SMS through GSM modem when interfaced with microcontroller or PC is much simpler
as compared with sending SMS through UART.
The transmit signal of serial port of microcontroller is connected with transmit signal (TxD) of
the serial interface of GSM Modem while receive signal of microcontroller serial
port is connected with receive signal (RxD) of serial interface of GSM Modem.
UARTD8-9 8051
Connector lines Serial Port Section

£5 TXM P30
s o

4 JI
ta
x a. PlXD-0 P3J

H * T®4 Pl.2
a?
<i
D
RXD’l PIT

34
Embedded systems 2020-21

Chapter 4
Project

4.1 Obstacle avoidance Robot


A robot is a machine, especially one programmable by a computer, capable of carrying out a
complex series of actions automatically. Robots can be guided by an external control device or
the control may be embedded within. Robots may be constructed to take on human form but
most robots are machines designed to perform a task with no regard to how they look. By
interfacing the programs, we can run the robot. An Arduino based obstacle avoidance robot uses
ultrasonic sensor to avoid collisions

4.2 Hardware Required


1. Arduino Uno

2. Ultrasonic Range Finder Sensor - HC - SR04

3. Motor Driver IC - L293D

4. Servo Motor

5. Geared Motors x 2

6. Robot Chassis

7. Power Supply

4.3 Software used


1. Arduino IDE

2. Embedded C

Dept Of ECE, BIT, Bengaluru 35


4.4 Circuit Diagram

• Arduino is the main processing unit of the robot. Out of the 14 available digital I/O pins, 7
pins are used in this project design.

• The ultrasonic sensor has 4 pins: Vcc, Trig, Echo and Gnd. Vcc and Gnd are connected to the
+5v and GND pins of the Arduino. Trig (Trigger) is connected to the 9th pin and Echo is
connected to 8th pin of the Arduino UNO respectively.

• L293D is a 16 pin IC. Pins 1 and 9 are the enable pins. These pins are connected to +5V. Pins
2 and 7 are control inputs from microcontroller for first motor. They are connected to pins 6
and 7 of Arduino respectively.

• Similarly, pins 10 and 15 are control inputs from microcontroller for second motor. They are
connected to pins 5 and 4 of Arduino. Pins 4, 5, 12 and 13 of L293D are ground pins and are
connected to Gnd.

• First motor (consider this as the motor for left wheel) is connected across the pins 3 and 6 of
L293D. The second motor, which acts as the right wheel motor, is connected to 11 and 14
pins of L293D.

• The 16th pin of L293D is Vcc1. This is connected to +5V. The 8th pins is Vcc2. This is the
motor supply voltage. This can be connected anywhere between 4.7V and 36V. In this
project, pin 8 if L293D is connected to +5V supply.

36
Embedded systems 2020-21

4.5 Working Principle


The obstacle avoidance robot uses ultrasonic sensors for its movements. A microcontroller
of 8051 families is used to achieve the desired operation. The motors are connected through the
motor driver IC to the microcontroller. The ultrasonic sensor is attached in front of the robot.
Whenever the robot is going on the desired path the ultrasonic sensor transmits the ultrasonic
waves continuously from its sensor head. Whenever an obstacle comes ahead of it the ultrasonic
waves are reflected from an object and that information is passed to the microcontroller. The
microcontroller controls the motors left, right, back, front, based on ultrasonic signals.

4.5.1 Operation of the ultrasonic sensor


• When an electrical pulse of high voltage is applied to the ultrasonic transducer it vibrates
across a specific spectrum of frequencies and generates a burst of sound waves.

• Whenever any obstacle comes ahead of the ultrasonic sensor the sound waves will reflect
in the form of echo and generates an electric pulse.

• It calculates the time taken between sending sound waves and receiving the echo.

• The echo patterns will be compared with the patterns of sound waves to determine the
detected signal's condition.

Trigger Pulse Input

Measuring Pulse (8x)

EduPiiseW clband the


d stance at in propatcn
Echo Pulse Output

4.6 Working
1. Using an external trigger signal, the Trig pin on ultrasonic sensor is made logic high for at
least 10ps. A sonic burst from the transmitter module is sent. This consists of 8 pulses of
40KHz.

2. After running the program the robot moves in the forward direction. Using an external trigger

Dept Of ECE, BIT, Bengaluru 37


signal, the Trig pin on ultrasonic sensor is made logic high for at least 10 ps.

3. A sonic burst from the transmitter module is sent. This consists of 8 pulses of 40KHz.The
signals return back after hitting a surface and the receiver detects this signal.

4. The signals return back after hitting a surface and the receiver detects this signal. The Echo
pin is high from the time of sending the signal and receiving it. This time can be converted to
distance using appropriate calculations.

5. During this time, the ultrasonic sensor continuously calculate the distance between the robot
and the reflective surface.

6. This information is processed by the Arduino. If the distance between the robot and the
obstacle is greater than equal to 30cm moves forward.

7. If the distance between the robot and the obstacle is greater than equal to 15cm and less than
25cm than it turns right else it moves backward and turns right.

38
Embedded systems 2020-21

Chapter 5
Implementation

5.1 Flow chart

Turn Left

• Start the operation.

• It initializes ultrasonic sensor, motor driver and other components of model. Ultrasonic
sensor reads the distance between robot and obstacle.

• Case 1: If distance is less than 30cm


Yes-Robot moves forward.
No-Reads the distance.

• Case 2: If distance is greater than 15 and less than 25


Yes-Robot turn right and moves forward.
No-Robot moves backward, turns left and moves forward

Dept Of ECE, BIT, Bengaluru 39


5.2 Interfacing robot program

Program

#d e f in e echopin 8
#define t r ig p in 9
int maximumRange = 3 0;
long duration , distance;
void setup ()
{
pinMode (t r ig p in , OUTPUT) ;
pinMode ( echopin , INPUT); pinMode (4,
OUTPUT);
pinMode (5, OUTPUT);
pinMode ( 13 , OUTPUT); pinMode (6, OUTPUT);
pinMode (7, OUTPUT);
}

void loop ()
{

digitalWrite (trigpin ,LOW);


delay Microseconds (2);
digitalWrite (trigpin , HIGH) ; delay Microseconds
(10);
duration = p u I se In (echopin ,HIGH); distance=
duration /58.2;
delay (50);
}

if ( d ista nee >= 30 )


{
digitalWrite (4 ,HIGH);
digitalWrite (6,HIGH); digitalWrite (5 ,LOW);
digita IWrite (7,LOW);
delay (200);
else if (distance >=15 && distance <= 25) {
d igita I Write (6 ,HIGH);

i
4
0
Embedded systems 2020-21
digita IWrite (5 ,LOW);
digitalWrite (4 ,LOW);
digitalWrite (7,LOW); delay (1000);

digitalWrite (4 ,HIGH);
digitalWrite (6,HIGH); digitalWrite (5 ,LOW);
digita IWrite (7 ,LOW); delay (200);
}

else ( d ista nee < 15)


{
digitalWrite (4, LOW);
digitalWrite (6, LOW); d igita I Write (5 ,HIGH);
digitalWrite(7 ,HIGH) ; delay (1000);

digitalWrite (4,HIGH);
digitalWrite ( 5 ,LOW);
digitalWrite ( 6 ,LOW);
digitalWrite (7, LOW); delay (1000);

digitalWrite (4,HIGH);
digitalWrite (6,HIGH);
digitalWrite (5 ,LOW); digita IWrite
(7 ,LOW); delay (200);

Dept Of ECE, BIT, Bengaluru 41


5.3 Pseudo code or Algorithm
• Define trig and echo pin of HC-SR04.
Trig pin is connected to GPIO9 and echo pin is connected to GPIO10 of Arduino NANO.

• Define pins for input of LM298N Motor Driver Module.


The LM298N has 4 data input pins used to control the direction of motor connected to it.

• void setup()
Define the data direction of utilised GPIO pins.
The four Motor pins and Trig pin is set as OUTPUT and Echo Pin is set as input.

• void loop()-[the loop function runs over and over again forever]
Get the distance from HC-SR04 and based on the distance move the motor direction.
If the distance is greater than the defined distance means there is not obstacle in its path and
it will moving in forward direction.
If the distance is less than the defined distance to avoid obstacle means there is some
obstacle ahead.
1) Turns right and moves forward.

2) Moves backwards and turns left and moves forward

42
Embedded systems 2020-21

5.4 Result

Distance (D) = ( t *c )/2


For t =0.00146 s ; D=25cm
For t =0.0026 s ; D=45cm
For t =0.0017 s ; D=30cm
For t =0.00087 s ; D=15cm

where t= time duration b/w tra n s m i s s io n and r e c e p t io n o f puls e c=speed o f sound in a i


r (341m/ s )

5.5 Applications
• Obstacle avoiding robots can be used in almost all mobile robot navigation systems.

• They can be used for household work like automatic vacuum cleaning.

• They can also be used in dangerous environments, where human penetration could be fatal.

• They can be used for army applications.

• They can be used in unmanned vehicle driving.

• They can also be used in Smart room cleaner.

Dept Of ECE, BIT, Bengaluru 43


Chapter
Outcomes of Internship

1. I have carried out my internship in Technofly Solutions. I have learnt about Embedded
Systems, ARM LPC-2148 and Arduino microcontroller.

2. Designed an embedded system to control robotic motions using various sensors.

3. I have learnt in a friendly environment and all my friends and mentors were supportive to
me.

4. I have also learnt about interfacing of LED, LCD, Sensors, GSM, keypad, Buzzer and
UART.

5. I have done mini-project which involves the control of movement of Robot using Arduino,
DC Motor, Ultrasonic sensor, Servo motor.

44
Embedded systems 2020-21

Chapter 7
Reflection

1. My internship at the Technofly solutions pvt.ltd has significantly improved my knowledge


of the workings of technological worlds and left me with skills that will be useful
throughout my career.

2. . I learned that programming is not a direct route, rather the programmer can be creative
and has choices. A program is a personal thing, but must be adapted to be easily used by
any person. Thus, my internship at Technofly solutions has left me with a series of
technical and personal skills.

3. The main outcome during the internship was understanding the working of Armv7,
Arduino Uno board and embedding system.

4. Learnt the embedded system software substantially and made me to work in groups and as
individual meeting the deadlines.

Dept Of ECE, BIT, Bengaluru 45


Chapter
Conclusion

1. Studied about the embedded systems.

2. . Learnt about the organization, its department and services provided.

3. Collected the general information about Electronics and Power Supplies in particular.

4. A wrongly designed power supply may cause the embedded system in inconsistent
operations, or malfunctioning or permanent damage.

5. Hands on programming with C language gave a lot of insight into the language and aided
in understanding the ease of programming with high level languages.

46

You might also like