0% found this document useful (0 votes)
265 views75 pages

Advanced Public Bus Transport Management System

Uploaded by

Bhanu B Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
265 views75 pages

Advanced Public Bus Transport Management System

Uploaded by

Bhanu B Prakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 75

ADVANCED PUBLIC BUS TRANSPORT MANAGEMENT SYSTEM:

AN INNOVATIVE SMART BUS CONCEPT


Abstract
In the present era, public bus transportation services often lag behind in adopting modern
technologies, resulting in numerous operational complexities. These issues encompass
challenges such as poor passenger density control, operational inefficiencies, inadequate live
tracking, limited realtime capabilities, suboptimal resource management, route ambiguities,
safety concerns, and more. This research paper introduces a comprehensive solution an
Advance Public Bus Transport Management System (APBTMS) that aims to address these
challenges for the benefit of both passengers and transport management authority. Our
proposed system leverages various sensors and IoT (Internet of Things) modules deployed
within buses to monitor various onboard activities and physical environmental factors. These
enable the making of data-driven decisions in real-time, Facilitating improved operational
control. Key components of the system include GPS (Global Positioning System) tracking for
real-time bus location updates, passenger density/count through CV (Computer Vision), and
continuous monitoring of physical environmental factors such as temperature, humidity,
sound magnitude, and vibration magnitude which facilitate accident/abnormalities detection,
Fire detection and helps in continuously monitoring road quality. The application of CV
technology, along with passenger count, can detect harm-causing objects inside a bus and can
compare the faces of passengers with black-listed passengers (involved in previously reported
crimes such as theft, and nuisance). Passengers benefit from these advancements through a
dedicated mobile application. A User-friendly website is also offered to public bus transport
management authority providing various useful functionalities. With the addition of safety
features like realtime speed detection and many other capabilities in the future, our proposed
system can expand its benefits to school bus services and other public transportation services .
Introduction
Major changes are occurring quickly in many facets of urban life, including roadside
development and infrastructure development. One area of particular concern is the current
state of public transportation, specifically the city bus system. The existing system is not safe
and easily trackable. Often general public has to wait for long durations at bus stops. There is
a pressing need to develop and implement a smart transportation system due to the
significantly increasing population in major cities. It is proposed to upgrade the existing
system by incorporating modern technologies like IoT, CV, Cloud Computing, and ML
(Machine Learning)) to address these issues. This would allow for real-time tracking of bus
locations and improve the efficiency of the overall transportation system[1]. Incorporating a
smart bus system would make it easier to deal with operational complexities, providing
passengers and transport authority with a more efficient and reliable service. The bus
transportation system is plagued by overcrowding, with too many passengers and not enough
seats. This problem is compounded by the lack of technology to predict passenger density,
leading to uncomfortable and potentially dangerous situations such as pushing and injuries.
To Overcome this problem CV techniques can be used. In the unfortunate event of a serious
collision or accident, our IoT device immediately detects it by recognizing abnormal trends in
collected data. This ensures that injured passengers get help promptly, potentially saving
lives. Additionally, our IoT system constantly monitors road conditions by studying collected
vibration magnitude from sensors respective to latitude and longitude. If there's a fire on the
bus, our system is equipped to detect it using a flame sensor and instantly alert the transport
authorities. This quick response enhances passenger safety during emergencies. Furthermore,
the IoT device placed within buses will continuously monitor temperature, humidity, and
other physical environment factors. The Internet of Things (IoT), CV, ML, and Cloud
computing have the potential to revolutionize the way public transport is managed. Data
generated by IoT devices is seamlessly transmitted to and managed by AWS(Amazon Web
Services). In this research paper, we propose the Advance Public Bus Transport Management
System (APBTMS) as an innovative smart bus concept. The APBTMS can help a large
portion of the population every day by reducing their wait times. Even if each passenger
saves 5 minutes, the total time saved can be significant. It contains features such as real-time
threat and nuisance detection which ensures safe travel for every passenger. The rules and
regulations for the passenger capacity of buses can be constantly checked by management
authority using the passenger counting feature. passengers carried by the vehicle must not
exceed the maximum limit set by the transportation authority. Additionally, in the event of
accidents or high-impact collisions, the system swiftly detects and is notified to initiate
assistance, prioritizing passenger safety. The Android Application for passengers is built
taking inspiration from [2]. The sensor collected data can be used to predict many trends and
recognize patterns such as peak passenger density time, prediction of an optimal number of
buses on a particular route, and optimal position for setting up bus stops[3]. APBTMS is a
concept for a smart bus system that improves the management and operation of public bus
transportation. This would make it possible for the transportation authority to monitor and
manage the bus system in real-time and to make data-driven decisions that would optimize
operations and enhance the overall passenger experience. The APBTMS project aims to
develop a flexible public bus transportation system that can respond to changing conditions
and user demands.
Existing system
Current bus transport management systems lack heavily on technology utilization and hence
majority of work is done manually. In [4], the authors proposed a programming model where
an application can be distributed onto a wide range of devices such as CCTV cameras, and
roadside units. Also, IR sensors mounted near entry/exit doors are used extensively for
calculating the crowd, which has many drawbacks such as less accuracy in counting when
multiple people are entering or leaving the bus simultaneously. The authors in [5] discuss the
characteristics of fog computing and the services that can be provided on a fog computing
platform for vehicular ad-hoc networks (VANETs). They also mention some challenges and
issues that need to be addressed in order to fully utilize fog computing in VANETs, as well as
potential research directions for future work in this area. In reference [6], the authors utilize
V2I (vehicle-to-infrastructure) communication techniques to collect information from
vehicles such as speed, heading, and acceleration. The authors in reference [7] propose the
use of an architecture called vehicular fog computing (VFC) to utilize the collaboration of
multiple end-user clients or nearby edge devices for communication and computation in
smart traffic control systems
Proposed system
The primary objective of this research is to develop a system that will enhance public bus
transportation for local commuters and management authority. Our proposed system, called
the Advance Public Bus Transport Management System (APBTMS), provides various
functionalities such as live tracking of bus location, passenger density monitoring, streaming
of real-time bus information, High collision, Fire detection, Continuous monitoring of road
quality, and detecting abnormal trends. Fig. 1 provides a general overview of APBTMS. IoT
device is placed inside the bus at a strategic position which periodically captures the bus
inside image and collects data about physical environment factors using various sensors. The
pictorial circuit diagram is presented in Fig. 2. The OV2640 Camera module is used to
capture bus inside image and transmit image data, GPS module provides real-time latitude
and longitude information of the bus. Temperature, Humidity, Sound magnitude (dB), and
Vibration magnitude are also being collected. Sensors and IoT module information is
provided in the The Collected data is transmitted to storage and database services provided by
Amazon Web Services (AWS) using the GSM (Global System for Mobile Communication)
module. Bus inside image is stored as an object in a dedicated AWS S3 bucket and processed
using AWS Rekognition service to get passenger density count, detect harm-causing objects
and black-listed passengers (people suspected of previous crimes such as theft and nuisance)
using DetectLabels and CompareFaces API (Application Programming Interface). Collected
data about physical environment factors gets updated in a dedicated table provided by AWS
DynamoDB service. Mobile Application and management website fetch real-time bus
information from these periodically updated tables and S3 bucket objects. Bus inside images
and collected data of physical environment factors are also being stored with Date Time for
future data analysis to predict trends, extract patterns, make data-driven decisions, and
optimize transport resource allocation. AWS S3, DynamoDB, API Gateway, and Lambda
services are extensively used. represents the Complete Cloud Architecture diagram of
APBTMS. Mobile Application for passengers is built using Flutter SDK and uses Google
Maps API to represent the live location of the bus. The application provides live passenger
density in buses, Notifications from management authority, a Portal to report nuisance or any
other issue, Bus related information (Bus number plate, driver photo, driver name, etc).
Website is built using Node.js, HTML, and CSS for transport management authority,
Providing features like live location, sensor-collected data, passenger density monitoring,
Portal for sending notifications to passengers, Tabular representation of real-time bus
information, functionality for updating bus-specific information, Notification panel which
alerts authority in case of accident and abnormal physical environment factor readings.
Literature survey
S. Akter, T. Islam, R. F. Olanrewaju and A. A. Binyamin, "A Cloud-Based Bus Tracking
System Based on Internet-of-Things Technology," 2019 7th International Conference on
Mechatronics Engineering (ICOM), Putrajaya, Malaysia, 2019, pp. 1-5, doi:
10.1109/ICOM47790.2019.8952037.

The technological rise in public transportation is on the horizon, but the bus network structure
and intelligent bus tracking system should first be in place. Bus transport service is on the
edge of digital revolution, generating real-time tracking information about the bus service
using smartphones. In this paper, a cloud-based bus tracking system based on IoT is proposed
to reduce human intervention, waiting time and energy. The exact location and arrival time of
the bus can be tracked dynamically by using a mobile application to provide better and
efficient bus service. Furthermore, passengers can buy tickets without queueing and book the
available seats by making online payments. The proposed scheme allows more flexibility and
user satisfactory service to the rider in terms of time loss and encourages more people to ride
by providing real-time bus tracking information to improve passenger satisfaction. The main
objective is to minimize the unnecessary waiting and queueing time uncertainty of
passengers. Riders can utilize their waiting time more productively by choosing the nearest
route and alternative transportation. The sustainability of public transport service can be
maintained by providing noteworthy benefits to the passengers using the proposed IoT-based
bus tracking system. In the early stage of human civilization, people depended on animals for
moving goods and themselves from one place to another. The invention and proper uses of
the wheel were the great blessings of human life. As a sequence, vehicular transportation
brings a new era of human movement. Since the beginning of the transportation system,
public transport especially the bus plays important roles in moving faster [1]. With passage of
time, the demand for public transport has increased due to the need to convey more
passengers at a time and costeffectiveness [2; 3]. However, the accessibility of public
transport is never an easy go by issue. People always have to go through hard times getting
public transport on time due to mismatch in the bus schedule. Consequently, passengers have
to face tremendous trouble in almost every country in the world. This is the case most
especially during festive moods, it gets really tasking getting ticket for public transportation
because of the high demand and low cost [5; 6]. To cap it all, there is tendency to waste
valuable working hours and energy every single day for waiting and queueing for the public
bus services. This paper proposes a mobile application architecture on the Internet of Things,
IoT, for public bus service, so that, passengers can be able to track the specific location of bus
and know when the next bus is coming to a particular stoppage. Besides, this app will allow a
passenger to buy a ticket online via an online wallet or mobile banking system that reduce the
queueing time for buying ticket manually. In addition, the user will be able to choose
available seat via the proposed app.

