You are on page 1of 59

1 ABOUT THE ORGANISATION

1.1 INTRODUCTION

Loginware Softtec Pvt. Ltd is an emerging startup established in the year 2016 and based in
Hassan, tier II city of Karnataka State. Loginware is a knowledge-driven company that values
cutting edge technology practices and provides comprehensive solutions to help our
customers achieve their goals. Loginware is changing the world by changing the way
knowledge can be shared. Loginware has the dedicated young minds striving to connect
individuals with each other and with technology.
Loginware Sofftec Pvt. Ltd. is a proactive player covering the full spectrum of software
services, from design, development, implementation, Validation, support and corporate
training.
Loginware provides solutions that enable its customers to deliver state-of-the-art
technological solutions. Leveraging a variety of platforms from embedded engineering to
application development with system software support.

Loginware is supported by a strong, committed team delivering quality work. As a diverse


end-to-end solutions provider, offers a range of expertise aimed at helping customers re-
engineer and re-invent their businesses to compete successfully in an ever-changing
marketplace, with the final objective of giving clients the competitive edge in the
marketplace.

1.2 HISTORY

The world has witnessed a phenomenal rise in information and communication technology
over the past two decades. Tier II and Tier III cities play an important role in the socio-
economic development of any country. Tier II and III cities in India are no more dependent
on the traditional tools to run business. Loginware Softtec Pvt. Ltd an emerging startup
based at Hassan, a tier II city in Karnataka State. The vision for this unit, has been developed
through a collaborative process during the past 2 years, including a campus-wide vision
crafting process that involved engineers, academic faculty, administration, a review of
multiple existing platforms and support from various technology organizations.

1.3 VISION

To be a leading technology company, transforming creative ideas into reality.

1.4 MISSION

Bringing out the best in everyone we touch, motivate, inspire and empower each other to do
things they never thought were possible.

1.5 OBJECTIVES

The primary purpose of this company will be to utilize a carefully designed and integrated set
of training programs, entrepreneurship development components, cooperative concepts and
technology services to select and train individuals of tier II and tier III cities to become new
generation skilled workers cum entrepreneurs and community builders.
The programs carried out in Loginware will attract, screen, motive, prepare and assist
individuals of tier II and tier III cities to effectively utilize the new generation technology.
1) Creating a one-stop technology platform or a knowledge hub to support all kinds of
technology needs of Tier II and III cities.
2) Make available at one location all of the essential technology facilities, training and
support services needed by individuals of tier II and tier III cities.
3) Systematically create substantial number of new modern small business enterprises and
worker cooperatives.
4) Generate economic growth and employment opportunities for youth and poor people in
tier II and tier III cities.

1.6 THE IDEA

1.6.1 One Place. Many Possibilities.


The idea is to create a one-stop technology platform or a knowledge hub to support all kinds
of technology needs of Tier II and III cities. A conventional “knowledge hub” is a vibrant
learning center which is accessible to communities to gain, share and organize knowledge
depending on their needs and environment. A technology platform should connect individuals
of tier II and III cities with each other and with technology.

The presence of Technology hub in tier II and tier III cities may also financially benefit
technology enthusiasts, students and individuals as they will not need to travel to the tier I
cities as often and thus, avoid the loss of income they would incur if they had to frequently
travel to a major centre. From a political perspective, all citizens need access to the new
technology trends, not just those in selected urban areas. Thus, Technology hubs may be
established to address national as well as local community needs.
Loginware Softtec Pvt. Ltd., is one such technology platform with many possibilities and
enormous opportunities.
1.7 The Problem
Information and Technology is the key enabler and a vital component of the new knowledge
based economy and information revolution. It is a major factor in economic growth and
increasing productivity. India is increasingly integrating Technology into its national
development plans and adopting strategies for its widespread promotion.

Tier II and Tier III cities plays an important role in the overall socio-economic development
of the country. About 68.84% of Indians live in rural and semi urban areas. There is a need to
ensure that the benefit of the technological developments percolates to all the different socio-
economic strata and to the grass roots of the tier II and tier III cities of India. The small towns
in India cannot be compared with its urban areas, where needs and service requirements are at
a very different level. With poor existing infrastructure in these areas, delivery of services of
essential requirements becomes in itself formidable task in tier II and tier III cities spread out
in every type of agro climatic zones.

Despite the enormous benefits enjoyed through the technology revolution by people in
metropolitan areas of developing countries like India, penetration of the technology in these
areas is poor. Access to technology in Tier II and Tier III Cities is limited because of lack of
technology infrastructure within the ecosystem. Hence the level of technology usage
remained low. Without using of information technology today, SME of tier II and tier III
cities will have serious and fatal consequences in the future and will imply the risk of lagging
behind economically with all the implications that this entails. In particular, if we take in
consideration that information technology presents a critical factor of development of
economy in general and SME’s in particular. In spite of rapid growth of technology, still
Indian villages and villagers are facing lot of socio economic problems like adopting
advanced technological methods in agriculture, effective utilization of water and power
sources, adopting new methods to market their agricultural products using mobile apps, etc.
Even though many problems can be solved using advanced technological methods and
applications, due to lack of knowledge among villagers and lack of knowledge
resources/knowledge hub available near to villages, many problems are left unresolved.
Many technical students/enthusiasts in rural and semi urban areas have lot of ideas to solve
these problems, but they do not have suitable platform and necessary technical skills to
implement or develop any prototype to prove their ideas. Hence many ideas of rural
people/students left unused and many of these problems remains unsolved.

1.8 CONTRIBUTE TOWARDS

1.8.1 Technology Access in Tier II and Tier III Cities


Access to trending technologies can play a pivotal role in the socio-economic development of
tier II and tier III cities. For affordability, the choice of technology to achieve this is a
significant aspect.
Research and technology are most needed where development is lacking, that is, in the
developing regions of the world. However, technology meant for developed economies are
often too high cost, or otherwise unsuitable, for use in these regions. Thus, despite the
enormous benefits enjoyed through the technology revolution by people in metropolitan areas
of developing countries like India, penetration of the technology in these areas is poor. This is
mainly because of lack of knowledge and lack of knowledge resources/knowledge hub
available in these areas.

1.8.2 Adoption of technology in Agriculture


Technological importance has been a great support for making decisions in various fields
especially in agriculture. The development of agriculture has been on under development for
the past few years due to lack of Agriculture knowledge and environmental changes. Hence,
‘E-agriculture’ is an immediate need for the society. “E-Agriculture” is an emerging field in
the connection of agricultural informatics, development and entrepreneurship which is
focusing to agricultural services, technology distribution and information delivered or
developed through the Internet and associated technologies. Specifically, it engages the
conceptualization, design, development, assessment and application of innovative ways to
use active or emerging information and communication technologies.

