Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Nowadays Women Safety is the biggest concern in many parts of the world.
There is still a fear in alone areas for women as well as men. So here we
propose a security patrolling robot using Raspberry PI. The system uses
cameras and mic mounted on robotic vehicle for securing any premises. The
robotic vehicle moves at particular path and is equipped with camera and
sound sensors. It uses a predefined line to follow its path while patrolling. It
stops at particular points and moves to next points if sound is detected. The
system uses IR based path following system for patrolling assigned area. It
monitors each area to detect any problem using combination of two HD
cameras. It has the ability to monitor sound in the premises.
Robot hears Any sound after area is quite and it starts moving towards the
sound on its predefined path. It then scans the area using its camera to
detect any human faces detected. It captures and starts transmitting the
images of the situation immediately to the IOT website. Here we use IOT
gecko for receiving transmitted images and displaying them to user with alert
sounds. Thus we put forward a fully autonomous security robot that operates
tirelessly and patrols large areas on its own to secure the facility
iii
CONTENTS
Page no’s
Acknowledgement i
Declaration ii
Abstract iii
List of Figures iv
List of Tables v
List of Abbreviations vi
3.1.2 Specifications
3.1.3 Connectors
3.3 Specifications 19
3.5 Accessories 22
3.7 Transformer 25
3.8 Rectifier 26
3.9.1 Operation
3.10 Filter 28
3.12 Regulator
3.13 78XX 30
3.16 Camera
3.17.1 Introduction 37
3.18 DC Motor 40
3.19 H - Bridge 43
3.19.2 Implementation 46
3.20 L293D
4.1 Raspberry pi OS 53
4.2.1 Processing 64
4.3 QT creator 69
4.3.1 Introduction
CHAPTER 6 : Conclusion 83
CHAPTER 7 : Reference 84
LIST OF FIGURES
Page no’s
iv
LIST OF TABLES
Page no’s
v
ABBREVIATIONS
vi
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
CHAPTER 1: INTRODUCTION
Nowadays Women Safety is the biggest concern in many parts of the world. There is
still a fear in alone areas for women as well as men. So here we propose a security
patrolling robot using Raspberry PI. The system uses cameras and mic mounted on
robotic vehicle for securing any premises. The robotic vehicle moves at particular
path and is equipped with camera. It uses a predefined line to follow its path while
patrolling. It stops at particular points and moves to next points if image is detected.
The system uses IR based path following system for patrolling assigned area. It
monitors each area to detect any problem using combination of two HD cameras..
Robot starts moving towards on its predefined path. It then scans the area using its
camera to detect any human faces detected. It captures and starts transmitting the
images of the situation immediately to the IOT website. Here we use IOT gecko for
receiving transmitted images and displaying them to user with alert sounds. Thus we
put forward a fully autonomous security robot that operates tirelessly and patrols large
areas on its own to secure the facility.
Hardware Specifications
• Raspberry Pi 3
• HC-SR04 Ultrasonic
• DC Motor
• Robotic Chassis
• IC ,Resistors ,Capacitors ,Transistor Diodes
• PCB – Buy PCB & Breadboards Online LED’s
• Push Button
• switches
Software Specifications
• Python MC Programming Language: C IOTGecko
Page No 1
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Page No 2
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
• Handheld calculators
• Handheld computers
• Medical equipment
• Videogame consoles
Page No 3
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Power
supply
IOT
camera
LCD
Display
GSM
Page No 4
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Micro controller: This section forms the control unit of the whole project. This
section basically consists of a Micro controller with its associated circuitry like
Crystal with capacitors, Reset circuitry, Pull up resistors (if needed) and so on. The
Micro controller forms the heart of the project because it controls the devices being
interfaced and communicates with the devices according to the program being written.
Driver circuit: L293D is a dual H-bridge motor driver integrated circuit (IC).
Motor drivers act as current amplifiers since they take a low-current control signal
and provide a higher-current signal. This higher current signal is used to drive the
motors.
Motor: motor is an output for this project. And DC motor is connected to micro
controller. And this motor controlled by the micro controller with the respective inputs
given by us. Its speed will be varied according to the speed set by the switches.
LCD Display: This section is basically meant to show up the status of the project.
This project makes use of Liquid Crystal Display to display / prompt for necessary
information.
GSM : GSM (Global System for Mobile communications) is the technology that
underpins most of the world's mobile phone networks. The GSM platform is a hugely
successful wireless technology and an unprecedented story of global achievement and
cooperation.
Page No 5
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
GSM has become the world's fastest growing communications technology of all time
and the leading global mobile standard, spanning 218 countries. GSM is an open,
digital cellular technology used for transmitting mobile voice and data services. GSM
operates in the 900MHz and 1.8GHz bands GSM supports data transfer speeds of up
to 9.6 kbps, allowing the transmission of basic data services such as SMS.
In this project we required operating voltage for controller board is 5V. Hence the 5V
D.C. power supply is needed for the board . This regulated 5V is generated by
stepping down the voltage from 230V to 18V now the step downed a.c voltage is
being rectified by the Bridge Rectifier using 1N4007 diodes.
Page No 6
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The rectified a.c voltage is now filtered using a ‘C’ filter. Now the rectified, filtered
D.C. voltage is fed to the Voltage Regulator. This voltage regulator provides/allows us
to have a Regulated constant Voltage which is of +5V. The rectified; filtered and
regulated voltage is again filtered for ripples using an electrolytic capacitor 100µF.
Now the output from this section is fed to microcontroller board to supply operating
voltage.
Page No 7
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
In the existing system, robot has to control remotely where the person has to monitor
the area using remote but manually controlling and the more Human more is required
to implement this system.
Page No 8
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Page No 9
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The Raspberry Pi 2 delivers 6 times the processing capacity of previous models. This
second generation Raspberry Pi has an upgraded BroadcomBCM2836 processor,
which is a powerful ARM Cortex-A7 based quad-core processor that runs at 900MHz.
The board also features an increase in memory capacity to 1Gbyte.
3.1.2 Specifications
GPU : Dual Core Video Core IV® Multimedia Co-
Processor
3.1.3 Connectors
Page No 10
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Display Connector : Display Serial Interface (DSI) 15 way flat flex cable
connector with two data lanes and a clock lane
GPIO
BCM283x has in total 54 GPIO lines in 3 separate voltage banks. All GPIO pins have
at least two alternative functions within the SoC. When not used for the alternate
peripheral function, each GPIO pin may be set as an input (optionally as an interrupt)
or an output. The alternate functions are usually peripheral I/Os, and most peripherals
appear twice to allow flexibility on the choice of I/O voltage. On CM1, CM3 and
CM3L bank2 is used on the module to connect to the eMMC device and, on CM3 and
CM3L, for an on-board I2C bus (to talk to the core SMPS and control the special
function pins). On CM3L most of bank 2 is exposed to allow a user to connect their
choice of SD card or eMMC device (if required). Bank0 and 1 GPIOs are available
for general use. GPIO0 to GPIO27 are bank 0 and GPIO28-45 make up bank1.
GPIO0-27 VDD is the power supply for bank0 and GPIO28-45 VDD is the power
supply for bank1. SDX VDD is the supply for bank2 on CM3L. These supplies can be
in the range 1.8V-3.3V (see Table 7) and are not optional; each bank must be
powered, even when none of the GPIOs for that bank are used.
SD/SDIO Interface:
Page No 11
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The first (SD0) is a proprietary Broadcom controller that does not support SDIO and
is the primaryinterface used to boot and talk to the eMMC or SDX x signals. The
second interface (SD1) is standards compliant and can interface to SD, SDIO and
eMMC devices; for example on a Raspberry Pi 3 it is used to talk to the on-board
BCM43438 WiFi device in SDIO mode. Both interfaces can support speeds up to
50MHz single ended (SD High Speed Mo
Currently the CSI interface is not openly documented and only CSI camera sensors
supported by the official Raspberry Pi firmware will work with this interface.
Supported sensors are the OmniVision OV5647 and Sony IMX219. It is
recommended to attach other cameras via USB
Currently the DSI interface is not openly documented and only DSI displays
supported by the official Raspberry Pi firmware will work with this interface.
USB
The BCM283x USB port is On-The-Go (OTG) capable. If using either as a fixed
slave or fixed master, please tie the USB OTGID pin to ground. The USB port (Pins
USB DP and USB DM) must be routed as 90 ohm differential PCB traces.
HDMI
Page No 12
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Page No 13
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
2) Power source:
The Pi is a device which consumes 700mA or 3W or power. It is powered by a
MicroUSB charger or the GPIO header. Any good smartphone charger will do
the work of powering the Pi.
3) SD Card :
The Raspberry Pi does not have any onboard storage available. The operating
system is loaded on a SD card which is inserted on the SD card slot on the
Raspberry Pi. The operating system can be loaded on the card using a card
reader on any computer.
GPIO pins have no special purpose defined, and go unused by default. The idea is that
sometimes the system designer building a full system that uses the chip might find it
useful to have a handful of additional digital control lines, and having these available
from the chip can save the hassle of having to arrange additional circuitry to provide
them.
• Input values can often be used as IRQs (typically for wakeup events)
The production Raspberry Pi board has a 26-pin 2.54 mm (100 mil) expansion
header, marked as P1, arranged in a 2x13 strip.
Page No 14
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
6) RCA Video:
RCA Video outputs (PAL and NTSC) are available on all models of Raspberry
Pi. Any television or screen with a RCA jack can be connected with the RPi.
Page No 15
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
7) Audio Jack:
A standard 3.5 mm TRS connector is available on the RPi for stereo audio output.
Any headphone or 3.5mm audio cable can be connected directly. Although this jack
cannot be used for taking audio input, USB mics or USB sound cards can be used.
8) Status LEDs:
There are 5 status LEDs on the RPi that show the status of various activities as
follows:
“OK” - SDCard Access (via GPIO16) - labelled as "OK" on Model B Rev1.0 boards
and "ACT" on Model B Rev2.0 and Model A boards
Page No 16
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
USB 2.0 ports are the means to connect accessories such as mouse or keyboard to the
Raspberry Pi. There is 1 port on Model A, 2 on Model B and 4 on Model B+. The
number of ports can be increased by using an external powered USB hub which is
available as a standard Pi accessory.
10) Ethernet:
Page No 17
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
11)CSI connector:
CSI – Camera Serial Interface is a serial interface designed by MIPI (Mobile Industry
Processor Interface) alliance aimed at interfacing digital cameras with a mobile
processor. The RPi foundation provides a camera specially made for the Pi which can
be connected with the Pi using the CSI connector.
JTAG is an acronym for ‘Joint Test Action Group', an organisation that started back in
the mid 1980's to address test point access issues on PCB with surface mount devices.
The organisation devised a method of access to device pins via a serial port that
became known as the TAP (Test Access Port). In 1990 the method became a
recognised international standard (IEEE Std 1149.1). Many thousands of devices now
include this standardised port as a feature to allow test and design engineers to access
pins.
13) HDMI:
HDMI 1.3 a type A port is provided on the RPi to connect with HDMI screens.
Page No 18
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.3 Specifications:
Model B Model B+
Model A
Memory 256 MB
512MB (shared with GPU)
(SDRAM) (shared with
as of 15 October 2012
: GPU)
1 (direct
USB 2.0 2 (via the on- 4 (via the on-
from
ports: board 3-port board 5-port
BCM2835
USB hub) USB hub)
chip)
15-pin MIPIcamera interface (CSI)
Video connector, used with the Raspberry Pi
input: Camera Addon.
Composite RCA (PAL and NTSC) –in
Video model B+ via 4-pole 3.5 mm jack, HDMI
outputs: (rev 1.3 & 1.4), raw LCD Panels via DS
3.5 mm jack, HDMI, and, as of revision 2
Audio boards, I2S audio (also potentially for
outputs: audio input)
10/100 Mbit/sEthernet
Onboard None (8P8C) USB adapter on the
network: third/fifth port of the USB
hub
8× GPIO, UART, I2C bus,
Low-level
SPI bus with two chip
peripheral selects, I2S audio +3.3 V,
17× GPIO
s: +5 V, ground
Weight:
45 g (1.6 oz)
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Since smartphones and tablets are basically smaller computers, they require pretty
much the same components we see in desktops and laptops in order to offer us all the
amazing things they can do (apps, music and video playing, 3D gaming support,
advanced wireless features, etc).
But smartphones and tablets do not offer the same amount of internal space as
desktops and laptops for the various components needed such as the logic board, the
processor, the RAM, the graphics card, and others. That means these internal parts
need to be as small as possible, so that device manufacturers can use the remaining
space to fit the device with a long-lasting battery life.
A system on a chip or system on chip (SoC or SOC) is an integrated circuit (IC) that
integrates all components of a computer or other electronic system into a single chip.
It may contain digital, analog, mixed-signal, and often radio-frequency functions—all
on a single chip substrate. SoCs are very common in the mobile electronics market
because of their low power consumption. A typical application is in the area of
embedded systems.
The contrast with a micro controller is one of degree. Micro controllers typically have
under 100 kB of RAM (often just a few kilobytes) and often really are single- chip-
systems, whereas the term SoC is typically used for more powerful processors,
capable of running software such as the desktop versions of Windows and Linux,
which need external memory chips (flash, RAM) to be useful, and which are used
with various external peripherals. In short, for larger systems, the term system on a
chip is a hyperbole, indicating technical direction more than reality:
Page No 21
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
• memory blocks including a selection of ROM, RAM, EEPROM and flash memory
• A bus - either proprietary or industry-standard such as the AMBA bus from ARM
Holdings - connects these blocks. DMA controllers route data directly between
external interfaces and memory, bypassing the processor core and thereby
increasing the data throughput of the SoC
3.5 Accessories
around the world. Thus it has a large user base. Many enthusiasts have created
accessories and peripherals for the Raspberry Pi.
Page No 22
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
This range from USB hubs, motor controllers to temperature sensors. There are
some official accessories for the RPi as follows:
Page No 23
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
accessory for the Pi. A powered USB Hub with 7 extra ports is available at almost all
online stores. It is compulsory to use a USB Hub to connect external hard disks or
other accessories that draw power from the USB
Page No 24
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.7 Transformer:
Transformers convert AC electricity from one voltage to another with little loss of
power. Transformers work only with AC and this is one of the reasons why mains
electricity is AC. Step-up transformers increase in output voltage, step-down
transformers decrease in output voltage. The input coil is called the primary and the
output coil is called the secondary. The two lines in the middle of the circuit symbol
represent the core. Transformers waste very little power so the power out is (almost)
equal to the power in. Note that as voltage is stepped down current is stepped up. The
ratio of the number of turns on each coil, called the turn’s ratio, determines the ratio of
the voltages. A step-down transformer has a large number of turns on its primary
(input) coil which is connected to the high voltage mains supply, and a small number
of turns on its secondary (output) coil to give a low output voltage.
VS X IS=VP X IP
Page No 25
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.8 Rectifier:
A circuit, which is used to convert a.c to dc, is known as RECTIFIER. The process of
conversion a.c to d.c is called “rectification”
3.9 Bridge Rectifier: A bridge rectifier makes use of four diodes in a bridge
arrangement to achieve full-wave rectification. This is a widely used configuration,
both with individual diodes wired as shown and with single component bridges where
the diode bridge is wired internally.
A bridge rectifier makes use of four diodes in a bridge arrangement as shown in fig(a)
to achieve full-wave rectification. This is a widely used configuration, both with
individual diodes wired as shown and with single component bridges where the diode
bridge is wired internally.
3.9.1 Operation:
During positive half cycle of secondary, the diodes D2 and D3 are in forward biased
while D1 and D4 are in reverse biased as shown in the fig(b). The current flow
direction is shown in the fig (b) with dotted arrows.
Page No 26
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward
biased while D2 and D3 are in reverse biased as shown in the fig(c). The current flow
direction is shown in the fig (c) with dotted arrows.
Page No 27
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.10 Filter:
A Filter is a device, which removes the a.c component of rectifier output but allows
the d.c component to reach the load.
We have seen that the ripple content in the rectified output of half wave rectifier is
121% or that of full-wave or bridge rectifier or bridge rectifier is 48% such high
percentages of ripples is not acceptable for most of the applications. Ripples can be
removed by one of the following methods of filtering:
(a) A capacitor, in parallel to the load, provides an easier by –pass for the ripples
voltage though it due to low impedance. At ripple frequency and leave the d.c.to
appears the load.
(b) An inductor, in series with the load, prevents the passage of the ripple current
(due to high impedance at ripple frequency) while allowing the d.c (due to low
resistance to d.c)
(c) various combinations of capacitor and inductor, such as L-section filter section
filter, multiple section filter etc. which make use of both the properties mentioned in
(a) and (b) above. Two cases of capacitor filter, one applied on half wave rectifier and
another with full wave rectifier.
Page No 28
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Where,
f = supply frequency,
r = ripple factor, Rl = load resistance
Note: In our circuit we are using 1000microfarads.
3.12 Regulator:
Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable
output voltages. The maximum current they can pass also rates them. Negative
voltage regulators are available, mainly for use in dual supplies. Most regulators
include some automatic protection from excessive current ('overload protection') and
overheating ('thermal protection'). Many of the fixed voltage regulator ICs have 3
leads and look like power transistors, such as the 7805 +5V 1A regulator shown on
the right.
The LM7805 is simple to use. You simply connect the positive lead of your
unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin,
connect the negative lead to the Common pin and then when you turn on the power,
you get a 5 volt supply from the output pin.
Page No 29
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.13 78XX:
The Bay Linear LM78XX is integrated linear positive regulator with three terminals.
The LM78XX offer several fixed output voltages making them useful in wide range
of applications. When used as a zener diode/resistor combination replacement, the
LM78XX usually results in an effective output impedance improvement of two orders
of magnitude, lower quiescent current. The LM78XX is available in the TO-252,
TO-220 & TO-263packages,
Features:
An LCD consists of two glass panels, with the liquid crystal material sand
witched in between them. The inner surface of the glass plates are coated with
transparent electrodes which define the character, symbols or patterns to be displayed
polymeric layers are present in between the electrodes and the liquid crystal, which
makes the liquid crystal molecules to maintain a defined orientation angle.
Page No 30
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
One each polarisers are pasted outside the two glass panels. These polarisers would
rotate the light rays passing through them to a definite angle, in a particular direction.
When the LCD is in the off state, light rays are rotated by the two polarisers and
the liquid crystal, such that the light rays come out of the LCD without any
orientation, and hence the LCD appears transparent.
When sufficient voltage is applied to the electrodes, the liquid crystal molecules
would be aligned in a specific direction. The light rays passing through the LCD
would be rotated by the polarisers, which would result in activating/ highlighting the
desired characters.
The LCD’s are lightweight with only a few millimeters thickness. Since the LCD’s
consume less power, they are compatible with low power electronic circuits, and can
be powered for long durations.
The LCD’s don’t generate light and so light is needed to read the display. By using
backlighting, reading is possible in the dark. The LCD’s have long life and a wide
operating temperature range.
Changing the display size or the layout size is relatively simple which makes the
LCD’s more customers friendly.
The LCDs used exclusively in watches, calculators and measuring instruments are
the simple seven-segment displays, having a limited amount of numeric data. The
recent advances in technology have resulted in better legibility, more information
displaying capability and a wider temperature range. These have resulted in the LCDs
being extensively used in telecommunications and entertainment electronics. The
LCDs have even started replacing the cathode ray tubes (CRTs) used for the display of
text and graphics, and also in small TV applications.
Page No 31
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
. This section describes the operation modes of LCD’s then describe how to program
and interface an LCD to 8051 using Assembly and C.
2 Vcc --
+5V power
supply
VEE Power supply
3 -- to control
contrast
RS=0 to select
command
4 register
RS I
RS=1 to select
data register
Page No 32
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
R/W=0 for
5 R/W I write R/W=1
for read
6E I/O Enable
Page No 33
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
38
2 lines and 5x7 matrix
Uses:
The LCDs used exclusively in watches, calculators and measuring instruments are the
simple seven-segment displays, having a limited amount of numeric data.
The recent advances in technology have resulted in better legibility, more information
displaying capability and a wider temperature range.
These have resulted in the LCDs being extensively used in telecommunications and
entertainment electronics.
The LCDs have even started replacing the cathode ray tubes (CRTs) used for the
display of text and graphics, and also in small TV applications.
Page No 34
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
To send any command from table 2 to the LCD, make pin RS=0. For data, make
RS=1.Then send a high –to-low pulse to the E pin to enable the internal latch of the
LCD.
3.16 CAMERA:
A camera is a video camera that feeds or streams its image in real time to or through a
computer to a
Page No 35
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
computer network. When "captured" by the computer, the video stream may be saved,
viewed or sent on to other networks travelling through systems such as the internet,
and e- mailed as an attachment. When sent to a remote location, the video stream may
be saved, viewed or on sent there. Unlike an IP camera (which connects using
Ethernet or Wi-Fi), a webcam is generally connected by a USB cable, or similar cable,
or built into computer hardware, such as laptops.
The term "webcam" (a clipped compound) may also be used in its original sense of a
video camera connected to the Web continuously for an indefinite time, rather than for
a particular session, generally supplying a view for anyone who visits its web
pageover the Internet. Some of them, for example, those used as online traffic
cameras, are expensive, rugged professional video cameras.
Page No 36
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.17.1 Introduction
Modern security systems utilize various types of sensors to detect unauthorized object
access attempts. The sensor collection includes infrared, microwave and ultrasound
devices, which are intended to detect moving objects. Each type of sensor is
characterized by its own advantages and drawbacks. Microwave sensors are effective
in large apartments because microwaves pass through dielectric materials. But these
sensors consist of expensive super-high frequency components and their radiation is
unhealthy for living organisms.
Infrared sensors are characterized by high sensitivity, low cost and are widely used.
But, these sensors can generate false alarm signals if heating systems are active or
temperature change speed exceeds some threshold level. Moreover, infrared sensors
appreciably lose sensitivity if small insects penetrate the sensor lens. Ultrasound
motion detection sensors are characterized by small power consumption, suitable cost
and high sensitivity. That is why this kind of sensor is commonly used in home, office
and car security systems. Existing ultrasound sensors consist of multiple passive and
active components and are relatively complicated for production and testing. Sensors
often times require a laborious tuning process.
Page No 37
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The ultrasound transmitter TX is emitting ultrasound waves into sensor ambient space
continuously. These waves are reflecting from various objects and are reaching
ultrasound receiver RX. There is a constant interference figure if no moving objects
are in the placement.
Any moving object changes the level and phase of the reflected signal, which
modifies the summed received signal level. Most low cost sensors (car security
systems, for instance) perform reflected signal amplitude analysis to detect moving
objects. In spite of implementation simplicity, this detection method is characterized
by a high sensitivity to noise signals. For example, heterogeneous airflows, sensor
vibrations, room window and door deformations, and gusts can change the
interference figure and generate false alarm signals.
Better noise resistance may be obtained if they receive sensor is performing reflected
signal frequency analysis instead of amplitude examination. The reflected signal
spectrum emulates a Doppler Effect. Frequency components of the moving object
speed vector have a component in the direction of ultrasound radiation propagation.
Because ultrasound waves reflect from the windows, walls, furniture etc., the sensor
can detect object movements in any direction. To implement this principle, the sensor
must perform selection and processing of Doppler Effect frequency shift to detect
moving objects.
The air condition systems, heat generators, and refrigerators typically include
movable parts, which can cause device vibrations that generate high-frequency
Doppler components in the reflected ultrasound signal. The heterogeneous variable
temperature airflows are characterized by different ultrasound propagation speed that
can raise low-frequency Doppler components in the reflected signal. That is why the
noise resistant motion detection sensor should limit the Doppler signals’ frequency
range from lower and upper bounds to satisfactory false-alarm free operation.
Page No 38
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The modules includes ultrasonic transmitters, receiver and control circuit. The basic
principle of work:
5V Supply
Trigger Pulse Input
Echo Pulse Output
0V Ground
Electric Parameter
Working Voltage DC 5v
Working Current 15mA
Working Frequency 40Hz
Max Range 4m
Min Range 2cm
Measuring Angle 15 degree
Trigger Input Signal 10uS TTL pulse
Page No 39
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.18 DC Motor
DC motors are configured in many types and sizes, including brush less, servo and
gear motor types. A motor consists of a rotor and a permanent magnetic field stator.
The magnetic field is maintained using either permanent magnets or electromagnetic
windings.
DC motors are most commonly used in variable speed and torque.
Motion and controls cover a wide range of components that in some way are used to
generate and/or control motion. Areas within this category include bearings and
bushings, clutches and brakes, controls and drives, drive components, encoders and
resolves, Integrated motion control, limit switches, linear actuators, linear and rotary
motion components, linear position sensing, motors (both AC and DC motors),
orientation position sensing, pneumatics and pneumatic components, positioning
stages, slides and guides, power transmission (mechanical), seals, slip rings,
solenoids, springs.
Motors are the devices that provide the actual speed and torque in a drive system. This
family includes AC motor types (single and multiphase motors, universal, servo
motors, induction, synchronous, and gear motor) and DC motors (brush less, servo
motor, and gear motor) as well as linear, stepper and air motors, and motor contactors
and starters.
Page No 40
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Let's start by looking at a simple 2-pole DC electric motor (here red represents a
magnet or winding with a "North" polarization, while green represents a magnet or
winding with a "South" polarization).
Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator,
commutator, field magnet(s), and brushes. In most common DC motors (and all that
Beamers will see), the external magnetic field is produced by high-strength permanent
magnets1. The stator is the stationary part of the motor -- this includes the motor
casing, as well as two or more permanent magnet pole pieces. The rotor (together with
the axle and attached commutator) rotates with respect to the stator. The rotor consists
of windings (generally on a core), the windings being electrically connected to the
commutator. The above diagram shows a common motor layout -- with the rotor
inside the stator (field) magnets.
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
magnet(s) are misaligned, and the rotor will rotate until it is almost aligned with the
stator's field magnets. As the rotor reaches alignment, the brushes move to the next
commutator contacts, and energize the next winding.
Page No 41
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
In real life, though, DC motors will always have more than two poles (three is a very
common number). In particular, this avoids "dead spots" in the commutator. You can
imagine how with our example two-pole motor, if the rotor is exactly at the middle of
its rotation (perfectly aligned with the field magnets), it will get "stuck" there.
Meanwhile, with a two-pole motor, there is a moment where the commutator shorts
out the power supply (i.e., both brushes touch both commutator contacts
simultaneously). This would be bad for the power supply, waste energy, and damage
motor components as well. Yet another disadvantage of such a simple motor is that it
would exhibit a high amount of torque” ripple" (the amount of torque it could produce
is cyclic with the position of the rotor).
Fig 3.18.1 : Block Diagram of the DC motor having two poles only
So since most small DC motors are of a three-pole design, let's tinker with the
workings of one via an interactive animation (JavaScript required):
Page No 42
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
You'll notice a few things from this -- namely, one pole is fully energized at a time
(but two others are "partially" energized). As each brush transitions from one
commutator contact to the next, one coil's field will rapidly collapse, as the next coil's
field will rapidly charge up (this occurs within a few microsecond). We'll see more
about the effects of this later, but in the meantime you can see that this is a direct
result of the coil windings' series wiring:
There's probably no better way to see how an average dc motor is put together, than
by just opening one up. Unfortunately this is tedious work, as well as requiring the
destruction of a perfectly good motor. This is a basic 3-pole dc motor, with 2 brushes
and three commutator contacts.
3.19 H-BRIDGE:
at a time.
Page No 43
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The switches are turned on in pairs, either high left and lower right, or lower left and
high right, but never both switches on the same "side" of the bridge. If both switches
on one side of a bridge are turned on it creates a short circuit between the battery plus
and battery minus terminals. If the bridge is sufficiently powerful it will absorb that
load and your batteries will simply drain quickly. Usually however the switches in
question melt.
To power the motor, you turn on two switches that are diagonally opposed. In the
picture to the right, imagine that the high side left and low side right switches are
turned on.
Page No 44
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The current flows and the motor begins to turn in a "positive" direction. Turn on the
high side right and low side left switches, then Current flows the other direction
through the motor and the motor turns in the opposite direction.
Actually it is just that simple, the tricky part comes in when you decide what to use
for switches. Anything that can carry a current will work, from four SPST switches,
one DPDT switch, relays, transistors, to enhancement mode power MOSFETs.
One more topic in the basic theory section, quadrants. If each switch can be controlled
independently then you can do some interesting things with the bridge, some folks
call such a bridge a "four quadrant device" (4QD get it?). If you built it out of a single
DPDT relay, you can really only control forward or reverse. You can build a small
truth table that tells you for each of the switch's states, what the bridge will do. As
each switch has one of two states, and there are four switches, there are 16 possible
states. However, since any state that turns both switches on one side on is
"bad" (smoke issues forth: P), there are in fact only four useful states (the four
quadrants) where the transistors are turned on.
The last two rows describe a maneuver where you "short circuit" the motor which
causes the motors generator effect to work against itself. The turning motor generates
a voltage which tries to force the motor to turn the opposite direction. This causes the
motor to rapidly stop spinning and is called "braking" on a lot of H-bridge designs.
Of course there is also the state where all the transistors are turned off. In this case the
motor coasts freely if it was spinning and does nothing if it was doing nothing.
Page No 45
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3.19.2 Implementation
1. Using Relays:
Warning: Never turn on A and C or B and D at the same time. This will lead to a short
circuit of the battery and will lead to failure of the relays due to the large current.
Page No 46
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
2. Using Transistors:
We can better control our motor by using transistors or Field Effect Transistors
(FETs).Most of what we have discussed about the relays H-Bridge is true of these
circuits. See the diagram showing how they are connected. You should add diodes
across the transistors to catch the back voltage that is generated by the motor's coil
when the power is switched on and off.
This fly back voltage can be many times higher than the supply voltage! For
information on building an H-Bridge using Transistors, have a look here.
Warning: If you don't use diodes, you could burn out your transistors. Also the same
warning as in the diode case. Don't turn on A and C or B and D at the same time.
Transistors, being a semiconductor device, will have some resistance, which causes
them to get hot when conducting much current. This is called not being able to sink or
source very much power, i.e.: Not able to provide much current from ground or from
plus voltage.
Mosfets are much more efficient, they can provide much more current and not get as
hot. They usually have the fly back diodes built in so you don't need the diodes
anymore. This helps guard against fly back voltage frying your ICs.
To use Mosfets in an H-Bridge, you need P-Channel Mosfets on top because they can
"source" power, and N-Channel Mosfets on the bottom because then can "sink"
power.
It is important that the four quadrants of the H-Bridge circuits be turned on and off
properly. When there is a path between the positive and ground side of the H-Bridge,
other than through the motor, a condition exists called "shoot through". This is
basically a direct short of the power supply and can cause semiconductors to become
ballistic, in circuits with large currents flowing.
Page No 47
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The L293 has 2 H-Bridges (actually 4 Half H-Bridges), can provide about 1 amp to
each and occasional peak loads to 2 amps.
The L298 has 2 h-bridges on board, can handle 1amp and peak current draws to about
3amps. The LMD18200 has one h-bridge on board, can handle about 2 or 3 amps and
can handle a peak of about 6 amps. There are several more commercially designed H-
Bridge chips as well.
So you just give a High level when you want to turn the Half H-Bridge on and Low
level when you want to turn it off. When the Half H-Bridge is on, the voltage at the
output is equal to Vcc2.If you want to make a Full H-Bridge, you connect the motor
(or the load) between the outputs of two Half H-Bridges and the inputs will be the two
inputs of the Half H-Bridges.
Suppose we have connected Half H-Bridges 1 and 2 to form a Full H-Bridge. Now the
truth table is as follows:
Page No 48
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
INPUT
INPUT 1A 2A OUTPU
T 1Y OUTPU Description
T 2Y
Braking (both
L L L L terminals of motor
are Gnd)
L L H Forward Running
H
H L H L Backward Running
H H H
Braking (both
terminals of motor
at Vcc2
3.20 L293D:
The L293 is an integrated circuit motor driver that can be used for simultaneous, bi-
directional control of two small motors. Small means small. The L293 is limited to
600 mA, but in reality can only handle much small currents unless you have done
some serious heat sinking to keep the case temperature down.
Page No 49
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
If it gets too hot to touch, you can't use it with your motor. (Note to ME2011 students:
The L293 should be OK for your small motor but is not OK for your gear motor.)
The L293 comes in a standard 16-pin, dual-in line integrated circuit package. There is
an L293 and an L293D part number. Pick the "D" version because it has built in
flyback diodes to minimize inductive voltage spikes.
The pinout for the L293 in the 16-pin package is shown below in top view. Pin 1 is at
the top left when the notch in the package faces up. Note that the names for pin
functions may be slightly different than what is shown in the following diagrams.
Page No 50
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The following schematic shows how to connect the L293 to your motor and the
Stamp. Each motor takes 3 Stamp pins. If you are only using one motor, leave pins 9,
10, 11, 12, 13, 14, and 15 empty.
Assume you have only one motor connected with the enable tied to Stamp Pin 0, and
the two direction controls tied to Stamp Pins 1 and 2. Here is a table describing the
control pin functions.
Page No 51
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
H H L Turn right
H L H Turn left
Advantage:
You can control 2 motors in both directions instead of 4 in only one direction.
Disadvantages:
Page No 52
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
4.1 Raspberry pi OS
Getting an raspberry pi operating system we have made sure we have all the physical
equipment you need. Now It's time to get yourself an operating system and boot up
your Raspberry Pi.
Page No 53
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The Raspberry Pi itself doesn’t come with an operating system. For that, you need
NOOBS, short for .New Out of the Box Software. It’s an operating system manager
that makes it easy to download, install, and set up your Raspberry Pi. When you first
boot up NOOBS, you’ll get a selection of OSes to choose from. Which operating
systems are available depends on which model of Raspberry Pi you are using. For this
guide, we’ll stick to the most common OS es operating systems available on the
newest models of the Raspberry Pi. Right now, that’s Raspbian, OSMC, Open ELEC,
Windows IoT Core, and RISC OS.
Raspbian is the “official” operating system of the Raspberry Pi and because of that,
it’s the one most people will want to start with. Raspbian is a version of Linux built
specifically for the Raspberry Pi. It comes packed with all the software you’ll need for
every basic task with a computer. You’ll get Libre Office as an office suite, a web
browser, email program, and some tools to teach programming to kids and adults
alike. Heck, it even includes a special (no longer in development) version of
Minecraft.Raspbian is the backbone for pretty much every DIY project out there, so if
you’re looking to make something, Raspbian is most likely where you want to start.
Because it’s so widely used, it’s also easy to find guides and troubleshooting tips.
The recommended operating system for use with the Raspberry Pi is called Raspbian.
Raspbian is a version of GNU/Linux, designed specifically to work well with the
Raspberry Pi. You have several options when it comes to getting hold of a copy of
Raspbian.
Page No 54
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
1. Visit the SD Association’s website and download SD Formatter 4.0 for either
Windows or Mac
3. Insert your SD card into the computer or laptop’s SD card reader and make a
note of the drive letter allocated to it, e.g. F:/ .
4. In SD Formatter, select the drive letter for your SD card and format it
Page No 55
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
4.1.2Download NOOBS
2. Click on NOOBS.
Page No 56
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3. Click on the Download ZIP button under ‘NOOBS (offline and network
install)’, and select a folder to save it to.
5. Once your SD card has been formatted, drag all the files in the extracted
NOOBS folder and drop them onto the SD card drive.
7. When this process has finished, safely remove the SD card and insert it into
your Raspberry Pi.
1. Using a computer with an SD card reader, visit the official Raspberry Pi Downloads
page.
2. Click on Raspbian.
Page No 57
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3. Click on the Download ZIP button under ‘Raspbian Jessie (full desktop
image)’, and select a folder to save it to.
6. Run Etcher and select the Raspbian image you unzipped on your computer or
laptop.
7. Select the SD card drive. Note that the software may have already selected the
right drive.
8. Finally, click Burn to transfer Raspbian to the SD card. You'll see a progress
bar that tells you how much is left to do. Once complete, the utility will
automatically eject/unmount the SD card so it's safe to remove it from the
computer.
Page No 58
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
If this is the first time your Raspberry Pi and SD card have been used, then you'll have
to select an operating system and configure it.
1. Once you have plugged the power cable into your Raspberry Pi, it will boot. If you
are using NOOBS, a window will appear with a list of different operating systems that
you can install. We recommend that you use Raspbian: tick the box next to Raspbian
and click on Install.
Page No 59
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
2. Raspbian will then run through its installation process. Please note that this can take
a while.
3. When the install process has completed, the Raspberry Pi configuration menu
respiconfig will load. Here you can set the time and date for your region, enable a
Raspberry Pi camera board, or even create users. You can exit this menu by using Tab
on your keyboard to move to Finish.
4. If you downloaded Raspbian and imaged it using Etcher rather than NOOBS, then
you will boot directly to the desktop environment of Raspbian and won't need to wait.
If you want to connect your Raspberry Pi to the internet or local network then you
will need to follow these steps:
1. WiFi connections can be made via the network icon at the right-hand end of
the menu bar. If you are using a Raspberry Pi 3, or an earlier model with a
WiFi dongle plugged in, left-clicking this icon will bring up a list of available
WiFi networks.
Page No 61
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
2. If no networks are found, it will show the message "No APs found -
scanning...": just wait a few seconds without closing the menu, and it should
find your network.
3. The icons on the right show whether a network is secured or not, and its signal
strength. Click the network that you want to connect to. If it's secured, a
dialogue box will appear prompting you to enter the network key.
4. Enter the key and press OK, then wait a couple of seconds. The network icon
will flash briefly to show that a connection is being made. Once it's ready, the
icon stops flashing and shows the signal strength.
You can use text commands to download and install extra applications you might
need. In the 'What you will need' section of a Raspberry Pi resource, for example, you
may see a piece of software listed which you will need in order to complete the
activity or project. To download and install extra applications for your Raspberry Pi,
you'll need to be connected to the internet via Ethernet or WiFi.
1. From a terminal window or on the command line, type sudo apt-get install
<name of software> and press Enter on the keyboard.
2. After searching for the package and downloading it, you will be asked if you
want to continue with the installation. Press Y or Enter on the keyboard to
continue.
Page No 62
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Page No 63
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
4.2.1 Processing
Processingis an open-source development environment and programming language,
designed for learning how to code. While it's very flexible and powerful, it's mainly
used in the realm of visual arts. Processing was created by Ben Fry and Casey Reas in
2001. With the help of Dan Shiffman, they continue to lead a team of volunteer
developers to enhance and maintain the project. As a participant in Google's Summer
of Code, Gottfried Haider worked on Raspberry Pi support and the GPIO libraries.
Page No 64
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
2.Click on the Run button. A new window should appear with a box and a diagonal
line.
Page No 65
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
The line function draws a line between two points in the window. It takes four
inputs: x1 and y1 for the start of the line, and x2 and y2 for the end of the line.
Its syntax is: Line(x1,y1,x2,y2);
To understand what this means, you'll need to know that Processing uses a coordinate
system like the one shown below. Note that the numbering begins at 0, not 1. Also, the
origin is in the top-left, rather than the bottom-left as you may be used to.
Page No 66
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
3. Try entering different values into the line function and press Run. Below are a
few ideas to try. Can you guess what the output will look like before you execute the
code?
6. Processing will execute one line of code at a time, starting at the top of the sketch
and working downward. This is called procedural programming. Try calling the line
function a few different times, with a few different values in a single sketch
7. When you click Run, you'll notice that Processing draws each line you entered on
the window.
Note: Processing will alert you to mistakes or when it can't make sense of a statement
because of a syntax error. It will highlight the line and print out helpful information in
the Message area and Console at the bottom of the window.
There are many ways to have a Processing sketch listen to inputs to make it
interactive; the mouse is just one way. In this section, you'll learn how to listen for
mouse clicks and get the position of the mouse.
Page No 67
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
13.//draw the circle in the position taken from the x and y variable:
14. Ellipse(x,y,50,50);
15.}
16. Void mouse Pressed(){
17. //When the mouse is pressed , update x and y
18. // to contain the current position of the mouse:
19. X= mousex;
20. Y = mousey ;
21.}
The code above uses a few special variables that all processing sketches have built in
height ,width, mouse X, mouse Y .The height and width variable refer to the height
and width of the window .The mouse X, mouse Y contain the position of the mouse
pointer. The code also creates a special function called mouse pressed() that is
executed when either mouse button is pressed.
27. Run the sketch and click anywhere in the window to see the circle move to that
position!
Page No 68
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
28. Try updating the code to use mouseX, mouseY, and mouse pressedto change the
size or colour of a shape.
4.3 QT creator
4.3.1Introduction
Qt Creator is an integrated development environment (IDE) that provides you with
tools to design and develop applications with the Qt application framework. Qt is
designed for developing applications and user interfaces once and deploying them to
several desktop, embedded, and mobile operating systems. Qt Creator provides you
with tools for accomplishing your tasks throughout the whole application
development life-cycle, from creating a project to deploying the application to the
target platforms.
Managing ProjectsTo be able to build and run applications, Qt Creator needs the same
information as a compiler would need. This information is specified in the project
settings. Setting up a new project in Qt Creator is aided by a wizard that guides you
step-by-step through the project creation process, creates the necessary files, and
specifies settings depending on the choices you make.
Codlings an IDEQt Creator differs from a text editor in that it knows how to build
and run applications. It understands the C++ and QML languages as code, not just as
plain text. This enables it to provide you with useful features, such as semantic
highlighting, checking code syntax, code completion, and refactoring actions.
Building and Running Qt Creator is integrated with cross-platform systems for build
automation: q make, Qbs, C Make, and Auto tools. In addition, you can import
Page No 69
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
projects as generic projects and fully control the steps and commands used to build
the project.
Qt Creator provides support for building, running, and deploying Qt applications for
desktop environment as well as embedded and mobile devices. Kits, build, run, and
deployment settings allow you to quickly switch between different setups and target
platforms.
TestingQt Creator is integrated to several external native debuggers: GNU Symbolic
Debugger (GDB), Microsoft Console Debugger (CDB), and internal JavaScript
debugger. In theDebugmode, you can inspect the state of your application while
debugging.
The memory and CPU power available on devices are limited and you should use
them carefully. Qt Creator integrates Valgrind code analysis tools for detecting
memory leaks and profiling function execution. In addition, the QML Profiler enables
you to profile Qt Quick applications.
Qt Creator is integrated to the QtTestand Google C++ Testing frameworks for unit
testing applications and libraries.
2. Open zip file and by double click start the installation follow the step get
installation done.
3. Open qt creator in windows---click on start > click on qtfolder > click on Qtcreator.
ThenQt creator window will open..
Page No 70
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Startup Qt Creator
Page No 71
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Select one or more versions of Qt to target. A desktop build is fine for this tutorial.
Select the base class to be QWidget (leave the class name as Widget which is the
default).
Page No 72
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Editing the project filesWe will edit the widget.ui file first so.
Click on that and designer will switch to design mode and open up the file. You
should see a blank widget. Now do this.
Click on the widget background so that both of your new widgets (the label and line
edit) get deselected.
In the toolbar at the top click on the "Lay out Horizontally" button or press Ctrl-H to
add all widgets to a horizontal layout. The layout will take care of resizing your
widgets for you if the parent widget's size changes.
Double click on the Label and it will switch to edit mode. Change the text to "My
name is:"Press Ctrl-S to save the form.
Page No 73
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Click on the Edit mode button in the left hand panel of creator to switch back to the
text editor. You will probably see the raw xml content of the UI file at this point. Just
close it we are done with it for now.
Page No 74
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
public:
explicit Widget(QWidget*parent =0);
~Widget(); voidsetName(constQString&name);
QStringname()const;
private: Ui::Widget*ui;
};
#endif // WIDGET_H
Now edit the corresponding .cpp file to look like this:
#include "widget.h" #include "ui_widget.h"
Widget::Widget(QWidget*parent): QWidget(parent),
ui(newUi::Widget)
{
ui->setupUi(this); }
Widget::~Widget() {
Page No 75
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
deleteui; }
void Widget::setName(constQString&name) {
ui->lineEdit->setText(name);
}
QString Widget::name()const {
returnui->lineEdit->text();
}
Finally edit main.cpp to this:
#include <QApplication> #include "widget.h"
int main(intargc,char*argv[]) {
QApplicationa(argc,argv);
Widget w; w.setName("Slim Shady"); w.show();
returna.exec();
}
Now build (Hammer icon in lower left or default shortcut of Ctrl-Shift-B) and run the
application (green "play" icon in lower left corner). You will see some compiler
messages go past in the "Compile Output" panel at the bottom whilst building.
Page No 76
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
Page No 77
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
We don't need to use data types to declare variable because it is dynamically typed so
we can write a=10 to declare an integer value in a variable. Python makes the
development and debugging fast because there is no compilation step included in
python development and edit-test-debug cycle is very fast.
• Python is Interactive: You can actually sit at a Python prompt and interact with
the interpreter directly to write your programs.
Page No 78
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
• Python was developed by Guido van Rossum in the late eighties and early
nineties at the National Research Institute for Mathematics and Computer
Science in the Netherlands.
• Python is copyrighted. Like Perl, Python source code is now available under
the GNU General Public License (GPL).
• Easy-to-read: Python code is more clearly defined and visible to the eyes.
• A broad standard library: Python's bulk of the library is very portable and
cross-platform compatible on UNIX, Windows, and Macintosh.
• Interactive Mode: Python has support for an interactive mode which allows
interactive testing and debugging of snippets of code.
• Portable: Python can run on a wide variety of hardware platforms and has
the same interface on all platforms.
Page No 79
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
• Scalable: Python provides a better structure and support for large programs
than shell scripting.
Apart from the above-mentioned features, Python has a big list of good
features, few are listed below:
• It provides very high-level dynamic data types and supports dynamic type
checking.
• It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
Page No 80
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
1. Women safety night Patrolling robot the components consist of LCD display,
raspberry pi 3, DC motor, GSM module ,ultra sonic sensors.
Page No 81
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
2.When the robot is moving in a path if any object is detected by ultrasonic sensor the
message will be send to phone through GSM module which is shown below figure.
3. We can see live streaming in IOT Gecko those images are shown below.
Page No 82
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
CHAPTER 6 : CONCLUSION
CONCLUSION
integrating features of all the hardware components used. Presence of every module
has been reasoned out and placed carefully thus contributing to the best working of
the unit.
Page No 83
WOMEN SAFETY NIGHT PATROLLING ROBOT BY USING RASPBERRY PI 3
CHAPTER 7 : REFERENCE
Page No 84
1
1