Kumar, A., & Thomaz, A. C. F. (2022). Smart bus ticketing system through IoT enabled
technology. Big Data and Computing Visions, 2(1), 1-8. doi:
10.22105/bdcv.2022.326976.1046

Sustainable urban mobility requires optimizing public transit passenger experiences. This
system integrates cloud technologies and the Random Forest algorithm with bus fare ticketing
systems to improve efficiency and customer pleasure. Cloud systems provide real-time data
processing for price structure and route optimization in research. Cloud computing lets
transportation providers quickly adjust to shifting demand, enhancing service dependability
and responsiveness. The Random Forest algorithm is integrated into ticketing procedures to
estimate passenger demand and optimize prices. Historical ridership data, weather, and
special events are used to provide reliable fare estimates and suggestions using machine
learning. This case study shows that the suggested approach improves passenger experience,
waiting times, and system efficiency in a metropolitan transport network. Scalable, cloud-
based infrastructure adapts to different transportation system sizes and configurations.
Findings show that cloud computing and machine learning algorithms may make public
transportation systems more responsive and passenger-centric. As cities seek smarter, more
environmentally friendly transportation solutions, such breakthrough technology offers
potential for public transit. With the global population constantly rising, transportation
services are in more demand than ever. With regard to India, over 67 million of the country's
people are considered to be of low socioeconomic status, whereas over 40 million are
considered to be middle class [1]. Meanwhile, these communities overwhelmingly support
public transit rather than purchasing or operating a personal vehicle. People have always
preferred public transportation since it is the most cost-effective option for them. Everyday
living has been made more accessible by the constant development of new transportation
methods. It recognizes the importance of transportation to people's daily lives and has
developed an Android app to streamline the process. The Android app has a QR scanner for
the bus ticket system [2]. The Android smartphone plays a vital role in human existence by
allowing individuals to maintain constant online connectivity. It proposed implementation of
a QR scanner into the bus ticketing system. The smart application will automatically assign
seats to passengers, allow digital ticket bookings, and accept cashless payments, encouraging
digitalization and smart cities. The user's source will be updated automatically when
connected to the bus stop device [3]. The user can check seat availability, order tickets, obtain
a seat instantly, and see the displayed waiting time. The system will assign the seat that will
be unoccupied in the shortest time if seats are not available. When the user connects to the
device at a bus stop and pays digitally via the site, buy a ticket and enjoy an innovative and
pleasant bus service. The bus conductor will verify the ticket booking acknowledgment, an e-
Ticket. RFID-based ticketing systems are superior. Passengers will have RFID tags with
unique IDs and data [4]. Passengers enter the bus and strike the RFID reader. Thus, database
data is retrieved to build E-Ticket. The Computing Device receives RFID tag data from the
RFID Reader. This computer device's GPS module tracks position, and the GSM module
accesses the database. The computer equipment calculates the fee based on the passenger's
distance and deducts it from the account of the vehicle. Smart Bus System offers electronic
ticket booking. The bus's entrance and exit gates have two components. Each device scans the
entry and departure of people using RFID tags [5]. Each device features a GPS module that
updates the bus's position at brief intervals, helping to track passengers at both times. The
technology calculates the fee based on distance and subtracts it from the passenger's E-wallet,
which can be handled through the S-Bus mobile app. The suggested system would include
two Android apps for passengers and bus conductors and one website for admin, and a GPS
module on the bus. The bus's current position with time andother choices and software lets
users book tickets by choosing a source and destination and generating a QR code [6]. The
conductor will scan the QR code on the passenger's smartphone and deduct the money from
the user's wallet before sending the ticket. Passengers can track buses this way. The conductor
presses the failed button to notify the server of the bus failure. Each bus has a conductor who
collects money and distributes tickets. It is time-consuming and error-prone. A new system
solves this [7]. This device uses IR sensors to count bus passengers. RFID smart card is
rechargeable name, cell, and address are included. RFID readers, RFID Tag data, and the
recipient will get a text and destination. It uses a microcontroller, and GSM alerts the adjacent
station checker of any accidents or misuse, and GPS locates. India relies on buses. Digital
India prefers cashless payment. The bus stop devices will automatically add the user source
[8]. Check ticket availability and choose seats. The system will assign available seats if
specified seats are not empty. The user can reserve tickets connected to the bus stop devices
and pay digitally via the site. The conductor will check E-tickets upon boarding after ticket
purchase.