Today many agricultural industries turned to adopt new technology for smart farming to
enhance efficiency, productivity, global market and other features such as minimum human
intervention, time and cost etc. The advancement in the technology ensures that the sensors
are getting smaller, sophisticated and more economic. The networks are also easily accessible
globally so that smart farming can be achieved with full pledge.
The smart agriculture market is expected to reach $18.45 Billion in 2022.Smart agriculture
will help in monitoring livestock productivity and health as well. Technology advancements
are capable of providing farmers with information about crop yields; rainfall, pest infestation,
and soil nutrition are invaluable to production and offer precise data which can be used to
improve farming techniques over time. Internet of things, with its real-time, accurate and
shared characteristics, will bring great changes to the agricultural supply chain and provide a
critical technology for establishing a smooth flow of agricultural logistics. Focusing on
encouraging innovation in agriculture, smart farming is the answer to the problems that this
industry is currently facing.

1.8.3 Technology penetration in SME’s of Tier II and Tier III Cities


Small and Medium Sized Enterprises (SME) of tier II and tier III cities is drawing attention in
developed and developing countries as well as in transition countries. As per WTO, Micro
firms and SMEs account for the majority of firms (95% on average)and for the vast majority
of jobs in most countries. As per the 2016-17 Annual Report published by the Ministry of
Micros, Small and Medium Enterprises, India is home to 51mn MSMEs which
contributes to 37.5 % of India’s GDP and 37 % of the manufacturing output, underlining their
strategic important to the Indian economy. In other words, they are the backbone of the
Indian economy.
It is generally recognized that SME play a key role in the revitalization and development of
national economy in many countries and particular in the context of India. It is encouraging
the development of SME and the role that SME sector can play in promoting economic and
social development by creating opportunities for employment.
Tier II and III cities in India are no more dependent on the traditional tools to run business.
Technology has increasingly made its way into small towns and cities and intervened in the
conventional ways of doing business. A report by Nowfloat and Zinnov revealed that 90
percent of small businesses in India are adopting smart technologies for their business.
India’s economic growth in the last four years has largely been driven by the contribution
from IT sector. Karnataka stood first among the States in India. We have to re imagine
beyond the traditional processes of business and enable micro-entrepreneurs to leverage the
potential usage of technology.
The SME Competitiveness Outlook report finds that the biggest gap between small and large
firms performance related to global trade is in “e-connectivity”. The right application of
technology is opening up multiple avenues and opportunities at low cost for SMEs to
internationalize and connect to the global markets through technology and internet are
particularly relevant for SMEs.

1.8.4 Technology access in Education Sector of Tier II and Tier III cities
Technology can be a powerful tool for transforming learning. It can help affirm and advance
relationships between educators and students, reinvent our approaches to learning and
collaboration, shrink long-standing equity and accessibility gaps, and adapt learning
experiences to meet the needs of all learners. Schools, colleges, learning centers of tier II and
tier III should be incubators of exploration and invention. Educators should be collaborators
in learning, seeking new knowledge and constantly acquiring new skills alongside their
students. Education leaders should set a vision for creating learning experiences that provide
the right tools and supports for all learners to thrive. However, to realize fully the benefits of
technology in our education system and provide authentic learning experiences, educators
need to use technology effectively in their practice.
Education and skills are the key foundation elements of the nation’s economic growth and
powering global leadership. Shortage of a skilled workforce is emerging day by day and is
considered as a significant challenge for the Indian IT industry. According to a research
conducted by NASSCOM, every year more than 3 million graduates and post-graduates are
added to the Indian human-resource and out of these, only 25% of IT graduates are
considered employable by fast growing IT & ITES industry. This data is in alignment with
the data from Mckinsey on engineers' employability (20-25%) and even recently, a survey by
the employability assessment firm, Aspiring Minds, said 95% of engineers cannot code. This
problem cuts across the demographic dividend and is a challenge that the nation needs to
focus on high priority.
1.9 Services
Loginware is the one stop partner for all the technology needs of tier II and tier III cities. An
in-depth knowledge of various technology areas enables us to provide end to end solutions
and services. With our 'Web of Participation', we maximize the benefits of our depth,
diversity and delivery capability, ensuring adaptability to individual needs, and thus bringing
out the most innovative solutions in every business and technology domain.
1.9.1 Embedded Engineering:
Embedded systems and software are driving the new-age lifestyle and various aspects of
modern life. As hardware becomes powerful and cost effective, embedded software in
devices expands its footprint in various areas such as consumer electronics, transportation,
medicine, and manufacturing.
Loginware Embedded Systems group provides offerings that meet diverse industry
requirements. We have in-depth domain knowledge and expertise in the entire embedded
systems space, ranging from concept to product launch. The offerings broadly include:
1) Embedded Systems Research and Development
2) Product Prototyping.
3) Embedded Robotics.
4) Internet of Things

1.9.2 Web and Mobile:


The proliferation of mobile devices and the advancement in Internet services has created an
“always-on” society or “ubiquitous society,” where mobile and web services have penetrated
to every corner of today's life. Mobile and Web have greatly changed people's way to shop, to
work, and even to live.
Loginware Mobile and Web services group provide offerings that meet every individual and
business need. The offerings broadly include:
1) Website development and Maintenance.
2) Web based Application Development.
3) Custom Software Development.
4) Mobile App Development
.
1.9.3 Technology Consulting:
Today, business and technology innovation are inextricably linked and the demand for
technology-enabled business transformation services is rapidly growing. Social Business,
Mobility, Analytics and Cloud technologies have profoundly changed the business landscape.
To rapidly turn these advances into competitive advantages, there is a need of an IT
consulting partner with innovative solutions, well-defined strategies and deep domain
expertise.
Loginware's technology advisory services will help transform business through the
management and implementation of new apps, platforms, architecture and tech. Loginware’s
technology consulting service will work with you to refine your processes, workflows and
management systems that are affected by technology change and help ensure a smooth
transition.
Our Services include the following:
1) Consulting
2) Customization
3) Branding
4) Technology Migration

1.9.4 Knowledge Sharing:


Loginware is a leading learning services and professional development solutions provider.
We deliver learning solutions to support customers as they adapt to key business
transformations and technological advancements that drive the way that organizations around
the world differentiate themselves and thrive.
Our learning programs, whether designed for a global organization or an individual
professional, help businesses close skills gaps and foster an environment of continuous talent
development.
Loginware Global Learning
A learning initiative by Loginware Softtec Pvt .Ltd.

