Professional Documents
Culture Documents
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.
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
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.
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.
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.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
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
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.
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
>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.
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.
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.
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
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
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
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
Applications
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)
Applications
Light switch controller
Remote data logger
Trusted device management
Used as a remote host
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.
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.
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.
Python is relatively easy to learn. Many find Python a good first language for learning
programming because it uses simple syntax and shorter codes.
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
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)
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)
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 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)
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)
GPIO.output(d4,1)
GPIO.output(d5,1)
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)
GPIO.output(d4,1)
GPIO.output(d5,1)
GPIO.output(d6,1)
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)
GPIO.output(d4,1)
GPIO.output(d5,1)
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)
GPIO.output(d4,1)
GPIO.output(d5,1)
GPIO.output(d6,1)
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):
lcd_data(ord(s[i]))
'''while 1:
lcd_init()
lcd_str("hassan")
'''
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)
GPIO.output(d4,1)
GPIO.output(d5,1)
GPIO.output(d6,1)
GPIO.output(d7,1)
toggle_en()
GPIO.output(d4,0)
GPIO.output(d5,0)
GPIO.output(d6,0)
GPIO.output(d7,0)
GPIO.output(d4,1)
GPIO.output(d5,1)
GPIO.output(d6,1)
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)
GPIO.output(d4,1)
GPIO.output(d5,1)
GPIO.output(d6,1)
GPIO.output(d7,1)
toggle_en()
GPIO.output(d4,0)
GPIO.output(d5,0)
GPIO.output(d6,0)
GPIO.output(d7,0)
GPIO.output(d4,1)
GPIO.output(d5,1)
GPIO.output(d6,1)
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):
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()
import time
import Adafruit_DHT
while 1:
h,t=Adafruit_DHT.read_retry(11,4)
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()
start=time.time()
stop=time.time()
elapsed=stop-start
distance=elapsed*34300/2
if distance>50:
GPIO.output(in1,0)
GPIO.output(in2,1)
time.sleep(0.5)
# GPIO.output(in1,0)
for i in range(20):
min2.ChangeDutyCycle(i)
time.sleep(0.05)
time.sleep(0.5)
# GPIO.output(in1,0)
for i in range(50):
min2.ChangeDutyCycle(i)
time.sleep(0.05)
time.sleep(0.5)
GPIO.output(in2,0)
elif distance<5:
# GPIO.output(in2,0)
min1.ChangeDutyCycle(i)
time.sleep(0.05)
time.sleep(0.5)
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)
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)
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
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()
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)