Paulo Miranda e Silva Sousa, José Robertty de Freitas Costa, Emanuel F. Coutinho, and
Carla I. M. Bezerra. 2021. An IoT solution for monitoring and prediction of bus stops
on university transportation using machine learning algorithms. In Proceedings of the
10th Euro-American Conference on Telematics and Information Systems (EATIS '20).
Association for Computing Machinery, New York, NY, USA, Article 10, 1–7.

Due to the growth of urbanization, cities have faced social, economic and environmental
transformations. In addition, many vehicles currently have several sensors and actuators,
capable of performing not only the sensing of the condition of vehicles, but also the
environment around them, and this data can be used for various services. The environment of
a large university may resemble urban environments, considering that these institutions
compare to cities in various aspects, especially in relation to infrastructure problems. The
objective of this work is to develop a solution for the monitoring and prediction of bus stops
in university transportation. Tests were performed with six online and offline machine
learning algorithms in order to analyze which algorithm is most efficient based on the fixed
metrics. The best algorithm presented an absolute prediction error of 20 seconds, which
shows the quality of the generated final model. In the field of transportation and traffic, with
the acceleration of urbanization and the increase of urban population density, resources usage
are becoming increasingly inadequate, and with the fast development of intelligent
transportation and systems, the public transport intelligence dispatching system is playing an
increasing important role [21]. Public transport system is an essential piece of the city
transportation, satisfying basic travel demand of citizens [12]. In recent years, great interest
has been given in public transport systems and a lot of research have been published around
this topic. In the educational context, often students need to wait a much longer time for
arrival of their school bus [10]. There exist some communication technologies which can be
used to ensure the safety of students, but these are incapable of providing efficient services to
their parents. As a result of population growth and urbanization, cities in general have faced
social, economic and environmental changes, such as increased social inequality, limited
access to basic public services, problems of urban mobility and security [15]. In this context,
some concepts have emerged and have been extensively worked in the literature, such as
Smart Cities and IoT (Internet of Things). The concept of Smart Cities emerges as a new
paradigm that seeks to find sustainable solutions to these growing problems. Several
solutions have been proposed and developed for university campuses, considering that these
institutions compare to cities in several aspects, mainly in relation to the management
problems, lack of infrastructure and consequent dissatisfaction of their users [20]. IoT is an
emerging paradigm that has combined several technologies. IoT interconnects various
physical devices present in daily life, and that has the computational power to capture data,
providing services to users. These physical devices are called smart objects. It also covers a
wide variety of different types of application such as education, transportation, agriculture,
health, among others [1][5]. Today, many vehicles have a very large range of sensors and
actuators, capable of performing not only the sensing of the vehicles’ condition, but also the
environment around them [17]. The information collected by these sensors can be used for
various services, which can bring greater comfort and safety to passengers and the drivers of
the vehicle itself. With the rapid technological advancements of sensors, wireless sensors
have become the main technology for IoT. The deployment environments of the IoT devices
could be over a small or large geographical area in locations that are either public or hostile.
Using IoT, systems can collect and analyze important bus route and stop data to propose a
solution that can minimize costs and waiting times, while maximizing safety and efficiency
[7]. The coverage of an entire urban area with a sensor network can be prohibitively costly
[6]. An option to reduce costs and still obtain a significant space coverage is to use mobile
sensing nodes, where each node is responsible for sensing a region. A cheaper way to provide
mobility at sensing nodes is to board them on urban buses [3]. In an even more specific
scenario, where some university campuses have agreements with companies or prefectures to
assist in some type of service, such as student transportation, a solution that optimizes routes
and stops, and manages bus schedules and passengers, or increase or decrease the fleet as
needed, would be of great value to the academic community [8]. In this context, the objective
of this work is to develop a solution for the monitoring and prediction of bus stops in
university transportation. From this solution, information about the transportation of
university students from two universities, Federal University of Ceará (UFC) and Federal
Institute of Education, Science and Technology of Ceará (IFCE), both located in the city of
Quixadá, Ceará, Brazil, will be treated in a application and embedded system. It will also be
possible to present through the developed infrastructure the real time location of the
university buses and to predict the time of the next bus in a certain stop. Machine learning
techniques were used to predict the time of the next bus at a particular stopping point,
obtaining a very small margin of error from the data collected on the routes.
Maslekar, N., Boussedjra, M., Mouzna, J., Labiod, H.: Vanet based adaptive traffic
signal control. In: Vehicular Technology Conference, pp. 1–5 (2011) Application of
Sensor-Cloud Systems: Smart Traffic Control 201.

In urban scenarios traffic signal controls are the main mechanism to control vehicular flow at
the intersections. However, traditional systems fail to adjust the timing pattern in accordance
to the time variability. An alternative to such systems is to develop dynamic systems which
will alter the timing patterns according to the traffic demand. In this paper, an adaptive traffic
signal control system based on car-to-car communication is designed and developed. This
system reduces the waiting time of the vehicles at the intersection along with the reduction in
queue length. It’s also verified that the proposed solution is collision free at the intersections.
The proposed system is compared with a classical pre-timed system. The simulations also
show that the data convergence time and the communication delay between vehicle and
traffic signal do not compromise the efficiency of the system. In recent years, increase of
vehicular traffic in urban scenarios has resulted into an inefficient traffic flow. Road
intersections largely contribute to this inefficiency due to the improper traffic signal control
systems. Most of these existing systems rely on timing plans generated offline using
optimization models which do not respond well to the varying demand. To overcome this
problem, efforts are being made to develop traffic control systems which will respond to the
vehicular demand and optimize the timings accordingly. Such systems, termed as adaptive
traffic control systems, can help to ease congestion and its negative externalities without the
cost and environmental impact of road expansion. Dynamic traffic signals systems have
evolved into a potential technique for improving the traffic conditions in urban areas. There
has been a lot of research carried out on these systems. Some of the main implemented
techniques are mentioned in [8]. But these are usually cost prohibitive to implement because
to facilitate the adaptive procedure they involve the installation of road side infrastructure.
Consequently there is a need for a cost effective and efficient method for traffic signal
control. One approach which has gained a lot of interests among the industry and academic
research communities for traffic signal control is Vehicular Ad hoc Networks (VANETs). In
this paper an adaptive traffic signal control system based on car-to-car communication is
presented. This system reduces the waiting time of the vehicles at the intersection along with
the reduction in queue length. To realize this system, the concept of clustering is used for the
vehicles approaching the intersection. The density of vehicles within the cluster is computed
using a clustering algorithm and sent to the traffic signal controls to set the timing cycle.
Giang, N. K., Leung, V. C. M., & Lea, R. (2016). On Developing Smart Transportation
Applications in Fog Computing Paradigm. Proceedings of the 6th ACM Symposium on
Development and Analysis of Intelligent Vehicular Networks and Applications -
DIVANet ’16. doi:10.1145/2989275.2989286.

Smart Transportation applications by nature are examples of Vehicular Ad-hoc Network


(VANETs) applications where mobile vehicles, roadside units and transportation
infrastructure interplay with one another to provide value added services. While there are
abundant researches that focused on the communication aspect of such Mobile Ad-hoc
Networks, there are few research bodies that target the development of VANET applications.
Among the popular VANET applications, a dominant direction is to leverage Cloud
infrastructure to execute and deliver applications and services. Recent studies showed that
Cloud Computing is not sufficient for many VANET applications due to the mobility of
vehicles and the latency sensitive requirements they impose. To this end, Fog Computing has
been proposed to leverage computation infrastructure that is closer to the network edge to
compliment Cloud Computing in providing latencysensitive applications and services.
However, applications development in Fog environment is much more challenging than in the
Cloud due to the distributed nature of Fog systems. In this paper, we investigate how Smart
Transportation applications are developed following Fog Computing approach, their
challenges and possible mitigation from the state of the arts. Building VANET applications is
not an easy task given the large scale of the system and the dynamic nature of its entities such
as people, cars or street lanes. Unfortunately, research into Vehicular Ad-hoc Network
applications in general is still focused more on communication layer where specific
applications are built leveraging some advanced communication technologies. A particular
application model or programming abstraction for VANET applications is yet to available.
Albeit there are few efforts in applications models and programming abstractions to develop
VANET applications, they generally focus on end user experiences such as safety driving,
driving assistant or in-car comfort. For example, the authors in [16] proposed to use Mobile
Agent model to build a vehicular social network that connects drivers together. Another
research direction leveraging Cloud computing as the execution platform for VANET
applications with the intuition that scalable Cloud technology will suffice the large scale
deployment of many VANETs. However, many VANET applications impose a low latency
requirement that are difficult to met using distant Cloud infrastructure. One example
application is to use the CCTVs network to count the cars on the street and use the number to
control the traffic flow accordingly. In this example, the computation activity that processes
the camera stream to count the cars need to reply in a quick manner so that traffic control can
be carry out efficiently. With the large scale deployment of CCTVs in transportation
infrastructure, relying on a centralized and distant Cloud platform is simply not enough.
Recent advances in communication technologies have facilitated the connectedness in smart
transportation components such as vehicles, roadside units and other transportation
infrastructure. Along with the Internet of Things direction where there are more and more
physical things being connected to the Internet, this connectedness in transportation
infrastructure is going to pave the way for new VANETs applications. Thus, investigation into
application models and programming abstractions for Smart Transportation applications is an
important research direction. While it is generally agreed that VANET applications can be
classified into: comfort applications, road traffic management, traffic coordination and public
safety [24], all these classes center around the communication between vehicles to vehicles
(V2V) and vehicles to infrastructure (V2I) with end users being the focus in the application
logic. We consider in our work a new class of VANET applications called Smart
Transportation applications that leverages both vehicles data and data and computing
resources from the transportation infrastructure to help in the decision making process. For
example, transportation infrastructure such as camera network and roadside units can help
autonomous vehicles to navigate their way around. This application does not necessarily
involve end users as an integral part of the logic however it does take into account the
participation of the vehicles in an autonomous manner. There might be overlapping
characteristics when comparing with other classes of VANET applications however, the
presence of Fog Computing model with distributed and heterogeneous computing
infrastructure and autonomous vehicles raises new challenges that ordinary VANET
applications have not met. In this work, we look at the process of developing Smart
Transportation applications from the developers point of view, which is a top down approach
in compare to a bottom up approach where advance technologies in communication are
exploited in realizing particular applications. In this manner, application models - which
represent how Smart Transportation applications are composed and programming
abstractions - which support developers in the development process are important and of
interested. In general, Smart Transportation applications can be seen as Distributed System
applications as the VANET infrastructure consists of distributed devices that are capable of
carrying computing resources, e.g road-side units, lamp posts, base station, etc. Existing
models and techniques in building Distributed System applications such as message-passing
and data-sharing models can be applied, however the challenges in Smart Transportation
applications lie in the dynamic nature of vehicles and the heterogeneity of the infrastructure.
Therefore, we argue that developing Smart Transportation applications following a Fog
Computing model is not straightforward and is a problem worth exploring. This paper aims at
providing an overview of requirements of an application model for Smart Transportation
applications. We introduce some existing programming models for this class of applications
and open some research directions that are important to achieve the Fog-based Smart
Transportation vision.
Block diagram

GPS
IR SENSOR

DHT 11 EXTINGUISHER

UNO

ULTRASONIC WIFI

FLAME SENSOR BUZZER


CHAPTER 2
INTRODUCTION TO EMBEDDED SYSTEMS

Many embedded systems have substantially different design constraints than desktop
computing applications. No single characterization applies to the diverse spectrum of
embedded systems. However, some combination of cost pressure, long life-cycle, real-time
requirements, reliability requirements, and design culture dysfunction can make it difficult to
be successful applying traditional computer design methodologies and tools to embedded
applications. Embedded systems in many cases must be optimized for life-cycle and
business-driven factors rather than for maximum computing throughput. There is currently
little tool support for expanding embedded computer design to the scope of holistic
embedded system design. However, knowing the strengths and weaknesses of current
approaches can set expectations appropriately, identify risk areas to tool adopters, and suggest
ways in which tool builders can meet industrial needs. If we look around us, today we see
numerous appliances which we use daily, be it our refrigerator, the microwave oven, cars,
PDAs etc. Most appliances today are powered by something beneath the sheath that makes
them do what they do. These are tiny microprocessors, which respond to various keystrokes
or inputs. These tiny microprocessors, working on basic assembly languages, are the heart of
the appliances. We call them embedded systems. Of all the semiconductor industries, the
embedded systems market place is the most conservative, and engineering decisions here
usually lean towards established, low risk solutions. Welcome to the world of embedded
systems, of computers that will not look like computers and won’t function like anything we
are familiar with.

2.1 CLASSIFICATION

Embedded systems are divided into autonomous, realtime, networked & mobile
categories.

Autonomous systems
They function in standalone mode. Many embedded systems used for process control

in manufacturing units& automobiles fall under this category.

Real-time embedded systems

These are required to carry out specific tasks in a specified amount of time. These

systems are extensively used to carry out time critical tasks in process control.

Networked embedded systems

They monitor plant parameters such as temperature, pressure and humidity and send

the data over the network to a centralized system for on line monitoring.

Mobile gadgets

Mobile gadgets need to store databases locally in their memory. These gadgets imbibe

powerful computing & communication capabilities to perform realtime as well as

nonrealtime tasks and handle multimedia applications. The embedded system is a

combination of computer hardware, software, firmware and perhaps additional mechanical


parts, designed to perform a specific function. A good example is an automatic washing

machine or a microwave oven. Such a system is in direct contrast to a personal computer,

which is not designed to do only a specific task. But an embedded system is designed to do a

specific task with in a given timeframe, repeatedly, endlessly, with or without human

interaction.

Hardware

Good software design in embedded systems stems from a good understanding of the

hardware behind it. All embedded systems need a microprocessor, and the kinds of

microprocessors used in them are quite varied. A list of some of the common

microprocessors families are: ARM family, The Zilog Z8 family, Intel 8051/X86 family,

Motorola 68K family and the power PC family. For processing of information and execution

of programs, embedded system incorporates microprocessor or micro- controller. In an

embedded system the microprocessor is a part of final product and is not available for

reprogramming to the end user. An embedded system also needs memory for two purposes,
to store its program and to store its data. Unlike normal desktops in which data and programs

are stored at the same place, embedded systems store data and programs in different

memories. This is simply because the embedded system does not have a hard drive and the

program must be stored in memory even when the power is turned off. This type of memory

is called ROM. Embedded applications commonly employ a special type of ROM that can be

programmed or reprogrammed with the help of special devices.

2.2 OTHER COMMON PARTS FOUND ON MANY EMBEDDED


SYSTEMS
 UART& RS232
 PLD
 ASIC’s& FPGA’s
 Watch dog timer etc.

2.3 DESIGN PROCESS


Embedded system design is a quantitative job. The pillars of the system design
methodology are the separation between function and architecture, is an essential step from
conception to implementation. In recent past, the search and industrial community has paid
significant attention to the topic of hardware-software (HW/SW) codesign and has tackled the
problem of coordinating the design of the parts to be implemented as software and the parts
to be implemented as hardware avoiding the HW/SW integration problem marred the
electronics system industry so long. In any large scale embedded systems design
methodology, concurrency must be considered as a first class citizen at all levels of
abstraction and in both hardware and software. Formal models & transformations in system
design are used so that verification and synthesis can be applied to advantage in the design
methodology. Simulation tools are used for exploring the design space for validating the
functional and timing behaviors of embedded systems. Hardware can be simulated at
different levels such as electrical circuits, logic gates, RTL e.t.c. using VHDL description. In
some environments software development tools can be coupled with hardware simulators,
while in others the software is executed on the simulated hardware. The later approach is
feasible only for small parts of embedded systems. Design of an embedded system using
Intel’s 80C188EB chip is shown in the figure. Inorder to reduce complexity, the design
process is divided in four major steps: specification, system synthesis, implementation
synthesis and performance evaluation of the prototype.

2.3.1 SPECIFICATION
During this part of the design process, the informal requirements of the analysis are
transformed to formal specification using SDL.

2.3.2 SYSTEM-SYNTHESIS
For performing an automatic HW/SW partitioning, the system synthesis step
translates the SDL specification to an internal system model switch contains problem graph&
architecture graph. After system synthesis, the resulting system model is translated back to
SDL.

2.3.3 IMPLEMENTATION-SYNTHESIS
SDL specification is then translated into conventional implementation languages such
as VHDL for hardware modules and C for software parts of the system.

2.3.4 PROTOTYPING
On a prototyping platform, the implementation of the system under development is
executed with the software parts running on multiprocessor unit and the hardware part
running on a FPGA board known as phoenix, prototype hardware for Embedded Network
Interconnect Accelerators.

2.3.5 APPLICATIONS
Embedded systems are finding their way into robotic toys and electronic pets,
intelligent cars and remote controllable home appliances. All the major toy makers across the
world have been coming out with advanced interactive toys that can become our friends for
life. ‘Furby’ and ‘AIBO’ are good examples at this kind. Furbies have a distinct life cycle just
like human beings, starting from being a baby and growing to an adult one. In AIBO first two
letters stands for Artificial Intelligence. Next two letters represents robot. The AIBO is
robotic dog. Embedded systems in cars also known as Telematic Systems are used to provide
navigational security communication & entertinment services using GPS, satellite. Home
appliances are going the embedded way. LG electronics digital DIOS refrigerator can be
used for surfing the net, checking e-mail, making video phone calls and watching TV.IBM is
developing an air conditioner that we can control over the net. Embedded systems cover such
a broad range of products that generalization is difficult. Here are some broad categories.

Requirement
analysis

Specification

System
architecture

H/w design S/w design

H/w S/w
implementation implementation

H/w testing S/w testing

System integration

System validation

Operation
Maintenance
Evolution

Fig 2.1: Embedded Development Life Cycle


 Aerospace and defence electronics: Fire control, radar, robotics/sensors, sonar.
 Automotive: Autobody electronics, auto power train, auto safety, car information
systems.
 Broadcast & entertainment: Analog and digital sound products, camaras, DVDs,
Set top boxes, virtual reality systems, graphic products.
 Consumer/internet appliances: Business handheld computers, business network
computers/terminals, electronic books, internet smart handheld devices, PDAs.
 Data communications: Analog modems, ATM switches, cable modems, XDSL
modems, Ethernet switches, concentrators.
 Digital imaging: Copiers, digital still cameras, Fax machines, printers, scanners.
 Industrial measurement and control: Hydro electric utility research & management
traffic management systems, train marine vessel management systems.
 Medical electronics: Diagnostic devices, real time medical imaging systems, surgical
devices, critical care systems.
 Server I/O: Embedded servers, enterprise PC servers, PCI LAN/NIC controllers,
RAID devices, SCSI devices.
 Telecommunications: ATM communication products, base stations, networking
switches, SONET/SDH cross connect, multiplexer.
 Mobile data infrastructures: Mobile data terminals, pagers, VSATs, Wireless
LANs, Wireless phones.
CHAPTER 3

ARUDINO:
The Arduino is a family of microcontroller boards to simplify electronic design,
prototyping and experimenting for artists, hackers, hobbyists, but also many professionals.
People use it as brains for their robots, to build new digital music instruments, or to build a
system that lets your house plants tweet you when they’re dry. Arduinos (we use the standard
Arduino Uno) are built around an ATmega microcontroller — essentially a complete
computer with CPU, RAM, Flash memory, and input/output pins, all on a single chip. Unlike,
say, a Raspberry Pi, it’s designed to attach all kinds of sensors, LEDs, small motors and
speakers, servos, etc. directly to these pins, which can read in or output digital or analog
voltages between 0 and 5 volts. The Arduino connects to your computer via USB, where you
program it in a simple language (C/C++, similar to Java) from inside the free Arduino IDE by
uploading your compiled code to the board. Once programmed, the Arduino can run with the
USB link back to your computer, or stand-alone without it — no keyboard or screen needed,
just power.

Figure 2.2 Structure of Arduino Board

Looking at the board from the top down, this is an outline of what you will see (parts
of the board you might interact with in the course of normal use are highlighted)
Figure 2.3 Arduino Board
Starting clockwise from the top center:
 Analog Reference pin (orange)
 Digital Ground (light green)
 Digital Pins 2-13 (green)
 Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - These pins cannot be used for
digital i/o (Digital Read and Digital Write) if you are also using serial communication
(e.g. Serial.begin).
 Reset Button - S1 (dark blue)
 In-circuit Serial Programmer (blue-green)
 Analog In Pins 0-5 (light blue)
 Power and Ground Pins (power: orange, grounds: light orange)
 External Power Supply In (9-12VDC) - X1 (pink)
 Toggles External Power and USB Power (place jumper on two pins closest to desired
supply) - SV1 (purple)
 USB (used for uploading sketches to the board and for serial communication between
the board and the computer; can be used to power the board) (yellow)
DIGITAL PINS
In addition to the specific functions listed below, the digital pins on an Arduino board
can be used for general purpose input and output via the pin Mode(), Digital Read(), and
Digital Write() commands. Each pin has an internal pull-up resistor which can be turned on
and off using digital Write() (w/ a value of HIGH or LOW, respectively) when the pin is
configured as an input. The maximum current per pin is 40mA.
 Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
On the Arduino Diecimila, these pins are connected to the corresponding pins of the
FTDI USB-to-TTL Serial chip. On the Arduino BT, they are connected to the
corresponding pins of the WT11 Bluetooth module. On the Arduino Mini and LilyPad
Arduino, they are intended for use with an external TTL serial module (e.g. the Mini-
USB Adapter).
 External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on
a low value, a rising or falling edge, or a change in value. See the attach Interrupt()
function for details.
 PWM: 3, 5, 6, 9, 10, and 11 Provide 8-bit PWM output with the analog Write()
function. On boards with an ATmega8, PWM output is available only on pins 9, 10,
and 11.
 BT Reset: 7. (Arduino BT-only) Connected to the reset line of the bluetooth module.
 SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication, which, although provided by the underlying hardware, is not
currently included in the Arduino language.
 LED: 13. On the Diecimila and LilyPad, there is a built-in LED connected to digital
pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
ANALOG PINS

In addition to the specific functions listed below, the analog input pins support 10-bit
analog-to-digital conversion (ADC) using the analog Read() function. Most of the analog
inputs can also be used as digital pins: analog input 0 as digital pin 14 through analog input 5
as digital pin 19. Analog inputs 6 and 7 (present on the Mini and BT) cannot be used as
digital pins.
 I2C: 4 (SDA) and 5 (SCL). Support I2C (TWI) communication using the Wire library
(documentation on the Wiring website).
POWER PINS
 VIN (sometimes labeled "9V"): The input voltage to the Arduino board when it's
using an external power source (as opposed to 5 volts from the USB connection or
other regulated power source). You can supply voltage through this pin, or, if
supplying voltage via the power jack, access it through this pin. Also note that the
Lily Pad has no VIN pin and accepts only a regulated input.
 5V: The regulated power supply used to power the microcontroller and other
components on the board. This can come either from VIN via an on-board regulator,
or be supplied by USB or another regulated 5V supply.
 3V3 (Diecimila-only) : A 3.3 volt supply generated by the on-board FTDI chip.
 GND: Ground pins.
OTHER PINS

 AREF: Reference voltage for the analog inputs. Used with analog Reference().
 Reset: (Diecimila-only) Bring this line LOW to reset the microcontroller. Typically
used to add a reset button to shields which block the one on the board.
ATMEGA328
Pin diagram

Figure 2.4 Pin Configuration of Atmega328

Pin Description

VCC:
Digital supply voltage.

GND:

Ground.

Port A (PA7-PA0):

Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit
bi-directional I/O port, if the A/D Converter is not used. Port pins can provide internal pull-up
resistors (selected for each bit). The Port A output buffers have symmetrical drive
characteristics with both high sink and source capability. When pins PA0 to PA7 are used as
inputs and are externally pulled low, they will source current if the internal pull-up resistors
are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the
clock is not running.

Port B (PB7-PB0):

Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port B output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port B pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset
condition becomes active, even if the clock is not running. Port B also serves the functions of
various special features of the ATmega32.

Port C (PC7-PC0):

Port C is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port C output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port C pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset
condition becomes active, even if the clock is not running. If the JTAG interface is enabled,
the pull-up resistors on pins PC5(TDI), PC3(TMS) and PC2(TCK) will be activated even if a
reset occurs. The TD0 pin is tri-stated unless TAP states that shift out data are entered. Port C
also serves the functions of the JTAG interface.
Port D (PD7-PD0):

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for
each bit). The Port D output buffers have symmetrical drive characteristics with both high
sink and source capability. As inputs, Port D pins that are externally pulled low will source
current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset
condition becomes active, even if the clock is not running. Port D also serves the functions of
various special features of the ATmega32.