LGL is our flagship program to share the knowledge and build the vibrant learning network.
We focus on sharing the knowledge and connecting the knowledge seekers with technology.
We currently offer services in the following verticals.
1) On Campus Technology Workshops
2) Domain Specific Training
3) Technology Internships
4) Corporate and Professional Training

1.10 OUR WORK


Since its incorporation, Loginware is successfully organized many technology workshops,
internships and guided many technology enthusiasts to give life to their ideas. It also
supported many SME ‘s of Hassan in terms of website development, custom software
development and technology consulting.
Following are glimpse of work we have done so far.

1.10.1 On Campus Workshops

1.10.2 Future Road Map


The existing process for knowledge generation and sharing already provides a wealth of
information on development co-operation. However, the key issue is how to incentivise
knowledge generation, distil results and lessons coming from implementation of
commitments for effective development co-operation and improve tools that can facilitate
knowledge exchange. With this purpose in mind, the group proposes the establishment of a
expanding the technology hub (the scope to be further determined based on the needs
assessment), with the more advanced technologies and practices. Taking into consideration
key strengths, gaps and opportunities identified, the Roadmap presents a path for Loginware
to follow in order to improve its institutional maturity and to reach every corner of tier II and
tier III cities.
The key elements of the Roadmap can be grouped into two areas: (a) actions that relate to
“Technology Management”, and (b) actions that relate to “Collaboration and Learning”.
Technology Management: Proposed Technology Management activities pertain to the user-
friendly, timely and transparent capture, organization, storage, governance, use and
dissemination/flow relevant technology content. These activities include technological
(systems and infrastructure), as well as procedural enhancements to upgrade and better use
the existing technology tools and processes. They also aim to develop and put in place
advanced tools, including a Loginware Knowledge Repository and a Loginware Document
Management System. The Roadmap also includes both infrastructure/process and behavioral
changes needed to mainstream knowledge in the core business of the tier II and tier III cites
and to realize a centralized Knowledge Exchange Hub with sound governance to enable
effective knowledge capture, storage and sharing
.

2 INTRODUCTION TO RASPBERRY pi 3
2.1 Raspberry pi 3

2.1.1 Introduction
The Raspberry Pi is a series of small single-board computers developed in the United
Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer
science in schools and in developing countries. The original model became far more popular
than anticipated, selling outside its target market for uses such as robotics. It does not include
peripherals (such as keyboards and mice) and cases. However, some accessories have been
included in several official and unofficial bundles.

The organisation behind the Raspberry Pi consists of two arms. The first two models were
developed by the Raspberry Pi Foundation. After the Pi Model B was released, the
Foundation set up Raspberry Pi Trading, with Eben Upton as CEO, to develop the third
model, the B+. Raspberry Pi Trading is responsible for developing the technology while the
Foundation is an educational charity to promote the teaching of basic computer science in
schools and in developing countries.
According to the Raspberry Pi Foundation, more than 5 million Raspberry Pis were sold by
February 2015, making it the best-selling British computer. By November 2016 they had sold
11 million units, and 12.5m by March 2017, making it the third best-selling "general purpose
computer".In July 2017, sales reached nearly 15 million. In March 2018, sales reached 19
million.

2.1.2 Generation of released models

Several generations of Raspberry Pis have been released. All models feature
a Broadcom system on a chip (SoC) with an integrated ARM-compatible central processing
unit (CPU) and on-chip graphics processing unit (GPU).
The first generation (Raspberry Pi 1 Model B) was released in February 2012, followed by
the simpler and cheaper Model A. In 2014, the Foundation released a board with an improved
design, Raspberry Pi 1 Model B+. These boards are approximately credit-card sized and
represent the standard mainline form-factor. Improved A+ and B+ models were released a
year later. A "Compute Module" was released in April 2014 for embedded applications.
The Raspberry Pi 2, which added more RAM, was released in February 2015.
A Raspberry Pi Zero with smaller size and reduced input/output (I/O) and general-purpose
input/output (GPIO) capabilities was released in November 2015 for US$5. By 2017, it
became the newest mainline Raspberry Pi. On 28 February 2017, the Raspberry Pi
Zero W was launched, a version of the Zero with Wi-Fi and Bluetooth capabilities, for
US$10. On 12 January 2018, the Raspberry Pi Zero WH was launched, the same version of
the Zero W with pre-soldered GPIO headers.
Raspberry Pi 3 Model B was released in February 2016 with a 64 bit quad core processor, on-
board WiFi, Bluetooth and USB boot capabilities. On Pi Day 2018 model 3B+ appeared with
a faster 1.4 GHz processor and a three times faster network based on gigabit Ethernet (300
Mbit / s) or 2.4 / 5 GHz dual-band Wi-Fi (100 Mbit / s). Other options are: Power over
Ethernet (PoE), USB boot and network boot (an SD card is no longer required). This allows
the use of the Pi in hard-to-reach places (possibly without electricity).

2.1.3 Hardware

The Raspberry Pi hardware has evolved through several versions that feature variations in
memory capacity and peripheral-device support.
2.1.4 Technical Specification:
>Broadcom BCM2837 64bit ARMv7 Quad Core Processor powered Single Board Computer
running at 1.2GHz

>1GB RAM

>BCM43143 WiFi on board

>Bluetooth Low Energy (BLE) on board

>40pin extended GPIO

>4 x USB 2 ports

>4 pole Stereo output and Composite video port

>40pin extended GPIO

>4 x USB 2 ports

>4 pole Stereo output and Composite video port

>Full size HDMI

>CSI camera port for connecting the Raspberry Pi camera

>DSI display port for connecting the Raspberry Pi touch screen display

>Micro SD port for loading your operating system and storing data

>Upgraded switched Micro USB power source (now supports up to 2.4 Amps)

>Expected to have the same form factor has the Pi 2 Model B, however the LEDs will change
position.

2.2 Types of sensors

2.2.1 LDR Sensor


An LDR or light dependent resistor is also known as photo resistor, photocell,
photoconductor.It is a one type of resistor whose resistance varies depending on the amount
of light falling on its surface. When the light falls on the resistor, then the resistance changes.
These resistors are often used in many circuits where it is required to sense the presence of
light. These resistors have a variety of functions and resistance. For instance, when the LDR
is in darkness, then it can be used to turn ON a light or to turn OFF a light when it is in the
light. A typical light dependent resistor has a resistance in the darkness of 1MOhm, and in the
brightness a resistance of a couple of KOhm

Working principle