Reset (Reset Input):

A low level on this pin for longer than the minimum pulse length will generate a reset,
even if the clock is not running. Shorter pulses are not guaranteed to generate a reset.

XTAL1:

Input to the inverting Oscillator amplifier and input to the internal clock operating
circuit.

XTAL2:

Output from the inverting Oscillator amplifier.

AVCC:

AVCC is the supply voltage pin for Port A and the A/D Converter. It should be
externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be
connected to VCC through a low-pass filter.

AREF:

AREF is the analog reference pin for the A/D Converter.

FEATURES
 1.8-5.5V operating range
 Up to 20MHz
 Part: ATMEGA328P-AU
 32kB Flash program memory
 1kB EEPROM
 2kB Internal SRAM
 2 8-bit Timer/Counters
 16-bit Timer/Counter
 RTC with separate oscillator
 6 PWM Channels
 8 Channel 10-bit ADC
 Serial USART
 Master/Slave SPI interface
 2-wire (I2C) interface
 Watchdog timer
 Analog comparator
 23 IO lines
 Data retention: 20 years at 85C/ 100 years at 25C
 Digital I/O Pins are 14 (out of which 6 provide PWM output)
 Analog Input Pins are 6.
 DC Current per I/O is 40 mA
 DC Current for 3.3V Pin is 50mA
AVR CPU CORE
The AVR core combines a rich instruction set with 32 general purpose working
registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
allowing two independent registers to be accessed in one single instruction executed in one
clock cycle. The resulting architecture is more code efficient while achieving throughputs up
to ten times faster than conventional CISC microcontrollers.
Figure 2.5 Block Diagram
OVERVIEW
This section discusses the AVR core architecture in general. The main function of the
CPU core is to ensure correct program execution. The CPU must therefore be able to access
memories, perform calculations, control peripherals, and handle interrupts.

Figure AVR core architecture