This resistor works on the principle of photo conductivity. It is nothing but, when the light
falls on its surface, then the material conductivity reduces and also the electrons in the
valence band of the device are excited to the conduction band. These photons in the incident
light must have energy greater than the band gap of the semiconductor material.This makes
the electrons to jump from the valence band to conduction.

Types of light Dependent Resistors

Light dependent resistors are classified based on the materials used.

Intrinsic Photo Resistors

These resistors are pure semiconductor devices like silicon or germanium. When the light
falls on the LDR, then the electrons get excited from the valence band to the conduction band
and number of charge carriers increases.

Extrinsic Photo Resistors

These devices are doped with impurities and these impurities creates a new energy bands
above the valence band. These bands are filled with electrons. Hence this decrease the band
gap and small amount of energy is required in moving them. These resistors are mainly used
for long wavelengths.
Applications

 Light dependent resistors have a low cost and simple structure.


 These resistors are frequently used as light sensors.
 These resistors are mainly used when there is a need to sense the absence and
presence of the light such as burglar alarm circuits, alarm clock, light intensity meters,
etc.
 LDR resistors mainly involves in various electrical and electronic projects.

2.2.2 DTH11 TEMPERATURE AND HUMIDITY SENSOR

DHT11 is a part of DHTXX series of Humidity sensors. Both these sensors are Relative
Humidity (RH) Sensor. As a result, they will measure both the humidity and temperature.
Although DHT11 Humidity Sensors are cheap and slow, they are very popular among
hobbyists and beginners. The DHT11 Humidity and Temperature Sensor consists of 3 main
components. A resistive type humidity sensor, an NTC thermistor and an 8-bit
microcontroller, which converts the analog signals from both the sensors and sends out single
digital signal.

DHT11 Humidity Sensor consists of 4 pins: VCC, Data Out, Not Connected (NC) and GND.
The range of voltage for VCC pin is 3.5V to 5.5V. A 5V supply would do fine. The data from
the Data Out pin is a serial digital data. DHT11 Sensor can measure a humidity value in the
range of 20 – 90% of Relative Humidity (RH) and a temperature in the range of 0 – 500C.
The sampling period of the sensor is 1 second.

The data from the DHT11 sensor consists of 40 – bits and the format is as follows:

8 – Bit data for integral RH value, 8 – Bit data for decimal RH value, 8 – Bit data for integral
Temperature value, 8 – Bit data for integral Temperature value and 8 – Bit data for
checksum.

Example
Consider the data received from the DHT11 Sensor is
00100101 00000000 00011001 00000000 00111110.

This data can be separated based on the above mentioned structure as follows

Applications

 For measurements in complex industrial applications


 For measurements under rough operating condition

2.2.3 IR Sensor

An IR sensor is an electronic device, that produces in order to detect some parts of the
environs. An infrared sensor can measure the heat of an object as well as detects the motion.
These sensors are used to measure only IR radiation, rather than producing it that is called as
a passive infrared sensor. Generally in the IR spectrum, all the surrounding objects generate
different form of thermal radiation.These kinds of radiations are not observable to our eyes,
that can be sensed by an IR sensor. The emitter of the sensor is infrared LED and the sensor
is an IR photodiode which is sensitive to infrared light of the same wavelength as that
produced by the infrared LED. When infrared light drops on the photodiode, the resistances
and o/p voltages change in proportion to the received magnitude of the infrared light.

IR sensor is an electronic device which is used to sense heat & objects. IR sensors are
classified into two types such as photo IR sensor and thermal IR sensor.
 A thermal infrared sensor detects the change of heat from its nearby objects
 The photo IR sensor uses a photo diode to sense IR radiations. In this article as an
infrared sensor a photo IR sensor is used to build the circuit.

Applications

 They involve from domestic devices to industrial devices.


 These sensors are used in object sensing, motion detectors, obstacle avoidance robot,
gas leakage detection, smoke detection, measurement of distance, robotics and many
more.

2.2.4 ULTRA SONIC SENSOR


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

Ultrasonic means of distance measurement is a convenient method compared totraditional


one using measurement scales.

This kind of measurement is particularly applicable to inaccessible areas wheretraditional