In order to maximize performance and parallelism, the AVR uses a Harvard
architecture – with separate memories and buses for program and data. Instructions in the
program memory are executed with a single level pipelining. While one instruction is being
executed, the next instruction is pre-fetched from the program memory. This concept enables
instructions to be executed in every clock cycle. The program memory is In-System
Reprogrammable Flash memory. The fast-access Register File contains 32 x 8-bit general
purpose working registers with a single clock cycle access time. This allows single-cycle
Arithmetic Logic Unit (ALU) operation. In a typical ALU operation, two operands are output
from the Register File, the operation is executed, and the result is stored back in the Register
File– in one clock cycle.
Six of the 32 registers can be used as three 16-bit indirect address register pointers for
Data Space addressing – enabling efficient address calculations. One of these address pointers
can also be used as an address pointer for look up tables in Flash program memory. These
added function registers are the 16-bit X-, Y-, and Z-register, described later in this section.
The ALU supports arithmetic and logic operations between registers or between a constant
and a register. Single register operations can also be executed in the ALU. After an arithmetic
operation, the Status Register is updated to reflect information about the result of the
operation. Program flow is provided by conditional and unconditional jump and call
instructions, able to directly address the whole address space. Most AVR instructions have a
single 16-bit word format. Every program memory address contains a 16- or 32-bit
instruction. Program Flash memory space is divided in two sections, the Boot Program
section and the Application Program section. Both sections have dedicated Lock bits for write
and read/write protection. The SPM instruction that writes into the Application Flash memory
section must reside in the Boot Program section. During interrupts and subroutine calls, the
return address Program Counter (PC) is stored on the Stack. The Stack is effectively allocated
in the general data SRAM, and consequently the Stack size is only limited by the total SRAM
size and the usage of the SRAM. All user programs must initialize the SP in the Reset routine
(before subroutines or interrupts are executed). The Stack Pointer (SP) is read/write
accessible in the I/O space. The data SRAM can easily be accessed through the five different
addressing modes supported in the AVR architecture.
The memory spaces in the AVR architecture are all linear and regular memory maps.
A flexible interrupt module has its control registers in the I/O space with an additional Global
Interrupt Enable bit in the Status Register. All interrupts have a separate Interrupt Vector in
the Interrupt Vector table. The interrupts have priority in accordance with their Interrupt
Vector position. The lower the Interrupt Vector address, the higher the priority.
ALU – ARITHMETIC LOGIC UNIT
The high-performance AVR ALU operates in direct connection with all the 32 general
purpose working registers. Within a single clock cycle, arithmetic operations between general
purpose registers or between a register and an immediate are executed. The ALU operations
are divided into three main categories – arithmetic, logical, and bit functions. Some
implementations of the architecture also provide a powerful multiplier supporting both
signed/unsigned multiplication and fractional format. See the “Instruction Set” section for a
detailed description.
STATUS REGISTER
The Status Register contains information about the result of the most recently
executed arithmetic instruction. This information can be used for altering program flow in
order to perform conditional operations. Note that the Status Register is updated after all
ALU operations, as specified in the Instruction Set Reference. This will in many cases
remove the need for using the dedicated compare instructions, resulting in faster and more
compact code. The Status Register is not automatically stored when entering an interrupt
routine and restored when returning from an interrupt. This must be handled by software.
The AVR Status Register – SREG is defined as:

Figure 2.7 AVR status register

Bit 7 – I: Global Interrupt Enable


The Global Interrupt Enable bit must be set for the interrupts to be enabled. The
individual interrupt enable control The Global Interrupt Enable bit must be set for the
interrupts to be enabled. The individual interrupt enable control is then performed in separate
control registers. If the Global Interrupt Enable Register is cleared, none of the interrupts are
enabled independent of the individual interrupt enable settings. The I-bit is cleared by
hardware after an interrupt has occurred, and is set by the RETI instruction to enable
subsequent interrupts. The I-bit can also be set and cleared by the application with the SEI
and CLI instructions, as described in the instruction set reference.
Bit 6 – T: Bit Copy Storage
The Bit Copy instructions BLD (Bit Load) and BST (Bit Store) use the T-bit as source
or destination for the operated bit. A bit from a register in the Register File can be copied into
T by the BST instruction, and a bit in T can be copied into a bit in a register in the Register
File by the BLD instruction.
Bit 5 – H: Half Carry Flag
The Half Carry Flag H indicates a Half Carry in some arithmetic operations The Half
Carry Flag H indicates a Half Carry in some arithmetic operations. Half Carry Is useful in
BCD arithmetic. See the “Instruction Set Description” for detailed information.
Bit 4 – S: Sign Bit, S = N V
The S-bit is always an exclusive or between the Negative Flag N and the Two’s
Complement Overflow Flag V. See the “Instruction Set Description” for detailed information.
Bit 3 – V: Two’s Complement Overflow Flag
The Two’s Complement Overflow Flag V supports two’s complement arithmetic.
Bit 2 – N: Negative Flag
The Negative Flag N indicates a negative result in an arithmetic or logic operation.
Bit 1 – Z: Zero Flag
The Zero Flag Z indicates a zero result in an arithmetic or logic operation.
Bit 0 – C: Carry Flag
The Carry Flag C indicates a carry in an arithmetic or logic operation.
STACK POINTER
The Stack is mainly used for storing temporary data, for storing local variables and
for storing return addresses after interrupts and subroutine calls. Note that the Stack is
implemented as growing from higher to lower memorylocations. The Stack Pointer Register
always points to the top of the Stack. The Stack Pointer points to the data SRAM Stack area
where the Subroutine and Interrupt Stacks are located. A Stack PUSH command will decrease
the Stack Pointer.
The Stack in the data SRAM must be defined by the program before any subroutine
calls are executed or interrupts are enabled. Initial Stack Pointer value equals the last address
of the internal SRAM and the Stack Pointer must be set to point above start of the SRAM
Table 2.1 Stack Pointer instructions
The AVR ATmega128A Stack Pointer is implemented as two 8-bit registers in the I/O
space. The number of bits actually used is implementation dependent. Note that the data
space in some implementations of the AVR architecture is so small that only SPL is needed.
In this case, the SPH Register will not be present.SPH and SPL - Stack Pointer High and Low
Register.

Figure 2.10 SPH and SPL - Stack Pointer High and Low Register
INTERRUPT RESPONSE TIME
The interrupt execution response for all the enabled AVR interrupts is four clock
cycles minimum. After four clock cycles the program vector address for the actual interrupt
handling routine is executed. During this four clock cycle period, the Program Counter is
pushed onto the Stack. The vector is normally a jump to the interrupt routine, and this jump
takes three clock cycles. If an interrupt occurs during execution of a multi-cycle instruction,
this instruction is completed before the interrupt is served. If an interrupt occurs when the
MCU is in sleep mode, the interrupt execution response time is increased by four clock
cycles. This increase comes in addition to the start-up time from the selected sleep mode .
AVR Memories
This section describes the different memories in the ATmega328. The AVR
architecture has two main memory spaces, the Data Memory and the Program Memory space.
In addition, theATmega328 features an EEPROM Memory for data storage. All three memory
spaces are linear and regular.
In-System Reprogrammable Flash Program Memory:
The ATmega328 contains 4/8/16/32Kbytes On-chip In-System Reprogrammable
Flash memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the
Flash is organized as 2/4/8/16K x 16. For software security, the Flash Program memory space
is divided into two sections, Boot Loader Section and Application Program Section. The
Flash memory has an endurance of at least 10,000 write/erase cycles. The ATmega328
Program Counter (PC) is 11/12/13/14 bits wide, thus addressing the 2/4/8/16K program
memory locations.
SRAM Data Memory:
ATmega328 is a complex microcontroller with more peripheral units than can be
supported within the 64 locations reserved in the Opcode for the IN and OUT instructions.
For the Extended I/O space from 0x60 - 0xFF in SRAM, only the ST/STS/STD and
LD/LDS/LDD instructions can be used.
The lower 768/1280/1280/2303 data memory locations address both the Register File,
the I/O memory, Extended I/O memory, and the internal data SRAM. The first 32 locations
address the Register File, the next 64 location the standard I/O memory, then 160 locations of
Extended I/O memory, and the next 512/1024/1024/2048 locations address the internal data
SRAM. The five different addressing modes for the data memory cover: Direct, Indirect with
Displacement, Indirect, Indirect with Pre-decrement, and Indirect with Post-increment. In The
Register File, Registers R26 to R31 Feature the indirect addressing pointer registers. The
direct addressing reaches the entire data space. The Indirect with Displacement mode reaches
63 address locations from the base address given by the Y- or Z register.
When using register indirect addressing modes with automatic pre-decrement and
post-increment, the address registers X, Y, and Z are decremented or incremented. The 32
general purpose working registers, 64 I/O Registers, 160 Extended I/O Registers, and the
512/1024/1024/2048 bytes of internal data SRAM in the ATmega328 are all accessible
through all these addressing modes.
Figure 2.11 Data Memory Map

Interrupts
This section describes the specifics of the interrupt handling as performed in the
Atmega328. In Atmega328Each Interrupt Vector occupies two instruction words and the
Reset Vector is affected by the BOOTRST fuse, and the Interrupt Vector start address is
affected by the IVSEL bit in MCUCR.

Table 2.2 Reset and Interrupt Vectors in ATMEGA 328 and ATMEGA 328P
Vector Program Source Interrupt Definition
No. Address
1 0x0000 RESET External Pin, Power-on Reset,
Brown-out Reset and Watchdog
System Reset
2 0x0002 INT0 External Interrupt Request 0
3 0x0004 INT1 External Interrupt Request 0
4 0x0006 PCINTO Pin Change Interrupt Request 0
5 0x0008 PCINT1 Pin Change Interrupt Request 1
6 0x000A PCINT2 Pin Change Interrupt Request 2
7 0x000C WDT Watchdog Time-out Interrupt
8 0x000E TIMER2 COMPA Timer/Counter2 Compare Match A
9 0x0010 TIMER2 COMPB Timer/Counter2 Compare Match B
10 0x0012 TIMER2 OVF Timer/Counter 2 Overflow
11 0x0014 TIMER1 CAPT Timer/Counter 2 Capture Event
12 0x0016 TIMER1 COMPA Timer/Counter1 Compare Match A
13 0x0018 TIMER1 COMPB Timer/Counter1 Compare Match B
14 0x001A TIMER 1 OVF Timer/Counter1 Overflow
15 0x001C TIMER0 COMPA Timer/Counter0 Compare Match A
16 0x001E TIMER0 COMPB Timer/Counter0 Compare Match B
17 0x0020 TIME0 OVF Timer/Counter0 Overflow
18 0x0022 SPI, STC SPI Serial Transfer Complete
19 0x0024 USART, RX USART RX Complete
20 0x0026 USART, UDRE USART, Data Register Empty
21 0x0028 USART, TX USART, TX Complete
22 0x002A ADC ADC Conversion Complete
23 0x002C EE READY EEPROM Ready
24 0x002E ANALOG COMP Analog Comparator
25 0x0030 TWI 2-wire Serial Interface
26 0x0032 SPM READY Store Program Memory Ready

When the IVSEL bit in MCUCR is set, Interrupt Vectors will be moved to the start of
the Boot Flash Section. The address of each Interrupt Vector will then be the address in this
table added to the start address of the Boot Flash Section.Table below shows reset and
Interrupt Vectors placement for the various combinations of BOOTRST and IVSEL settings.
If the program never enables an interrupt source, the Interrupt Vectors are not used, and
regular program code can be placed at these locations. This is also the case if the Reset Vector
is in the Application section while the Interrupt Vectors are in the Boot section or vice versa.

Table 2.3 Reset and Interrupt Vectors Placement in ATmega328 and ATmega328P

Arduino with ATmega328


The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It
has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a
16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything needed to support the microcontroller; simply connect it to a
computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-
serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to versionR2)
programmed as a USB-to-serial converter.
 Pin out: Added SDA and SCL pins that are near to the AREF pin and two other new
pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the
voltage provided from the board. In future, shields will be compatible with both the
board that uses the AVR, which operates with 5V and with the Arduino. Due that
operates with 3.3V. The second one is a not connected pin that is reserved for future
purposes.
 Stronger RESET circuit.
 Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino
1.0. The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The
Uno is the latest in a series of USB Arduino boards, and the reference model for the Arduino
platform; for a comparison with previous versions, see the index of Arduino boards.

Arduino Characteristics

Power

The Arduino Uno can be powered via the USB connection or with an external power
supply. The power source is selected automatically. External (non-USB) power can come
either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by
plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can
be inserted in the Gnd and Vin pin headers of the POWER connector. The board can operate
on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may
supply less than five volts and the board may be unstable. If using more than 12V, the voltage
regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

The power pins are as follows:


 VIN: The input voltage to the Arduino board when it's using an external power source
(as opposed to 5 volts from the USB connection or other regulated power source).
You can supply voltage through this pin, or, if supplying voltage via the power jack,
access it through this pin.
 5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 12V), the USB connector
(5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins
bypasses the regulator, and can damage your board. We don't advise it.
 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is
50 mA.
 GND. Ground pins.
 IOREF. This pin on the Arduino board provides the voltage reference with which the
microcontroller operates. A properly configured shield can read the IOREF pin
voltage and select the appropriate power source or enable voltage translators on the
outputs for working with the 5V or 3.3V.
Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the boot loader). It also has 2 KB
of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Serial Communication:

The Arduino Uno has a number of facilities for communicating with a computer,
another Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V)
serial communication, which is available on digital pins 0 (RX) and 1 (TX). An
ATmega16U2 on the board channels this serial communication over USB and appears as a
virtual com port to software on the computer. The '16U2 firmware uses the standard USB
COM drivers, and no external driver is needed. However, on Windows, a .inf file is
required. The Arduino software includes a serial monitor which allows simple textual data
to be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when
data is being transmitted via the USB-to-serial chip and USB connection to the computer (but
not for serial communication on pins 0 and 1).

A Software Serial library allows for serial communication on any of the Uno's digital
pins. The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino
software includes a Wire library to simplify use of the I2C bus. For SPI communication, use
the SPI library.

CHAPTER 4
HARDWARE COMPONENTS

LCD (Liquid Cristal Display)

Introduction:

A liquid crystal display (LCD) is a thin, flat display device made up of any number of
color or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists
of a column of liquid crystal molecules suspended between two transparent electrodes, and
two polarizing filters, the axes of polarity of which are perpendicular to each other. Without
the liquid crystals between them, light passing through one would be blocked by the other.
The liquid crystal twists the polarization of light entering one filter to allow it to pass through
the other.

A program must interact with the outside world using input and output devices
that communicate directly with a human being. One of the most common devices attached to
an controller is an LCD display. Some of the most common LCDs connected to the contollers
are 16X1, 16x2 and 20x2 displays. This means 16 characters per line by 1 line 16 characters
per line by 2 lines and 20 characters per line by 2 lines, respectively.

Many microcontroller devices use 'smart LCD' displays to output visual information.
LCD displays designed around LCD NT-C1611 module, are inexpensive, easy to use, and it
is even possible to produce a readout using the 5X7 dots plus cursor of the display. They
have a standard ASCII set of characters and mathematical symbols. For an 8-bit data bus, the
display requires a +5V supply plus 10 I/O lines (RS RW D7 D6 D5 D4 D3 D2 D1 D0). For
a 4-bit data bus it only requires the supply lines plus 6 extra lines(RS RW D7 D6 D5 D4).
available.
When the LCD display is not enabled, data lines are tri-state and they do not interfere withLine lengths of
the operation of the microcontroller. 8, 16,
20, 24,
Features:
32 and
(1) Interface with either 4-bit or 8-bit microprocessor. 40

(2) Display data RAM charact


ers are
(3) 80x8 bits (80 characters).
all
standar
d, in
one,
two
(4) Character generator ROM

(5). 160 different 5 7 dot-matrix character patterns.

(6). Character generator RAM

(7) 8 different user programmed 5 7 dot-matrix patterns.

(8).Display data RAM and character generator RAM may be

Accessed by the microprocessor.

(9) Numerous instructions

(10) .Clear Display, Cursor Home, Display ON/OFF, Cursor ON/OFF,

Blink Character, Cursor Shift, Display Shift.

(11). Built-in reset circuit is triggered at power ON.

(12). Built-in oscillator.

Data can be placed at any location on the LCD. For 16×1 LCD, the address locations
are:

Fig : Address locations for a 1x16 line LCD

Shapes and sizes:


Even limited to character based modules,there is still a wide variety of shapes and sizes
available. Line lenghs of 8,16,20,24,32 and 40 charecters are all standard, in one, two and
four line versions.

Several different LC technologies exists. “supertwist” types, for example, offer Improved
contrast and viewing angle over the older “twisted nematic” types. Some modules are
available with back lighting, so so that they can be viewed in dimly-lit conditions. The back
lighting may be either “electro-luminescent”, requiring a high voltage inverter circuit, or
simple LED illumination.

Electrical blockdiagram:
Power supply for lcd driving:

PIN DESCRIPTION:

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections).
Fig: pin diagram of 1x16 lines lcd

CONTROL LINES:

EN:

Line is called "Enable." This control line is used to tell the LCD that you are sending
it data. To send data to the LCD, your program should make sure this line is low (0) and then
set the other two control lines and/or put data on the data bus. When the other lines are
completely ready, bring EN high (1) and wait for the minimum amount of time required by
the LCD datasheet (this varies from LCD to LCD), and end by bringing it low (0) again.

RS:
Line is the "Register Select" line. When RS is low (0), the data is to be treated as a
command or special instruction (such as clear screen, position cursor, etc.). When RS is high
(1), the data being sent is text data which sould be displayed on the screen. For example, to
display the letter "T" on the screen you would set RS high.

RW:

Line is the "Read/Write" control line. When RW is low (0), the information on the
data bus is being written to the LCD. When RW is high (1), the program is effectively
querying (or reading) the LCD. Only one instruction ("Get LCD status") is a read command.
All others are write commands, so RW will almost always be low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0, DB1,
DB2, DB3, DB4, DB5, DB6, and DB7.

Logic status on control lines:

• E - 0 Access to LCD disabled

- 1 Access to LCD enabled

• R/W - 0 Writing data to LCD

- 1 Reading data from LCD

• RS - 0 Instructions

- 1 Character

Writing data to the LCD:

1) Set R/W bit to low

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high


5) Set E line to low

Read data from data lines (if it is reading)on LCD:

1) Set R/W bit to high

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

Entering Text:

First, a little tip: it is manually a lot easier to enter characters and commands in
hexadecimal rather than binary (although, of course, you will need to translate commands
from binary couple of sub-miniature hexadecimal rotary switches is a simple matter, although
a little bit into hex so that you know which bits you are setting). Replacing the d.i.l. switch
pack with a of re-wiring is necessary.

The switches must be the type where On = 0, so that when they are turned to the zero
position, all four outputs are shorted to the common pin, and in position “F”, all four outputs
are open circuit.

All the available characters that are built into the module are shown in Table 3.
Studying the table, you will see that codes associated with the characters are quoted in binary
and hexadecimal, most significant bits (“left-hand” four bits) across the top, and least
significant bits (“right-hand” four bits) down the left.

Most of the characters conform to the ASCII standard, although the Japanese and
Greek characters (and a few other things) are obvious exceptions. Since these intelligent
modules were designed in the “Land of the Rising Sun,” it seems only fair that their Katakana
phonetic symbols should also be incorporated. The more extensive Kanji character set, which
the Japanese share with the Chinese, consisting of several thousand different characters, is not
included!
Using the switches, of whatever type, and referring to Table 3, enter a few characters
onto the display, both letters and numbers. The RS switch (S10) must be “up” (logic 1) when
sending the characters, and switch E (S9) must be pressed for each of them. Thus the
operational order is: set RS high, enter character, trigger E, leave RS high, enter another
character, trigger E, and so on.

The first 16 codes in Table 3, 00000000 to 00001111, ($00 to $0F) refer to the
CGRAM. This is the Character Generator RAM (random access memory), which can be used
to hold user-defined graphics characters. This is where these modules really start to show their
potential, offering such capabilities as bar graphs, flashing symbols, even animated characters.
Before the user-defined characters are set up, these codes will just bring up strange looking
symbols.

Codes 00010000 to 00011111 ($10 to $1F) are not used and just display blank
characters. ASCII codes “proper” start at 00100000 ($20) and end with 01111111 ($7F). Codes
10000000 to 10011111 ($80 to $9F) are not used, and 10100000 to 11011111 ($A0 to $DF) are
the Japanese characters.
Initialization by Instructions:
If the power conditions for the normal operation of the internal reset
circuit are not satisfied, then executing a series of instructions must initialize
LCD unit. The procedure for this initialization process is as above show.
REGULATED POWER SUPPLY:

Introduction:

Power supply is a supply of electrical power. A device or system that


supplies electrical or other types of energy to an output load or group of loads is called a power
supply unit or PSU. The term is most commonly applied to electrical energy supplies, less
often to mechanical ones, and rarely to others.

A power supply may include a power distribution system as well as primary or


secondary sources of energy such as

 Conversion of one form of electrical power to another desired form and voltage, typically
involving converting AC line voltage to a well-regulated lower-voltage DC for electronic
devices. Low voltage, low power DC power supply units are commonly integrated with
the devices they supply, such as computers and household electronics.
 Batteries.
 Chemical fuel cells and other forms of energy storage systems.
 Solar power.
 Generators or alternators.

Block Diagram:
Fig .Regulated Power Supply

The basic circuit diagram of a regulated power supply (DC O/P) with led
connected as load is shown in fig:

Fig Circuit diagram of Regulated Power Supply with Led connection

The components mainly used in above figure are

 230V AC MAINS
 TRANSFORMER
 BRIDGE RECTIFIER(DIODES)
 CAPACITOR
 VOLTAGE REGULATOR(IC 7805)
 RESISTOR
 LED(LIGHT EMITTING DIODE)
The detailed explanation of each and every component mentioned above is as follows:

Step 1: Transformation: The process of transforming energy from one device to another
is called transformation. For transforming energy we use transformers.

Transformers:

A transformer is a device that transfers electrical energy from one circuit to