means cannot be implemented such as high temperature, pressure zones etc.
The basic principle of work:
(1) Using IO trigger for at least 10us high level signal, (2) The Module automatically sends
eight 40 kHz and detect whether there is a pulse signal back. (3) IF the signal back, through
high level , time of high output IO duration is the time from sending ultrasonic to returning.
Test distance = (high level time×velocity of sound (340M/S) / 2,

Advantages

 They have greater accuracy than many other methods at measuring thickness and
distance to a parallel surface
 Their high frequency, sensitivity, and penetrating power make it easy to detect
external or deep objects
 Our SCXL-MaxSonar-WR Product line is self-cleaning.  Which allows for continuous
running and less downtime
 Our ultrasonic sensors are easy to use and not dangerous during operation to nearby
objects, people or equipment
 Our sensors easily interface with microcontrollers or any type of controller

Applications

 Anti-Collision Detection
 People Detection
 Contouring or Profiling
 Presence Detection
 Box Sorting using a Multi-Transducer System
 Easy Control of Trash Collection Vehicles
 Pallet Detection with Forklifts
 Bottle Counting on Drink Filling Machines

2.2.5 Dc motor
A DC motor is an electric motor that runs on direct current power. In any electric motor,
operation is dependent upon simple electromagnetism. A current carrying conductor
generates a magnetic field, when this is then placed in an external magnetic field, it will
encounter a force proportional to the current in the conductor and to the strength of the
external magnetic field.It is a device which converts electrical energy to mechanical energy.
It works on the fact that a current carrying conductor placed in a magnetic field experiences a
force which causes it to rotate with respect to its original position.
Practical DC Motor consists of field windings to provide the magnetic flux and armature
which acts as the conductor.

The rotor consists of windings, the windings being electrically associated with the
commutator. The geometry of the brushes, commutator contacts and rotor windings are such
that when power is applied, the polarities of the energized winding and the stator magnets are
misaligned and the rotor will turn until it is very nearly straightened with the stator’s field
magnets.

As the rotor reaches alignment, the brushes move to the next commutator contacts and
energize the next winding. The rotation reverses the direction of current through the rotor
winding, prompting a flip of the rotor’s magnetic field, driving it to keep rotating.

Advantages
 Provide excellent speed control for acceleration and deceleration
 Easy to understand design
 Simple, cheap drive design

Applications
 The series DC motor is an industry workhorse for both high and low power, fixed and
variable speed electric drives.
Applications range from cheap toys to automotive applications.
 They are inexpensive to manufacture and are used in variable speed household
appliances such as sewing machines and power tools.
 Its high starting torque makes it particularly suitable for a wide range of traction
applications.
 Train and automotive traction applications.

2.2.6 LED

A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n


junction diode that emits light when activated.When a suitable current is applied to the
leads, electrons are able to recombine with electron 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 band gap of the
semiconductor. LEDs are typically small (less than 1 mm2) and integrated optical components
may be used to shape the radiation pattern.
Working principle
A P-N junction can convert absorbed light energy into a proportional electric current. The
same process is reversed here (i.e. the P-N junction emits light when electrical energy is
applied to it). This phenomenon is generally called electroluminescence, which can be
defined as the emission of light from a semiconductor under the influence of an electric field.
The charge carriers recombine in a forward-biased P-N junction as the electrons cross from
the N-region and recombine with the holes existing in the P-region. Free electrons are in
the conduction band of energy levels, while holes are in the valence energy band. Thus the
energy level of the holes is less than the energy levels of the electrons. Some portion of the
energy must be dissipated to recombine the electrons and the holes. This energy is emitted in
the form of heat and light.
The electrons dissipate energy in the form of heat for silicon and germanium diodes but
in gallium arsenide phosphide(GaAsP) and gallium phosphide (GaP) semiconductors, the
electrons dissipate energy by emitting photons. If the semiconductor is translucent, the
junction becomes the source of light as it is emitted, thus becoming a light-emitting diode.
However, when the junction is reverse biased, the LED produces no light and—if the
potential is great enough, the device is damaged.

Applications

 In motor vehicles and bicycle lights.


 In traffic light Indicators, signs and signals.
 In data displaying boards.
 In medical applications and toys
 Non visual applications.
 In light bulbs and many more.
 Remote controls

2.2.7 BUZZER
A buzzer or beeper is an audio signalling device, which may
be mechanical, electromechanical, or piezoelectric (piezo for short). Typical uses of buzzers
and beepers include alarm devices, timers, and confirmation of user input such as a mouse
click or keystroke.

TYPES
Electrochemical
Early devices were based on an electromechanical system identical to an electric bell without
the metal gong. Similarly, a relay may be connected to interrupt its own actuating current,
causing the contacts to buzz. Often these units were anchored to a wall or ceiling to use it as a
sounding board. The word "buzzer" comes from the rasping noise that electromechanical
buzzers made.
Mechanical
A joy buzzer is an example of a purely mechanical buzzer and they require drivers. Other
examples of them are doorbells.
Piezoelectric
A piezoelectric element may be driven by an oscillating electronic circuit or other audio
signal source, driven with a piezoelectric audio amplifier. Sounds commonly used to indicate
that a button has been pressed are a click, a ring or a beep.
A piezoelectric buzzer/beeper also depends on acoustic cavity resonance or Helmholtz
resonance to produce an audible beep.

Applications

 Judging panels
 Educational purposes
 Annunciator panels
 Electronic metronomes
 Game show lock-out device
 Microwave ovens and other household appliances
 Sporting events such as basketball games
 Electrical alarms
 Joy buzzer (mechanical buzzer used for pranks)

2.2.8 BLUETOOTH MODULE


HC‐05 module is an easy to use Bluetooth SPP (Serial Port Protocol) module,designed for
transparent wireless serial connection setup.The HC-05 Bluetooth Module can be used in a
Master or Slave configuration, making it a great solution for wireless communication.This
serial port bluetooth module is fully qualified Bluetooth V2.0+EDR (Enhanced Data Rate)
3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR
Bluecore 04‐External single chip Rluetooth system with CMOS technology and with AFH
(Adaptive Frequency Hopping Feature). The Bluetooth module HC-05 is a
MASTER/SLAVE module.By default the factory setting is SLAVE.The Role of the module
(Master or Slave) can be configured only by AT COMMANDS.The slave modules cannot
initiate a connection to another Bluetooth device, but can accept connections.Master module
can initiate a connection to other devices.The user can use it simply for a serial port
replacement to establish connection between MCU and GPS, PC to your embedded project,
etc.

Applications
 Light switch controller
 Remote data logger
 Trusted device management
 Used as a remote host

2.2.9 RFID TAGS


Radio-frequency identification (RFID) uses electromagnetic fields to automatically identify
and track tags attached to objects. The tags contain electronically-stored information. Passive
tags collect energy from a nearby RFID reader's interrogating radio waves. Active tags have a
local power source (such as a battery) and may operate hundreds of meters from the RFID
reader. Unlike a barcode, the tag need not be within the line of sight of the reader, so it may
be embedded in the tracked object. RFID is one method for Automatic Identification and
Data Capture (AIDC).
RFID tags are used in many industries, for example, an RFID tag attached to an automobile
during production can be used to track its progress through the assembly line; RFID-tagged
pharmaceuticals can be tracked through warehouses; and implanting RFID microchips in
livestock and pets allows for positive identification of animals.
In 2014, the world RFID market was worth US$8.89 billion, up from US$7.77 billion in 2013
and US$6.96 billion in 2012. This figure includes tags, readers, and software/services for
RFID cards, labels, fobs, and all other form factors. The market value is expected to rise to
US$18.68 billion by 2026.
RFID offers advantages over manual systems or use of bar codes. The tag can be read if
passed near a reader, even if it is covered by the object or not visible. The tag can be read
inside a case, carton, box or other container, and unlike barcodes, RFID tags can be read
hundreds at a time. Bar codes can only be read one at a time using current devices.
In 2011, the cost of passive tags started at US$0.09 each; special tags, meant to be mounted
on metal or withstand gamma sterilization, can go up to US$5. Active tags for tracking
containers, medical assets, or monitoring environmental conditions in data centers start at
US$50 and can go up over US$100 each. Battery-Assisted Passive (BAP) tags are in the
US$3–10 range and also have sensor capability like temperature and humidity.

Applications

 Access management
 Tracking of goods
 Tracking of persons and animals[23]
 Toll collection and contactless payment
 Machine readable travel documents
 Smartdust (for massively distributed sensor networks)
 Airport baggage tracking logistics[24]
 Timing sporting events
 Tracking and billing processes

2.2.10 LCD

LCD (liquid crystal display) is the technology used for displays in notebook and other smaller
computers. Like light-emitting diode (LED) and gas-plasma technologies, LCDs allow
displays to be much thinner than cathode ray tube (CRT) technology. LCDs consume much
less power than LED and gas-display displays because they work on the principle of blocking
light rather than emitting it.

An LCD is made with either a passive matrix or an active matrix display display grid. The
active matrix LCD is also known as a thin film transistor (TFT) display. The passive matrix
LCD has a grid of conductors with pixels located at each intersection in the grid. A current is
sent across two conductors on the grid to control the light for any pixel. An active matrix has
a transistor located at each pixel intersection, requiring less current to control the luminance
of a pixel. For this reason, the current in an active matrix display can be switched on and off
more frequently, improving the screen refresh time (your mouse will appear to move more
smoothly across the screen, for example).

Some passive matrix LCD's have dual scanning, meaning that they scan the grid twice with
current in the same time that it took for one scan in the original technology. However, active
matrix is still a superior technology.

Applications
 The liquid crystal displays (LCDs) are used in aircraft cockpit displays.
 It is used as a display screen in calculators.
 For displaying images used in digital cameras.
 The television is main applications of LCD.
 Mostly the computer monitor is made up of LCDs.
 It is used in instruments panel where all the lab instruments uses LCD screens for
display.
 The LCDs are commonly used in all the digital wrist watches for displaying time.
 The LCDs are used in mobile screens.
 It is also used in video players.

2.2.11 7 SEGMENT DISPLAY

An LED or Light Emitting Diode, is a solid state optical pn-junction diode which emits light
energy in the form of photons. The emission of these photons occurs when the diode junction
is forward biased by an external voltage allowing current to flow across its junction, and in
Electronics we call this process electroluminescence.
The actual colour of the visible light emitted by an LED, ranging from blue to red to orange,
is decided by the spectral wavelength of the emitted light which itself is dependent upon the
mixture of the various impurities added to the semiconductor materials used to produce it.
The 7-segment display, also written as “seven segment display”, consists of seven LEDs
(hence its name) arranged in a rectangular fashion as shown. Each of the seven LEDs is
called a segment because when illuminated the segment forms part of a numerical digit (both
Decimal and Hex) to be displayed. An additional 8th LED is sometimes used within the same
package thus allowing the indication of a decimal point, (DP) when two or more 7-segment
displays are connected together to display numbers greater than ten.
Each one of the seven LEDs in the display is given a positional segment with one of its
connection pins being brought straight out of the rectangular plastic package. These
individually LED pins are labelled from a through to g representing each individual LED.
The other LED pins are connected together and wired to form a common pin.
The displays common pin is generally used to identify which type of 7-segment display it is.
As each LED has two connecting pins, one called the “Anode” and the other called the
“Cathode”, there are therefore two types of LED 7-segment display called: Common
Cathode (CC) and Common Anode (CA).
The difference between the two displays, as their name suggests, is that the common cathode
has all the cathodes of the 7-segments connected directly together and the common anode has
all the anodes of the 7-segments connected together and is illuminated as follows.
1. The Common Cathode (CC) – In the common cathode display, all the
cathode connections of the LED segments are joined together to logic “0” or
ground. The individual segments are illuminated by application of a “HIGH”,
or logic “1” signal via a current limiting resistor to forward bias the individual
Anode terminals (a-g).
2. The Common Anode (CA) – In the common anode display, all the anode
connections of the LED segments are joined together to logic “1”. The
individual segments are illuminated by applying a ground, logic “0” or
“LOW” signal via a suitable current limiting resistor to the Cathode of the
particular segment (a-g).

Application

 The applications of seven segments are mostly in digital calculators, electronic meters,
digital clocks, odometers, digital clocks, clock radios, etc.
 Today most of the 7 segment applications are using LCDs, because of low current
consumption.

3 INTRODUCTION TO PYTHON PROGRAMMING


3.1 Introduction
Python is an open source, high-level programming language developed by Guido van
Rossum in the late 1980s and presently administered by Python Software Foundation. It came
from the ABC language that he helped create early on in his career. Python is a powerful
language that you can use to create games, write GUIs, and develop web applications. It is a
high-level language. Reading and writing codes in Python is much like reading and writing
regular English statements. Because they are not written in machine-readable language,
Python programs need to be processed before machines can run them. Python is an
interpreted language. This means that every time a program is run, its interpreter runs through
the code and translates it into machine-readable byte code. Python is an object-oriented
language that allows users to manage and control data structures or objects to create and run
programs. Everything in Python is, in fact, first class. All objects, data types, functions,
methods, and classes take equal position in Python. Programming languages are created to
satisfy the needs of programmers and users for an effective tool to develop applications that
impact lives, lifestyles, economy, and society. They help make lives better by increasing
productivity, enhancing communication, and improving efficiency. Languages die and
become obsolete when they fail to live up to expectations and are replaced and superseded by
languages that are more powerful. Python is a programming language that has stood the test
of time and has remained relevant across industries and businesses and among programmers,
and individual users. It is a living, thriving, and highly useful language that is highly
recommended as a first programming language for those who want to dive into and
experience programming.

Advantages of Using Python

Here are reasons why you would prefer to learn and use Python over other high level
languages:

 Readability

Python programs use clear, simple, and concise instructions that are easy to read even by
those who have no substantial programming background. Programs written in Python are,
therefore, easier to maintain, debug, or enhance.

 Higher productivity

Codes used in Python are considerably shorter, simpler, and less verbose than other highlevel
programming languages such as Java and C++. In addition, it has well-designed built-in
features and standard library as well as access to third party modules and source libraries.
These features make programming in Python more efficient.

 Less learning time

Python is relatively easy to learn. Many find Python a good first language for learning
programming because it uses simple syntax and shorter codes.

 Runs across different platforms

Python works on Windows, Linux/UNIX, Mac OS X, other operating systems and smallform
devices. It also runs on microcontrollers used in appliances, toys, remote controls, embedded
devices, and other similar devices.

3.2 PROGRAMS

3.2.1 Program for blinking of LED


import Rpi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BOARD)

GPIO.setup(5,GPIO.OUT)

while true:

GPIO.output(5,1)

time.sleep(1)

GPIO.output(5,0)

time.sleep(1)

3.2.1 Program for relay switch


import RPi.GPIO as GPIO

import time

relay=3

GPIO.setmode(GPIO.BOARD)

GPIO.setup(relay,GPIO.OUT)

while 1:

GPIO.output(relay,0)

time.sleep(1)

GPIO.output(relay,1)

time.sleep(1)

3.2.3 Program on seven segment display


import RPi.GPIO as GPIO

import time

a=3

b=5

c=7

d=11

e=13

f=15
g=18

h=19

GPIO.setwarnings(False)

Gpio.setmode (GPIO.BOARD)

GPIO.setup(a,GPIO.OUT)

GPIO.setup(b,GPIO.OUT)

GPIO.setup(c,GPIO.OUT)

GPIO.setup(d,GPIO.OUT)

GPIO.setup(e,GPIO.OUT)

GPIO.setup(f,GPIO.OUT)

GPIO.setup(g,GPIO.OUT)

GPIO.setup(h,GPIO.OUT)

def segment(a1,b1,c1,d1,e1,f1,g1,h1):

GPIO.output(a,a1)

GPIO.output(b,b1)

GPIO.output(c,c1)

GPIO.output(d,d1)

GPIO.output(e,e1)

GPIO.output(f,f1)

GPIO.output(g,g1)

GPIO.output(h,h1)

time.sleep(1)

while 1:

segment(1,1,1,1,1,1,0,0) #0

segment(0,1,1,0,0,0,0,0) #1

segment(1,1,0,1,1,0,1,0) #2

segment(1,1,1,1,0,0,1,0) #3

segment(0,1,1,0,0,1,1,0) #4
segment(1,0,1,1,0,1,1,0) #5

segment(1,0,1,1,1,1,1,0) #6

segment(1,1,1,0,0,0,0,0) #7

segment(1,1,1,1,1,1,1,0) #8

segment(1,1,1,1,0,1,1,0) #9

segment(1,1,1,0,1,1,1,0) #A

segment(0,0,1,1,1,1,1,0) #b

segment(1,0,0,1,1,1,0,0) #C

segment(0,1,1,1,1,0,1,0) #d

segment(1,0,0,1,1,1,1,0) #E

segment(1,0,0,0,1,1,1,0) #F

bluetooth

import RPi.GPIO as GPIO

import time

import serial

GPIO.setmode(GPIO.BOARD)

data=serial.Serial('/dev/ttyS0 ,9600)

while 1:

a=data.read(5)

print a

time.sleep(0.5)

3.2.4 Program on LCD display


import RPi.GPIO as GPIO

import time

rs=3

en=5

d4=7

d5=8
d6=10

d7=11

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(rs,GPIO.OUT)

GPIO.setup(en,GPIO.OUT)

GPIO.setup(d4,GPIO.OUT)

GPIO.setup(d5,GPIO.OUT)

GPIO.setup(d6,GPIO.OUT)

GPIO.setup(d7,GPIO.OUT)

def toggle_en():

GPIO.output(en,1)

time.sleep(0.1)

GPIO.output(en,0)

time.sleep(0.1)

def lcd_data(bits):

GPIO.output(rs,1)

GPIO.output(d4,0)

GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x10 == 0x10:

GPIO.output(d4,1)

if bits & 0x20 == 0x20:

GPIO.output(d5,1)

if bits & 0x40 == 0x40:

GPIO.output(d6,1)
if bits & 0x80 == 0x80:

GPIO.output(d7,1)

toggle_en()

GPIO.output(d4,0)

GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x01 == 0x01:

GPIO.output(d4,1)

if bits & 0x02 == 0x02:

GPIO.output(d5,1)

if bits & 0x04 == 0x04:

GPIO.output(d6,1)

if bits & 0x08 == 0x08:

GPIO.output(d7,1)

toggle_en()

def lcd_cmd(bits):

GPIO.output(rs,0)

GPIO.output(d4,0)

GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x10 == 0x10:

GPIO.output(d4,1)

if bits & 0x20 == 0x20:

GPIO.output(d5,1)

if bits & 0x40 == 0x40:

GPIO.output(d6,1)
if bits & 0x80 == 0x80:

GPIO.output(d7,1)

toggle_en()

GPIO.output(d4,0)

GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x01 == 0x01:

GPIO.output(d4,1)

if bits & 0x02 == 0x02:

GPIO.output(d5,1)

if bits & 0x04 == 0x04:

GPIO.output(d6,1)

if bits & 0x08 == 0x08:

GPIO.output(d7,1)

toggle_en()

def lcd_init():

lcd_cmd(0x33)

lcd_cmd(0x32)

lcd_cmd(0x28)

lcd_cmd(0x0F)

lcd_cmd(0x06)

lcd_cmd(0x01)

def lcd_str(s):

for i in range (len(s)):

lcd_data(ord(s[i]))

'''while 1:

lcd_init()
lcd_str("hassan")

'''

3.2.5 Program to print custom custom character display on LCD


import RPi.GPIO as GPIO

import time

rs=3

en=5

d4=7

d5=8

d6=10

d7=11

GPIO.setwarnings(False)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(rs,GPIO.OUT)

GPIO.setup(en,GPIO.OUT)

GPIO.setup(d4,GPIO.OUT)

GPIO.setup(d5,GPIO.OUT)

GPIO.setup(d6,GPIO.OUT)

GPIO.setup(d7,GPIO.OUT)

def toggle_en():

GPIO.output(en,1)

time.sleep(0.1)

GPIO.output(en,0)

time.sleep(0.1)

def lcd_data(bits):

GPIO.output(rs,1)

GPIO.output(d4,0)
GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x10 == 0x10:

GPIO.output(d4,1)

if bits & 0x20 == 0x20:

GPIO.output(d5,1)

if bits & 0x40 == 0x40:

GPIO.output(d6,1)

if bits & 0x80 == 0x80:

GPIO.output(d7,1)

toggle_en()

GPIO.output(d4,0)

GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x01 == 0x01:

GPIO.output(d4,1)

if bits & 0x02 == 0x02:

GPIO.output(d5,1)

if bits & 0x04 == 0x04:

GPIO.output(d6,1)

if bits & 0x08 == 0x08:

GPIO.output(d7,1)

toggle_en()

def lcd_cmd(bits):

GPIO.output(rs,0)

GPIO.output(d4,0)
GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x10 == 0x10:

GPIO.output(d4,1)

if bits & 0x20 == 0x20:

GPIO.output(d5,1)

if bits & 0x40 == 0x40:

GPIO.output(d6,1)

if bits & 0x80 == 0x80:

GPIO.output(d7,1)

toggle_en()

GPIO.output(d4,0)

GPIO.output(d5,0)

GPIO.output(d6,0)

GPIO.output(d7,0)

if bits & 0x01 == 0x01:

GPIO.output(d4,1)

if bits & 0x02 == 0x02:

GPIO.output(d5,1)

if bits & 0x04 == 0x04:

GPIO.output(d6,1)

if bits & 0x08 == 0x08:

GPIO.output(d7,1)

toggle_en()

def lcd_init():

lcd_cmd(0x33)

lcd_cmd(0x32)
lcd_cmd(0x28)

lcd_cmd(0x0F)

lcd_cmd(0x06)

lcd_cmd(0x01)

def lcd_str(s):

for i in range (len(s)):

lcd_data(ord(s[i]))

def lcd_custom():

lcd_cmd(64)

lcd_data(0)

lcd_data(2)

lcd_data(14)

lcd_data(4)

lcd_data(31)

lcd_data(10)

lcd_data(10)

lcd_data(4)

lcd_data(0x80)

lcd_data(0)

lcd_cmd(72)

lcd_data(0)

lcd_data(2)

lcd_data(14)

lcd_data(1)

lcd_data(25)

lcd_data(21)

lcd_data(21)
lcd_data(22)

lcd_data(0x81)

lcd_data(1)

lcd_cmd(80)

lcd_data(0)

lcd_data(2)

lcd_data(14)

lcd_data(17)

lcd_data(19)

lcd_data(21)

lcd_data(21)

lcd_data(10)

lcd_data(0x82)

lcd_data(2)

lcd_cmd(88)

lcd_data(0)

lcd_data(0)

lcd_data(0)

lcd_data(13)

lcd_data(18)

lcd_data(13)

lcd_data(0)

lcd_data(0)

lcd_data(0xC1)

lcd_data(3)
#while 1:

lcd_init()

lcd_custom()

3.2.6 Program to print temperature and humidity on LCD


import RPi.GPIO as GPIO

import time

import Adafruit_DHT

while 1:

h,t=Adafruit_DHT.read_retry(11,4)

print "humidity=",h,"%,temperature=",t,"degree Celcius"

3.2.7 Program to vary speed of motor depending on


ultrasonic values
import RPi.GPIO as GPIO

import time

trig=3

echo=5

in1=7

in2=8

GPIO.setmode(GPIO.BOARD)

GPIO.setup(trig,GPIO.OUT)

GPIO.setup(echo,GPIO.IN,pull_up_down=GPIO.PUD_UP)

GPIO.setup(in1,GPIO.OUT)

GPIO.setup(in2,GPIO.OUT)

min1=GPIO.PWM(in1,100)

min2=GPIO.PWM(in2,100)

min1.start(0)

min2.start(0)

while 1:
GPIO.output(trig,1)

time.sleep(0.1)

GPIO.output(trig,0)

start=time.time()

while GPIO.input(echo) ==0:

start=time.time()

while GPIO.input(echo) ==1:

stop=time.time()

elapsed=stop-start

distance=elapsed*34300/2

print "Distance =",distance

if distance>50:

GPIO.output(in1,0)

GPIO.output(in2,1)

time.sleep(0.5)

elif distance>50 and distance<30:

# GPIO.output(in1,0)

for i in range(20):

min2.ChangeDutyCycle(i)

time.sleep(0.05)

time.sleep(0.5)

elif distance<30 and distance>10:

# GPIO.output(in1,0)

for i in range(50):

min2.ChangeDutyCycle(i)

time.sleep(0.05)

time.sleep(0.5)

elif distance<10 and distance>5:


GPIO.output(in1,0)

GPIO.output(in2,0)

elif distance<5:

# GPIO.output(in2,0)

for i in range (50):

min1.ChangeDutyCycle(i)

time.sleep(0.05)

time.sleep(0.5)

3.2.8 Program on RFID


import RPi.GPIO as GPIO

import time

import serial

ser=serial.Serial('/dev/ttyS0' ,baudrate=9600)

while 1:

time.sleep(0.02)

a=ser.readline()

time.sleep(0.02)

print a

time.sleep(0.5)

3.2.9 Program on Bluetooth


import RPi.GPIO as GPIO

import time

import serial

GPIO.setmode(GPIO.BOARD)

data=serial.Serial('/dev/ttyS0 ,9600)

while 1:

a=data.read(5)

print a
time.sleep(0.5)

3.2.10 Program on GPS


import RPi.GPIO as GPIO

import time

import serial

link1="https://www.google.co.in/maps?q=loc"

data=serial.Serial('/dev/ttyS0' ,9600)

def gps():

a=data.readline()

# print a

b=a.split(",")

if b[0]=='$GPRMC':

print b

if b[2]=='A':

lat=float(b[3])

lat_a=int(lat/100)

lat_b=lat_a*100

lat_gps=((lat-lat_b)/60)+lat_a

if b[4]=='N':

lon=float(b[5])

lon_a=int(lon/100)

lon_b=lon_a*100

lon_gps=((lon-lon_b)/60)+lon_a

link2='%s,%s'%(lat_gps,lon_gps)

link='%s%s'%(link1,link2)

print link

while 1:

gps()
3.2.11 Program on GSM
import RPi.GPIO as GPIO

import time

import serial

data=serial.Serial('/dev/ttyS0' ,9600)

def msg():

data.write('AT\r')

time.sleep(1)

data.write('AT+CMGF=1\R')

time.sleep(1)

data.write('AT+CMGS="7829070662"\r')

time.sleep(1)

data.write('Hello\r')

time.sleep(1)

data.write('\x1A')

time.sleep(10)

msg()

GPS_GSM
import RPi.GPIO as GPIO

from time import sleep

import serial

link1='https://www.google.com/maps?q=loc:'

relay=3

list=[]

data=serial.Serial('/dev/ttys0',baudrate=9600)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(relay,GPIO.OUT)
def gps()

print "Getting GPS...."

while 1:

a=data.readline()

print a

b=a.split(",")

if b[0]=='$GPRMC':

break

print b

if b[2]=='A':

lat=float(b[3])

lat_a=int(lat/100)

lat_b=lat_a*100

lat_gps=((lat-lat_b)/60)+lat_a

list.append(lat_gps)

if b[4]=='N':

lon=float(b[5])

lon_a=int(lon/100)

lon_b=lon_a*100

lon_gps=((lon-lon_b)/60)+lon_a

list.append(lon_gps)

link2="%s,%s"%(lat_gps,lon_gps)

link="%s%s"%(link1,link2)

print "Latitude=",lat_gps,"Longitude=",lon_gps

print list

return link

def gsm(gps_link):

print "Sending..."
data.write('AT\r')

sleep(1)

data.write('AT+CMGF=1\r')

sleep(1)

data.write('AT+CMGS="9844087241"\r')

sleep(1)

'''data.write('Latitude=')

data.write(str(list[0]))

data.write('Longitude=')

data.write(str(list[1]))

data.write('\r')'''

data.write(gps_link)

data.write('\r')

sleep(1)

data.write('\x1A')

sleep(10)

print"Message sent"

GPIO.output(relay,1)

gps_link=gps()

GPIO.output(relay,0)

gsm(gps_link)

You might also like