another through inductively coupled conductors without changing its frequency. A
varying current in the first or primary winding creates a varying magnetic flux in the
transformer's core, and thus a varying magnetic field through the secondary winding. This
varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the
secondary winding. This effect is called mutual induction.

If a load is connected to the secondary, an electric current will flow in the


secondary winding and electrical energy will be transferred from the primary circuit through
the transformer to the load. This field is made up from lines of force and has the same shape
as a bar magnet.

If the current is increased, the lines of force move outwards from the coil. If
the current is reduced, the lines of force move inwards.

If another coil is placed adjacent to the first coil then, as the field moves out or
in, the moving lines of force will "cut" the turns of the second coil. As it does this, a voltage
is induced in the second coil. With the 50 Hz AC mains supply, this will happen 50 times a
second. This is called MUTUAL INDUCTION and forms the basis of the transformer.

The input coil is called the PRIMARY WINDING; the output coil is the
SECONDARY WINDING. Fig: 3.3.4 shows step-down transformer.
Fig 3.3.3: Step-Down Transformer

The voltage induced in the secondary is determined by the TURNS RATIO.

For example, if the secondary has half the primary turns; the secondary will
have half the primary voltage.

Another example is if the primary has 5000 turns and the secondary has 500
turns, then the turn’s ratio is 10:1.

If the primary voltage is 240 volts then the secondary voltage will be x 10
smaller = 24 volts. Assuming a perfect transformer, the power provided by the primary must
equal the power taken by a load on the secondary. If a 24-watt lamp is connected across a 24
volt secondary, then the primary must supply 24 watts.

To aid magnetic coupling between primary and secondary, the coils are wound
on a metal CORE. Since the primary would induce power, called EDDY CURRENTS, into
this core, the core is LAMINATED. This means that it is made up from metal sheets
insulated from each other. Transformers to work at higher frequencies have an iron dust core
or no core at all.

Note that the transformer only works on AC, which has a constantly changing
current and moving field. DC has a steady current and therefore a steady field and there
would be no induction.

Some transformers have an electrostatic screen between primary and


secondary. This is to prevent some types of interference being fed from the equipment down
into the mains supply, or in the other direction. Transformers are sometimes used for
IMPEDANCE MATCHING.

We can use the transformers as step up or step down.

Step Up transformer:
In case of step up transformer, primary windings are every less compared to
secondary winding.

Because of having more turns secondary winding accepts more energy, and it
releases more voltage at the output side.

Step down transformer:

Incase of step down transformer, Primary winding induces more flux than the
secondary winding, and secondary winding is having less number of turns because of that it
accepts less number of flux, and releases less amount of voltage.

Battery power supply:

A battery is a type of linear power supply that offers benefits that traditional
line-operated power supplies lack: mobility, portability and reliability. A battery consists of
multiple electrochemical cells connected to provide the voltage desired. Fig: 3.3.4 shows Hi-
Watt 9V battery

Fig : Hi-Watt 9V Battery

The most commonly used dry-cell battery is the carbon-zinc dry cell
battery. Dry-cell batteries are made by stacking a carbon plate, a layer of electrolyte paste,
and a zinc plate alternately until the desired total voltage is achieved. The most common dry-
cell batteries have one of the following voltages: 1.5, 3, 6, 9, 22.5, 45, and 90. During the
discharge of a carbon-zinc battery, the zinc metal is converted to a zinc salt in the electrolyte,
and magnesium dioxide is reduced at the carbon electrode. These actions establish a voltage
of approximately 1.5 V.
The lead-acid storage battery may be used. This battery is rechargeable; it
consists of lead and lead/dioxide electrodes which are immersed in sulfuric acid. When fully
charged, this type of battery has a 2.06-2.14 V potential (A 12 volt car battery uses 6 cells in
series). During discharge, the lead is converted to lead sulfate and the sulfuric acid is
converted to water. When the battery is charging, the lead sulfate is converted back to lead
and lead dioxide A nickel-cadmium battery has become more popular in recent years. This
battery cell is completely sealed and rechargeable. The electrolyte is not involved in the
electrode reaction, making the voltage constant over the span of the batteries long service life.
During the charging process, nickel oxide is oxidized to its higher oxidation state and
cadmium oxide is reduced. The nickel-cadmium batteries have many benefits. They can be
stored both charged and uncharged. They have a long service life, high current availabilities,
constant voltage, and the ability to be recharged. Fig: 3.3.5 shows pencil battery of 1.5V.

Fig : Pencil Battery of 1.5V

Step 2: Rectification

The process of converting an alternating current to a pulsating direct current is


called as rectification. For rectification purpose we use rectifiers.

Rectifiers:

A rectifier is an electrical device that converts alternating current (AC) to


direct current (DC), a process known as rectification. Rectifiers have many uses including as
components of power supplies and as detectors of radio signals. Rectifiers may be made of
solid-state diodes, vacuum tube diodes, mercury arc valves, and other components.
A device that it can perform the opposite function (converting DC to AC) is
known as an inverter.

When only one diode is used to rectify AC (by blocking the negative or
positive portion of the waveform), the difference between the term diode and the term
rectifier is merely one of usage, i.e., the term rectifier describes a diode that is being used to
convert AC to DC. Almost all rectifiers comprise a number of diodes in a specific
arrangement for more efficiently converting AC to DC than is possible with only one diode.
Before the development of silicon semiconductor rectifiers, vacuum tube diodes and copper
(I) oxide or selenium rectifier stacks were used.

Bridge full wave rectifier:

The Bridge rectifier circuit is shown in figure, which converts an ac voltage to


dc voltage using both half cycles of the input ac voltage. The Bridge rectifier circuit is shown
in the figure. The circuit has four diodes connected to form a bridge. The ac input voltage is
applied to the diagonally opposite ends of the bridge. The load resistance is connected
between the other two ends of the bridge.

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct,
whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in series
with the load resistance RL and hence the load current flows through RL.

For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series with the
load resistance RL and hence the current flows through R L in the same direction as in the
previous half cycle. Thus a bi-directional wave is converted into a unidirectional wave.

Input Output
Fig : Bridge rectifier: a full-wave rectifier using 4 diodes

DB107:

Now -a -days Bridge rectifier is available in IC with a number of DB107. In


our project we are using an IC in place of bridge rectifier.

Features:

 Good for automation insertion


 Surge overload rating - 30 amperes peak
 Ideal for printed circuit board
 Reliable low cost construction utilizing molded
 Glass passivated device
 Polarity symbols molded on body
 Mounting position: Any
 Weight: 1.0 gram

Fig : DB107

Step 3: Filtration
The process of converting a pulsating direct current to a pure direct current
using filters is called as filtration.

Filters:

Electronic filters are electronic circuits, which perform signal-processing


functions, specifically to remove unwanted frequency components from the signal, to
enhance wanted ones.

Introduction to Capacitors:

The Capacitor or sometimes referred to as a Condenser is a passive device,


and one which stores energy in the form of an electrostatic field which produces a potential
(static voltage) across its plates. In its basic form a capacitor consists of two parallel
conductive plates that are not connected but are electrically separated either by air or by an
insulating material called the Dielectric. When a voltage is applied to these plates, a current
flows charging up the plates with electrons giving one plate a positive charge and the other
plate an equal and opposite negative charge. This flow of electrons to the plates is known as
the Charging Current and continues to flow until the voltage across the plates (and hence the
capacitor) is equal to the applied voltage Vcc. At this point the capacitor is said to be fully
charged and this is illustrated below.
Fig:Construction Of a Capacitor Fig :Electrolytic Capaticor

Units of Capacitance:

Microfarad (μF) 1μF = 1/1,000,000 = 0.000001 = 10-6 F

Nanofarad (nF) 1nF = 1/1,000,000,000 = 0.000000001 = 10-9 F

Pico farad (pF) 1pF = 1/1,000,000,000,000 = 0.000000000001 = 10-12 F

Operation of Capacitor:

Think of water flowing through a pipe. If we imagine a capacitor as being a


storage tank with an inlet and an outlet pipe, it is possible to show approximately how an
electronic capacitor works.
First, let's consider the case of a "coupling capacitor" where the capacitor is
used to connect a signal from one part of a circuit to another but without allowing any direct
current to flow.

If the current flow is alternating between zero and a


maximum, our "storage tank" capacitor will allow the
current waves to pass through.

However, if there is a steady current, only the initial


short burst will flow until the "floating ball valve" closes
and stops further flow.

So a coupling capacitor allows "alternating current" to pass through because the ball
valve doesn't get a chance to close as the waves go up and down. However, a steady current
quickly fills the tank so that all flow stops.

A capacitor will pass alternating current but (apart from an initial surge) it will
not pass d.c.

Where a capacitor is used to decouple a circuit, the


effect is to "smooth out ripples". Any ripples, waves or
pulses of current are passed to ground while d.c. Flows
smoothly.

Step 4: Regulation
The process of converting a varying voltage to a constant regulated voltage is
called as regulation. For the process of regulation we use voltage regulators.

Voltage Regulator:

A voltage regulator (also called a ‘regulator’) with only three terminals


appears to be a simple device, but it is in fact a very complex integrated circuit. It converts a
varying input voltage into a constant ‘regulated’ output voltage. Voltage Regulators are
available in a variety of outputs like 5V, 6V, 9V, 12V and 15V. The LM78XX series of
voltage regulators are designed for positive input. For applications requiring negative input,
the LM79XX series is used. Using a pair of ‘voltage-divider’ resistors can increase the output
voltage of a regulator circuit.

It is not possible to obtain a voltage lower than the stated rating. You cannot
use a 12V regulator to make a 5V power supply. Voltage regulators are very robust. These
can withstand over-current draw due to short circuits and also over-heating. In both cases, the
regulator will cut off before any damage occurs. The only way to destroy a regulator is to
apply reverse voltage to its input. Reverse polarity destroys the regulator almost instantly.
Fig: 3.3.10 shows voltage regulator.

Fig : Voltage Regulator

Resistors:

A resistor is a two-terminal electronic component that produces a voltage across its


terminals that is proportional to the electric current passing through it in accordance with
Ohm's law:
V = IR

Resistors are elements of electrical networks and electronic circuits and are ubiquitous
in most electronic equipment. Practical resistors can be made of various compounds and
films, as well as resistance wire (wire made of a high-resistivity alloy, such as
nickel/chrome).

The primary characteristics of a resistor are the resistance, the tolerance, maximum
working voltage and the power rating. Other characteristics include temperature coefficient,
noise, and inductance. Less well-known is critical resistance, the value below which power
dissipation limits the maximum permitted current flow, and above which the limit is applied
voltage. Critical resistance is determined by the design, materials and dimensions of the
resistor.

Resistors can be made to control the flow of current, to work as Voltage


dividers, to dissipate power and it can shape electrical waves when used in combination of
other components. Basic unit is ohms.

Theory of operation:

Ohm's law:

The behavior of an ideal resistor is dictated by the relationship specified in


Ohm's law:

V = IR

Ohm's law states that the voltage (V) across a resistor is proportional to the
current (I) through it where the constant of proportionality is the resistance (R).

Power dissipation:

The power dissipated by a resistor (or the equivalent resistance of a resistor


network) is calculated using the following:
Fig : Resistor Fig : Color Bands In Resistor

LED:

A light-emitting diode (LED) is a semiconductor light source. LEDs are used


as indicator lamps in many devices, and are increasingly used for lighting. Introduced as a
practical electronic component in 1962, early LEDs emitted low-intensity red light, but
modern versions are available across the visible, ultraviolet and infrared wavelengths, with
very high brightness. The internal structure and parts of a led are shown below.
Fig : Inside a LED Fig : Parts of a LED

Working:

The structure of the LED light is completely different than that of the light
bulb. Amazingly, the LED has a simple and strong structure. The light-emitting
semiconductor material is what determines the LED's color. The LED is based on the
semiconductor diode.

When a diode is forward biased (switched on), electrons are able to recombine
with holes within the device, releasing energy in the form of photons. This effect is called
electroluminescence and the color of the light (corresponding to the energy of the photon) is
determined by the energy gap of the semiconductor. An LED is usually small in area (less
than 1 mm2), and integrated optical components are used to shape its radiation pattern and
assist in reflection. LEDs present many advantages over incandescent light sources including
lower energy consumption, longer lifetime, improved robustness, smaller size, faster
switching, and greater durability and reliability. However, they are relatively expensive and
require more precise current and heat management than traditional light sources. Current
LED products for general lighting are more expensive to buy than fluorescent lamp sources
of comparable output. They also enjoy use in applications as diverse as replacements for
traditional light sources in automotive lighting (particularly indicators) and in traffic signals.
The compact size of LEDs has allowed new text and video displays and sensors to be
developed, while their high switching rates are useful in advanced communications
technology. The electrical symbol and polarities of led are shown in fig:

Fig : Electrical Symbol & Polarities of LED

LED lights have a variety of advantages over other light sources:

 High-levels of brightness and intensity


 High-efficiency
 Low-voltage and current requirements
 Low radiated heat
 High reliability (resistant to shock and vibration)
 No UV Rays
 Long source life
 Can be easily controlled and programmed

Applications of LED fall into three major categories:

 Visual signal application where the light goes more or less directly from the LED to
the human eye, to convey a message or meaning.
 Illumination where LED light is reflected from object to give visual response of these
objects.
 Generate light for measuring and interacting with processes that do not involve the
human visual system.
SOFTWARE DESCRIPTION

ARDUINO SOFTWARE:

The Arduino is a family of microcontroller boards to simplify electronic design, prototyping


and experimenting for artists, hackers, hobbyists, but also many professionals. People use it
as brains for their robots, to build new digital music instruments, or to build a system that lets
your house plants tweet you when they’re dry. Arduinos (we use the standard Arduino Uno)
are built around an ATmega microcontroller — essentially a complete computer with CPU,
RAM, Flash memory, and input/output
What you will need:
 A computer (Windows, Mac, or Linux)
 An Arduino-compatible microcontroller (anything from this guide should work)
 A USB A-to-B cable, or another appropriate way to connect your Arduino-compatible
microcontroller to your computer (check out this USB buying guide if you’re not sure
which cable to get).

 An Arduino Uno
 Windows 7, Vista, and XP
 Installing the Drivers for the Arduino Uno (from Arduino.cc)
 Plug in your board and wait for Windows to begin it’s driver installation process After
a few moments, the process will fail, despite its best efforts

 Click on the Start Menu, and open up the Control Panel


 While in the Control Panel, navigate to System and Security. Next, click on System
Once the System window is up, open the Device Manager
 Look under Ports (COM & LPT). You should see an open port named “Arduino UNO
(COMxx)”.
 If there is no COM & LPT section, look under ‘Other Devices’ for ‘Unknown Device’
 Right click on the “Arduino UNO (COMxx)” or “Unknown Device” port and
choose the “Update Driver Software” opti Next, choose the “Browse my
computer for Driver software” option

 Finally, navigate to and select the Uno’s driver file, named


“ArduinoUNO.inf”, located in the “Drivers” folder of the Arduino Software
download (not the “FTDI USB Drivers” sub-directory). If you cannot see
the .inf file, it is probably just hidden. You can select the ‘drivers’ folder with
the ‘search sub-folders’ option selected instead. Windows will finish up the
driver installation
LAUNCH AND BLINK!

After following the appropriate steps for your software install, we are now ready to
test your first program with your Arduino board!

 Launch the Arduino application


 If you disconnected your board, plug it back in
 Open the Blink example sketch by going to: File > Examples > 1.Basics >
Blink

 Select the type of Arduino board you’re using: Tools > Board > your board type
 Select the serial/COM port that your Arduino is attached to: Tools > Port >
COMxx
If you’re not sure which serial device is your Arduino, take a look at the available ports, then
unplug your Arduino and look again. The one that disappeared is your Arduino.

With your Arduino board connected, and the Blink sketch open, press the ‘Upload’ button

After a second, you should see some LEDs flashing on your Arduino, followed by the
message ‘Done Uploading’ in the status bar of the Blink sketch.

If everything worked, the onboard LED on your Arduino should now be blinking! You just
programmed your first Arduino!
Conclusion
Custom CNN model(s) for improved accuracy and case relevance can be trained on the
collected bus inside images for passenger count, detection of harm-causing objects, and facial
comparison with black-listed passengers. AWS Rekognition service usage can be replaced
with this model in the future. Accurately predicted wait durations, arrival times, and other
important metrics can also be shown in the future to passengers and management authority.
IoT devices can also be installed at bus stops to predict real-time passenger traffic and
allocate/redistribute buses based on prediction. Along with management authority, hospitals,
and fire stations can also be notified in case of accidents and fire. The implementation of
V2V (Vehicle-to-Vehicle) communication can also be done in the future.
References
[1] S. Akter, T. Islam, R. F. Olanrewaju and A. A. Binyamin, "A Cloud-Based Bus Tracking
System Based on Internet-of-Things Technology," 2019 7th International Conference on
Mechatronics Engineering (ICOM), Putrajaya, Malaysia, 2019, pp. 1-5, doi:
10.1109/ICOM47790.2019.8952037.

[2] Kumar, A., & Thomaz, A. C. F. (2022). Smart bus ticketing system through IoT enabled
technology. Big Data and Computing Visions, 2(1), 1-8. doi:
10.22105/bdcv.2022.326976.1046

[3] Paulo Miranda e Silva Sousa, José Robertty de Freitas Costa, Emanuel F. Coutinho, and
Carla I. M. Bezerra. 2021. An IoT solution for monitoring and prediction of bus stops on
university transportation using machine learning algorithms. In Proceedings of the 10th Euro-
American Conference on Telematics and Information Systems (EATIS '20). Association for
Computing Machinery, New York, NY, USA, Article 10, 1–7.

[4] K. Hong, D. Lillethun, B. Ottenw¨alder, and B. Koldehofe. Mobile Fog : A Programming


Model for Large Scale Applications on the Internet of Things. In the second ACM
SIGCOMM workshop on Mobile cloud computing (MCC ’13), pages 15–20, 2013.

[5] Maslekar, N., Boussedjra, M., Mouzna, J., Labiod, H.: Vanet based adaptive traffic signal
control. In: Vehicular Technology Conference, pp. 1–5 (2011) Application of Sensor-Cloud
Systems: Smart Traffic Control 201.

[6] Giang, N. K., Leung, V. C. M., & Lea, R. (2016). On Developing Smart Transportation
Applications in Fog Computing Paradigm. Proceedings of the 6th ACM Symposium on
Development and Analysis of Intelligent Vehicular Networks and Applications - DIVANet
’16. doi:10.1145/2989275.2989286.

[7] Priemer, C., Friedrich, B.: A decentralized adaptive traffic signal control using v2i
communication data. In: International IEEE Conference on Intelligent Transportation
Systems, pp. 1–6 (2009)

[8] M. Skhosana and A. E. ezugwu, "Irenbus: A Real-Time Public Transport Management


System," 2020 Conference on Information Communications Technology and Society
(ICTAS), Durban, South Africa, 2020, pp. 1-7, doi: 10.1109/ICTAS47918.2020.234000.
[9] R. Chawla, M. Dhakate and S. Chaurasia, "System and Method for Smart Public
Transportation System," 2020 International Conference on Industry 4.0 Technology (I4Tech),
Pune, India, 2020, pp. 51-54, doi: 10.1109/I4Tech48345.2020.9102635.

[10] V. Pawar and N. P. Bhosale, "Internet-of-Things Based Smart Local Bus Transport
Management System," 2018 Second International Conference on Electronics,
Communication and Aerospace Technology (ICECA), Coimbatore, India, 2018, pp. 598-601,
doi: 10.1109/ICECA.2018.8474728.

[11] Lv Zhian and Hu Han, "A bus management system based on ZigBee and GSM/GPRS,"
2010 International Conference on Computer Application and System Modeling (ICCASM
2010), Taiyuan, China, 2010, pp. V7- 210-V7-213, doi: 10.1109/ICCASM.2010.5620407.

[12] S. Vidyasagaran, S. R. Devi, A. Varma, A. Rajesh and H. Charan, "A low cost IoT based
crowd management system for public transport," 2017 International Conference on Inventive
Computing and Informatics (ICICI), Coimbatore, India, 2017, pp. 222-225, doi:
10.1109/ICICI.2017.8365342.

[13] L. Kang, S. Poslad, W. Wang, X. Li, Y. Zhang and C. Wang, "A Public Transport Bus as
a Flexible Mobile Smart Environment Sensing Platform for IoT," 2016 12th International
Conference on Intelligent Environments (IE), London, UK, 2016, pp. 1-8, doi:
10.1109/IE.2016.10.

[14] O. D. Jimoh, L. A. Ajao, O. O. Adeleke and S. S. Kolo, "A Vehicle Tracking System
Using Greedy Forwarding Algorithms for Public Transportation in Urban Arterial," in IEEE
Access, vol. 8, pp. 191706- 191725, 2020, doi: 10.1109/ACCESS.2020.3031488.

[15] X. Dong et al., "A Parallel Transportation Management and Control System for Bus
Rapid Transit Using the ACP Approach," in IEEE Transactions on Intelligent Transportation
Systems, vol. 18, no. 9, pp. 2569-2574, Sept. 2017, doi: 10.1109/TITS.2016.2645783.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy