Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 62

RASPBERRY PI BASED DRIVER ASSISTANCE SYSTEM TO

INCREASE VISIBILITY ON A FOGGY ROAD


Abstract –

Drivers know to take it slow and keep their distance from other cars during snow, ice
and rainstorms. When it comes to different types of inclement weather, fog often gets
overlooked as a serious hazard. Fog is a large cloud of water droplets that forms when air
comes in contact with the ground and then cools. This phenomenon is responsible for 38,000
crashes, 15,000 injuries and 600 fatalities every year. These clouds greatly decrease visibility,
frequently in the morning and evening. Fog may distort your perception of speed, as you
cannot see other objects moving in relation to your vehicle. Therefore traffic in foggy
weather conditions is a very important issue and has been widely researched within the field
of computer vision. A Video dehazing system using raspberry pi is proposed to counter these
problems and thereby reduce the number of accidents. The proposed system also consists of
rain sensor to detect the rain fall and automatically activate the viper motors.
CHAPTER-1

INTRODUCTION
Driving in extreme weather conditions can be challenging and may affect normal driving
routine of most of the people. That mostly affects your ability to command yourself on the driving
position , which is extremely limited in adverse climate like rain, fog, ice, snow, and dust. Fog is one
in all the scariest things to drive in, especially if you’re not familiar in driving in such conditions. it’s a
dense ”cloud bank” that rests on the bottom. To drive in foggy weather conditions either you have
to drive slowly and carefully otherwise use the most commonly used method and implement fog
lights.Over the years its seen that the use of fog lights haven’t reduced the amount of accidents.

It is easy to think you’ll see tolerably to proceed through patchy fog. However, if you try to
do that thick fog can appear suddenly and you may loose sight of the surrounding on either side of
the vehicle. Using the high beams will only decrease the visibility. High-beams will reflect back and
forth and may cause glare. Fog makes it very difficult to judge the speed of the vehicle. Checking the
speedometer to know the speed every time is not a recommended method and certainly not an easy
task .In such heavy fog the sole solution is , don’t continue driving until the fog lifts and visibility
improves which can be time consuming. The normal solution can not be effective for driving safely
through the roads in these adverse climatic conditions .This is where our project includes a big role
in producing better results and henceforth an entire solution to the present scenario. Our project is
predicated on locally adaptive processing imaged dehazing technique. Fundamental task in many
image processing and vision ap- plications is image enhancement. Restoration of hazy images which
requires specific strategies is a tough challenge and therefore a variety of solutions have emerged to
solve this problem.

Initially, for remote sensing systems several dehazing techniques are developed, where the
input information is given by a multi-spectral imaging sensor installed on the Landsat satellites.
Different strategies processes recorded six- bands of reflected light to yield enhanced output images.
For homogeneous scenes the well-known method of Chavez [1] is suitable, where haze is removed
by subtracting an offset value determined by the intensity distribution of the darkest object. Another
category of methods, uses multiples images or other additional equipment’s. These techniques uses
multiple input images taken in different atmospheric conditions. Our project is based on dehazing
foggy images and videos using image processing. The OpenCv library is used and three main
functions, image/video manipulation, masking and thresholds is used to dehaze images and video.

1.2 PROBLEM DEFINITION

As per the official record, as many as 866 people were killed thanks to foggy climate in 1,246
road accidents reported in 2017, while 768 sustained injuries. In 2016,602 people were killed and
660 injured thanks to fog.The suspension of very fine moisture droplets within the air produces
fog.The droplets will scatter the light and leads to a loss of contrast and a dense white background.
The smaller the droplets thicker the fog and results in roadways becoming even more blanketed. As
a result, it will adversely affect the car drivers vision, and the possibility of car accident increases
even more.Fog distorts drivers’ perception of speed and will have a tough time distinguishing
between a stationary object and a moving one which might easily end in severe accidents.Foggy
conditions will be further exasperated by faulty logic.

Using fog lights is that the existing solution. The yellow or green lights reflect back less light
than simply your normal white lights. White lights contain all the colours (more wave- lengths), and
experts have found that one wavelength (yellow, green or blue) will allow less reflection.However
Fog lights don’t assist you see further up the road in fog. In fog or other low visibility conditions, you
ought to activate your main headlights. Fog lights should be activated additionally to your dipped
headlights when visibility falls to but 100m.

Therefore traffic in foggy climate is a crucial issue and may be a widely researched in field of
computer vision. i’m proposing a method to dehaze video in real time to boost the vision of the
drivers. i’m introducing a software which might assist the drivers in foggy conditions.The software
captures real time ,divides the video into frames , dehaze , then merge the frames and produce clear
dehazed video ,thereby reducing the danger of accidents in foggy conditions.
CHAPTER-2

RELATED WORK
Demand for haze removal algorithm is increasing day by day as a result of increasing of
pollution, mist and haze in the environment. Vision has to be improved through the technical ways
of MATLAB or Python which don’t seem to be yet fitting best with any atmosphere.The do and
don’ts about the fog removal algorithms are formulated after conducting a survey so that vision in
vehicles are often proper and noise free .Through proper estimation of sunshine and mixing the
transmission map has improved extended windows concept in combination with DCP. There are two
ways of haze removal i.e., multiple images fog removal method and single image fog removal
method. For multiple images fog removal, image fusion techniques are used.Following are the
dehazing techniques:

1. Polarization Based

Polarization-based dehazing methods are a part of the multi-image group loving two
differently polarized filters they usually use two input images, one after another, to provide
one dehazed image. Airlight is a minimum of partially polarized as this fact is employed
during this technique, and also the trans- mission mechanism of the item is un-polarized. To
remove haze, a minimum of two images with different polarization filter states are
necessary.Looking on the gap and density of the haze previous image dehazing models may
amplify the noise. To suppress noise and improve the dehazing performance, an imaging
model is modified based on an iterative approach. Depth-chromaticity compensation
regularization for the transmission map and chromaticitydepth compensation regularization
for dehazing the image is offered by the iterative process.These two joint regularization
schemes and also the relationship between the transmission map and dehazed image is
utilized in the iterative process with polarization.Polarized images of various scenes in
numerous days are collected to verify the effectiveness of algorithm. In comparison with
iterative image polarization technique increases visibility in extreme weather without
amplifying the noise.
2. Fusion Based

It requires multiple images of constant scene. There is high complexity of time to get
rid of haze. Thus, the fusion based technique is multiple image dehazing technique that
takes lesser time and just one image per scene.Image fusion technique aims to blend
different input images and preserve only the features which are required by the composite
output image . Deriving two input images from the original input with the aim of recovering
the visibility for each region of the scene in a minimum of one among them is the main
concept behind fusion based image dehazing. Furthermore, the fusion enhancement
technique estimates weight maps for every pixel that controls the contribution of every
input to the ultimate result.There are mainly two problems, the first one being color casts
that are introduced because of the airlight influence and the second is the lack of visibility
into distant regions because of scattering and attenuation phenomena.

3. Dark Channel Prior

Using stronger assumptions resulted in the success of recently developed techniques like
Single image dehazing [2], and Visibility in bad weather from a single image [3] compared to
earlier dehazing methods . He, Sun and Tang developed a really promising new single image
technology in 2010 called the Dark channel prior . Sincr this method doesn’t believe significant
variance on transmission or surface shading within the input image the output image is rarely
affected by halos than in [Tan, 2008]. Dark Channel Prior is a statistical based assumption of
haze-free outdoor images. It is noted that most of the local regions means non-sky regions, and
a few pixels have a really low intensity fairly often in a minimum of one among its color channels
(RGB). The dark pixels in the hazy image will determine the air light, since the air light is
apparent on a dark object. 4. Fattal’s Method

In 2008 Fattal introduced a new uality of hazy images by single image dehaztechnique which
drastically improved the qing and gives it a refined image formation model. According to Fattal
this technique will allow us to resolve ambiguities in the data by searching for a solution in which
the resultant shading and transmission functions are locally, statistically uncorrelated. For
approximating the color of the haze an analogous standard is used.

4. Locally Adaptive processing

This algorithm [4] allows estimation of the transmission function of the scene without
introducing noticeable edge artifacts and overprocessing effects to the restored scene. This is
possible because only the pixels having similar depth values inside a sliding window are taken
into account. Furthermore, the transmission function using the proposed estimator can be more
accurately estimated than that of with the DCP or CAP algorithms.This system is based on an
embedded CPU/GPU architecture that exploits massive parallelism for high-rate image
processing.

CHAPTER-3

PROPOSED SYSTEM
The proposed Raspberry Pi based driver assistance system is consists of Raspberry pi,
camera module , rain sensor and DC motor. The block diagram of the proposed system
is as shown in the figure3.1. By using OpenCV as framework a method is introduced for
dehazing foggy video in real time by using image processing. It can dehaze already taken video
as well as videos taken in real time effectively. The code consists for three main functions , for
image/video manipulation, masking and thresholds.

Fig 3.1 Block diagram of the proposed system


 The cv2.VideoCapture function from the OpenCV library is used to record real-time video.
The cap.read(objectname.read) can used read frames one by one from the input video.These
frames are then dehazed one by one.

 Color digital images are made of pixels, and pixels are made of combinations of primary
colors represented by a series of code. A channel in this context is the grayscale image of the
same size as a color image, made of just one of these primary colors. For instance, an image
from a standard digital camera will have a red, green and blue channel. A grayscale image has
just one channel.

 An RGB image has three channels: red, green, and blue. RGB channels roughly follow the
color receptors in the human eye, and are used in computer displays and image scanners. If the
RGB image is 24-bit (the industry standard as of 2005), each channel has 8 bits, for red, green,
and blue—in other words, the image is composed of three images (one for each channel), where
each image can store discrete pixels with conventional brightness intensities between 0 and 255.

 In digital image processing, thresholding is the simplest method of segmenting images.


From a grayscale image, thresholding can be used to create binary images. Thresholding is done
to segment the images in to two regions , dark and light region based on the threshold values
that is obtained in the manipulation function(). This is typically done in order to separate
”object” or foreground pixels from background pixels to aid in image processing. Most
frequently, we use thresholding as a way to select areas of interest of an image, while ignoring
the parts we are not concerned with. It is used to make the image easier to analyze.

• An ”unsharp mask” is actually used to sharpen an image, contrary to what its name might
lead you to believe. Sharpening can help you emphasize texture and detail, and is critical when
post-processing most digital images. Unsharp masks are probably the most common type of
sharpening. An unsharp mask cannot create additional detail, but it can greatly enhance the
appearance of detail by increasing small-scale acutance.The sharpening process works by
utilizing a slightly blurred version of the original image.

This is then subtracted away from the original to detect the presence of edges, creating the
unsharp mask (effectively a high-pass filter). Contrast is then selectively increased along these
edges using this mask — leaving behind a sharper final image.Haze can be removed from image
using unsharp mask. Normally that mask is used for sharpening an image, but it has more uses.
Figure 3.1 gives the block diagram of the proposed system. The modules in this model are
Camera module, Video to frame splitter module, Dehazing module and Frame merging module.

In the proposed system rain sensor interfaced with raspberry pi to detection the rain fall
and activate the viper motor in the vehicle to provide clear and safe vision to the driver.

CHAPTER-4

HARDWARE DESCRIPTION

RASPBERRY PI

3.1 The Idea to create the Raspberry Pi

The idea behind a tiny and affordable computer for kids came in 2006, when Eben Upton, Rob
Mullins, Jack Lang and Alan Mycroft, based at the University of Cambridge’s Computer Laboratory,
became concerned about the year-on-year decline in the numbers and skills levels of the A Level
students applying to read Computer Science. From a situation in the 1990s where most of the kids
applying were coming to interview as experienced hobbyist programmers, the landscape in the 2000s
was very different; a typical applicant might only have done a little web design.

Something had changed the way kids were interacting with computers. A number of problems were
identified: majority of curriculums with lessons on using Word and Excel, or writing webpages; the
end of the dot-com boom; and the rise of the home PC and games console to replace the Amigas,
BBC Micros, Spectrum ZX and Commodore 64 machines that people of an earlier generation learned
to program on.
Figure 3: A complete Commodore 64 System

There isn’t much any small group of people can do to address problems like an inadequate school
curriculum or the end of a financial bubble. But those students felt that they could try to do something
about the situation where computers had become so expensive and arcane that programming
experimentation on them had to be forbidden by parents; and to find a platform that, like those old
home computers, could boot into a programming environment. Thus came the idea of creating the
device which kids could buy and learn programming or hardware on – The Raspberry Pi.

3.2 Initial Design Considerations

From 2006 to 2008 they created many designs and prototypes of what we now know as the Raspberry
Pi. One of the earliest prototypes is shown below:
Figure 4: One of the earliest prototype of the Pi

These boards use an Atmel ATmega644 microcontroller clocked at 22.1MHz, and a 512K SRAM for
data and frame buffer storage.

By 2008, processors designed for mobile devices were becoming more affordable, and powerful
enough to provide excellent multimedia, a feature which would make the board desirable to kids who
wouldn’t initially be interested in a purely programming-oriented device. The project started to look
very realisable and feasible. Eben (now a chip architect at Broadcom), Rob, Jack and Alan, teamed up
with Pete Lomas, MD of hardware design and manufacture company Norcott Technologies, and
David Braben, co-author of the BBC Micro game Elite, to form the Raspberry Pi Foundation to make
it a reality. Three years later, the Raspberry Pi Model B entered mass production through licensed
manufacture deals with Element 14/Premier Farnell and RS Electronics, and within two years it had
sold over two million units!

3.3 Hardware
Hardware Layout

Figure 5: Block Diagram of Raspberry Pi3B+

3.4.2 A brief description of the components on the Pi.

1) Processor / SoC (System on Chip)


The Raspberry Pi has a Broadcom BCM2835 System on Chip module. It has a
ARM1176JZF-S processor

The Broadcom SoC used in the Raspberry Pi is equivalent to a chip used in an old smartphone
(Android or iPhone). While operating at 700 MHz by default, the Raspberry Pi provides a real
world performance roughly equivalent to the 0.041 GFLOPS. On the CPU level the
performance is similar to a 300 MHz Pentium II of 1997-1999, but the GPU, however,
provides 1 Gpixel/s, 1.5 Gtexel/s or 24 GFLOPS of general purpose compute and the graphics
capabilities of the Raspberry Pi are roughly equivalent to the level of performance of the
Xbox of 2001. The Raspberry Pi chip operating at 700 MHz by default, will not become hot
enough to need a heatsink or special cooling.

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.

4) GPIO
GPIO – General Purpose Input Output
General-purpose input/output (GPIO) is a generic pin on an integrated circuit whose
behaviour, including whether it is an input or output pin, can be controlled by the user at run
time.

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.

GPIO capabilities may include:

 GPIO pins can be configured to be input or output


 GPIO pins can be enabled/disabled
 Input values are readable (typically high=1, low=0)
 Output values are writable/readable
 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. They provide 8 GPIO pins plus access to I²C, SPI,
UART), as well as +3.3 V, +5 V and GND supply lines. Pin one is the pin in the first column
and on the bottom row.
Figure 6: GPIO connector on RPi

5) DSI Connector
The Display Serial Interface (DSI) is a specification by the Mobile Industry Processor
Interface (MIPI) Alliance aimed at reducing the cost of display controllers in a mobile device.
It is commonly targeted at LCD and similar display technologies. It defines a serial bus and a
communication protocol between the host (source of the image data) and the device
(destination of the image data).

A DSI compatible LCD screen can be connected through the DSI connector, although it may
require additional drivers to drive the display.

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.
Figure 7: RCA Video Connector

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

“POWER” - 3.3 V Power - labelled as "PWR" on all boards

“FDX” - Full Duplex (LAN) (Model B) - labelled as "FDX" on all boards

“LNK” - Link/Activity (LAN) (Model B) - labelled as "LNK" on all boards

“10M/100” - 10/100Mbit (LAN) (Model B) - labelled (incorrectly) as "10M" on Model B


Rev1.0 boards and "100" on Model B Rev2.0 and Model A boards
Figure 8: Status LEDs

9) USB 2.0 Port


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
Ethernet port is available on Model B and B+. It can be connected to a network or internet
using a standard LAN cable on the Ethernet port. The Ethernet ports are controlled by
Microchip LAN9512 LAN controller chip.

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.

12) JTAG headers


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 – High Definition Multimedia Interface
HDMI 1.3 a type A port is provided on the RPi to connect with HDMI screens.
3.4.2 Specifications

Table 1 Specifications

3.4.3 Brief description of System on Chip (SoC)

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.
Thanks to the wonders of miniaturization, SoC manufacturers, like Qualcomm, Nvidia or Texas
Instruments, can place some of those components on a single chip, the System on a Chip that powers
smartphones.

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 microcontroller is one of degree. Microcontrollers 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: increasing chip integration to reduce
manufacturing costs and to enable smaller systems. Many interesting systems are too complex to fit
on just one chip built with a process optimized for just one of the system's tasks.

A typical SoC consists of:

 A microcontroller, microprocessor or DSP core(s). Some SoCs—called multiprocessor


system on chip (MPSoC)—include more than one processor core.
 memory blocks including a selection of ROM, RAM, EEPROM and flash memory
 timing sources including oscillators and phase-locked loops
 peripherals including counter-timers, real-time timers and power-on reset generators
 external interfaces, including industry standards such as USB, FireWire, Ethernet, USART,
SPI
 analog interfaces including ADCs and DACs
 voltage regulators and power management circuits

 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.4 Software

3.4.1 Operating System

The Raspberry Pi primarily uses Linux kernel-based operating systems. The ARM11 is based on
version 6 of the ARM which is no longer supported by several popular versions of Linux, including
Ubuntu. The install manager for Raspberry Pi is NOOBS. The OSs included with NOOBS are:

 Archlinux ARM
 OpenELEC
 Pidora (Fedora Remix)
 Raspbmc and the XBMC open source digital media center
 RISC OS – The operating system of the first ARM-based computer
 Raspbian (recommended) – Maintained independently of the Foundation; based on ARM
hard-float (armhf)-Debian 7 'Wheezy' architecture port, that was designed for a newer
ARMv7 processor whose binaries would not work on the Rapberry Pi, but Raspbian is
compiled for the ARMv6 instruction set of the Raspberry Pi making it work but with slower
performance. It provides some available deb software packages, pre-compiled software
bundles. A minimum size of 2 GB SD card is required, but a 4 GB SD card or above is
recommended. There is a Pi Store for exchanging programs. The 'Raspbian Server Edition
(RSEv2.4)', is a stripped version with other software packages bundled as compared to the
usual desktop computer oriented Raspbian.

3.4.2 Boot Process

The Raspberry Pi does not boot as a traditional computer. The VideoCore i.e. the Graphics processor
actually boots before the ARM CPU.

The boot process of the Raspberry Pi can be explained as follows:

 When the power is turned on, the first bits of code to run is stored in a ROM chip in the SoC
and is built into the Pi during manufacture. This is the called the first-stage bootloader.
 The SoC is hardwired to run this code on startup on a small RISC Core (Reduced Instruction
Set Computer). It is used to mount the FAT32 boot partition in theSDCard so that the second-
stage bootloader can be accessed. So what is this ‘second-stage bootloader’ stored in the SD
Card? It’s ‘bootcode.bin’. This file can be seen while mount process of an operating system
on the SD Card in windows.

 Now here’s something tricky. The first-stage bootloader has not yet initialized the ARM CPU
(meaning CPU is in reset) or the RAM. So, the second-stage bootloader also has to run on the
GPU. The bootloader.bin file is loaded into the 128K 4 way set associative L2 cache of the
GPU and then executed. This enables the RAM and loads start.elf which is also in the SD
Card. This is the third-stage bootloader and is also the most important. It is the firmware for
the GPU, meaning it contains the settings or in our case, has instructions to load the settings
from config.txt which is also in the SD Card.  We can think of the config.txt as the ‘BIOS
settings’.

 The start.elfalso splits the RAM between the GPU and the ARM CPU. The ARM only has
access the to the address space left over by the GPU address space. For example, if the GPU
was allocated addresses from 0x000F000 – 0x0000FFFF, the ARM has access to addresses
from 0x00000000 – 0x0000EFFF.

 The physical addresses perceived by the ARM core is actually mapped to another
address in the VideoCore (0xC0000000 and beyond) by the MMU (Memory
Management Unit) of the VideoCore.

 The config.txt is loaded afterthe split is done so the splitting amounts cannot be specified in
the config.txt. However, different .elf files having different splits exist in the SD Card. So,
depending on the requirement, the file can be renamed to start.elf and boot the Pi. In the Pi,
the GPU is King!

 Other than loading config.txt and splitting RAM, the start.elfalso loads cmdline.txt if it
exists. It contains the command line parameters for whatever kernel that is to be loaded. This
brings us to the final stage of the boot process. The start.elf finally loads kernel.img which is
the binary file containing the OS kernel and releases the reset on the CPU. The ARM CPU
then executes whatever instructions in the kernel.img thereby loading the operating system.
 After starting the operating system, the GPU code is not unloaded. In fact, start.elf is not just
firmware for the GPU, It is a proprietary operating system called VideoCore OS (VCOS).
When the normal OS (Linux) requires an element not directly accessible to it, Linux
communicates with VCOS using the mailbox messaging system

Power On
Hardwired First Stage Bootloader

Second Stage Bootloader


Mount bootcode.bin from FAT32 boot partition from SD Card to L2 cache of GPU.

Third Stage Bootloader


bootcode.bin starts start.elf which splits the ram. Then load kernel.img. Operating
System is now loaded.

Figure 10: Boot process of Raspberry Pi


3.4.3 The NOOBS installer

The Raspberry Pi package only comes with the main board and nothing else. It does not come shipped
with an operating system. Operating systems are loaded on a SD card from a computer and then the
SD card is inserted in the Pi which becomes the primary boot device.

Installing operating system can be easy for some enthusiasts, but for some beginners working with
image files of operating systems can be difficult. So the Raspberry Pi foundation made a software
called NOOBS – New Out Of Box Software which eases the process of installing an operating system
on the Pi.

The NOOBS installer can be downloaded from the official website. A user only needs to connect a
SD card with the computer and just run the setup file to install NOOBS on the SD card. Next, insert
the card on the Raspberry Pi. On booting the first time, the NOOBS interface is loaded and the user
can select from a list of operating systems to install. It is much convenient to install the operating
system this way. Also once the operating system is installed on the card with the NOOBS installer,
every time the Pi boots, a recovery mode provided by the NOOBS can be accessed by holding the
shift key during boot. It also allows editing of the config.txt file for the operating system
5.4 Raspberry Pi compatible operating systems

Distribution Type Memory Packages


footprint
Arch Linux ARM Linux 8,700
BerryTerminal Linux
Bodhi Linux Raspbian 35,000+
ARMHF
Debian ARM Linux 20,000+
Fedora Remix Linux 16,464?
Gentoo Linux Linux ~23 MiB
IPFire Linux ~20 MiB 144
I2PBerry Linux 20,000+

Meego MER + XBMC Linux (embedded) ~34 MiB + ~320 (core)


XBMC
Moebius Raspbian ~20 MiB (core) + Raspbian
Repositories
nOS Linux ~90 MiB 35,000+
openSUSE Linux 3.11 28 MiB (inc. 6300
X11)
OpenWRT Linux 3,3MiB 3358
PiBang Linux Linux_3.6.11
&SystemD
PwnPi Linux 20,000+
QtonPi Linux
VPNbian Linux ~40 MiB w/o 35,000+
desktop
Raspbian Linux ~30 MiB w/o 35,000+
desktop
OpenELEC Linux 3.10.16 95 MiB (incl. ~140 (+ 7 via xbmc)
(embedded) XBMC)
XBian Raspbian 35,000+
raspbmc Raspbian 20,000+
RISC OS RISC OS
Aros hosted on Raspbian Mixed Debian6 and <~50 MiB
Limited Demo Aros
Plan9 Plan 9
SlaXBMCRPi Linux 3.10.36+ 476
(+ Official SlackwareARM
14.1 Packages)
PiMAME Linux
PiBox Linux/Buildroot
pipaOS Raspbian ~32 MiB 37.500
Raspberry WebKiosk Raspbian
Volumio Raspbian
Nard SDK Embedded Linux ~40 MB

Table 2: List of supported Operating Systems


3.5 Applications

6.1 Applications

The major aim behind the Raspberry Pi was to educate people, especially children and teenagers,
towards programming and basic hardware interfacing. The open body structure of the Raspberry Pi
makes it a machine on which one can learn computer concepts.

Applications of the Raspberry Pi can be given as follows:

 Teaching programming concepts.


 Teaching hardware interfacing.
 Raspberry Pi being very cost effective can be deployed in large numbers in underdeveloped
and developing countries like Africa, India, China, Brazil etc. to schools and colleges and to
everyone who is interested in computers and electronics.
 It can be used in robotics for controlling motors, sensors, etc.
 It can be used as a downloading machine replacing desktop computers. It consumes very low
power and also can be accessed remotely.
 It can be used as a media centre at home. Any television can be converted to a smart TV with
internet capabilities with the Pi.
 It can be used for designing prototypes of DIY projects and certain embedded devices. It
becomes very cheap option for testing and evaluation purpose.
 Can be used in creating and handling small servers.
 It can be used for making digital photo frames, tablets etc at home

3.6 Advantages and disadvantages

Advantages of the Raspberry Pi:


It is important for customers and business owners that want to get the Raspberry Pi to consider
whether it fits with their business strategy and are willing to go through the process of putting it
together and tailoring the product to their own needs. The benefits that this products offers beside the
low price point are:

 This microcomputer is useful for small or home based businesses that run on a smaller budget
than bigger companies for you are not required to purchase any special licenses from the
Raspberry Pi Foundation to use their product or if you invent new technology that embeds the
product. Small business owners can use it to automate any small task, such as using the Pi to
run a website ( as long as it does not have a lot of traffic), or use it as a small database and
media server... pretty much anything that doesn't require the Windows operating system or
other systems that does not support Linux and lots of traffic). Businesses can also save money
on buying cooling systems that are required to cool servers.
 The product does not require the user to have extensive programming experience since it is
aimed for the younger generation to learn about programming. Python, the programming
language that the Pi uses, is less complex than other languages available. For example, it has
better code readability and allows the user to type concepts using fewer amount of lines.
Python also has an automatic memory management function.
 The product also gives you a lot of room to experiment and turn it into something else that is
entirely different.  The SD cards on the board can be easily switched, which allows you to
change the functions of the device without spending a lot of time re-installing the software.
 The Raspberry Pi is perfect for adaptive technology: it is able to display images or play
videos at 1080p high definition resolution to building systems such as digital jukeboxes
or prototyping embedded systems. This product makes it possible to build complex and
effective products at a cheaper price.
 The product is energy efficient and provides a greener ethical alternative to small businesses.
This small credit card sized product makes it easy to recycle and does not release as much
carbon dioxide emissions into the environment, unlike big servers that require lots of energy
and extensive cooling systems.

Disadvantages:

 It does not replace your computer, since the Ethernet is only a 10/100 and the processor is not
as fast, it is time consuming to download and install software and is unable to do any complex
multitasking.
 Not compatible with other operating systems such as Windows (There are currently 1.3
billion Windows users around the world.)
 To use the Raspberry Pi,it will take more than just 35 dollars to get it to do what you need
through buying extra accessories such as the SD card, USB power supply, keyboard..etc and
if you take into account the acquisition cost of the product. This is only fit for those who want
a gadget that they can tailor to their own needs and tastes, not for those who just wants to get
a job done fast. Business owners need to consider if the extra hassle is worth it.
 This product will not be useful for bigger businesses that already have big servers, which
would already do everything that the Raspberry Pi does, so it would not be worth it to take the
time to get someone to put it together.

Pi Camera Module – 5MP


Pi Camera Module
PiCamera Pinout

The Pi camera module is a portable light weight camera that supports Raspberry Pi. It

communicates with Pi using the MIPI camera serial interface protocol. It is normally used in

image processing, machine learning or in surveillance projects. It is commonly used in

surveillance drones since the payload of camera is very less. Apart from these modules Pi can

also use normal USB webcams that are used along with computer.

Pin Description
Pin Number Pin Name Description
1 Ground System Ground
2,3 CAM1_DN0, CAM1_DP0 MIPI Data Positive and MIPI Data Negative for data lane 0
4 Ground System Ground
5,6 CAM1_DN1, CAM1_DP1 MIPI Data Positive and MIPI Data Negative for data lane 1
7 Ground System Ground
8,9 CAM1_CN, CAM1_CP These pins provide the clock pulses for MIPI data lanes
10 Ground System Ground
11 CAM_GPIO GPIO pin used optionally
12 CAM_CLK Optional clock pin
13,14 SCL0, SDA0 Used for I2C communication
15 +3.3V Power pin
 
PiCam Features
 5MP colour camera module without microphone for Raspberry Pi
 Supports both Raspberry Pi Model A and Model B
 MIPI Camera serial interface
 Omnivision 5647 Camera Module
 Resolution: 2592 * 1944
 Supports: 1080p, 720p and 480p
 Light weight and portable (3g only)

How to use Camera module with Pi


The Pi camera module when purchased comes along with a ribbon cable, this cable
has to be connected to the CSI (Camera Serial Interface) port of the Pi. This port can
be found near the HDMI port just connect the cable to it as shown below.

After interfacing the hardware, we have to configure the Pi to enable Camera. Use
the command “sudo raspi-config” to open the configuration window. Then under
interfacing options enable camera. Finally reboot the Pi and your camera module is
ready to use. Then, you can make the Pi to take photos or record videos using simple
python scripts.
 
Applications
 Surveillance projects
 Time-lapse video recording
 Image processing
 Machine learning
 Robotics

Servo Motor SG-90


Servo Motor SG90
Servo Motor Pinout (Wires)

Wire Configuration

Wire Number Wire Colour Description


1 Brown Ground wire connected to the ground of system
2 Red Powers the motor typically +5V is used
3 Orange PWM signal is given in through this wire to drive the motor
 
TowerPro SG-90 Features
 Operating Voltage is +5V typically
 Torque: 2.5kg/cm
 Operating speed is 0.1s/60°
 Gear Type: Plastic
 Rotation : 0°-180°
 Weight of motor : 9gm
 Package includes gear horns and screws
Selecting your Servo Motor
There are lots of servo motors available in the market and each one has its own
speciality and applications. The following two paragraphs will help you identify the
right type of servo motor for your project/system.
Most of the hobby Servo motors operates from 4.8V to 6.5V, the higher the voltage
higher the torque we can achieve, but most commonly they are operated at +5V.
Almost all hobby servo motors can rotate only from 0° to 180° due to their gear
arrangement so make sure you project can live with the half circle if no, you can
prefer for a 0° to 360° motor or modify the motor to make a full circle. The gears in
the motors are easily subjected to wear and tear, so if your application requires
stronger and long running motors you can go with metal gears or just stick with
normal plastic gear.
Next comes the most important parameter, which is the torque at which the motor
operates. Again there are many choices here but the commonly available one is the
2.5kg/cm torque which comes with the Towerpro SG90 Motor. This 2.5kg/cm torque
means that the motor can pull a weight of 2.5kg when it is suspended at a distance
of 1cm. So if you suspend the load at 0.5cm then the motor can pull a load of 5kg
similarly if you suspend the load at 2cm then can pull only 1.25. Based on the load
which you use in the project you can select the motor with proper torque. The below
picture will illustrate the same.

 
How to use a Servo Motor
After selecting the right Servo motor for the project, comes the question how to use
it. As we know there are three wires coming out of this motor. The description of the
same is given on top of this page. To make this motor rotate, we have to power the
motor with +5V using the Red and Brown wire and send PWM signals to the Orange
colour wire. Hence we need something that could generate PWM signals to make
this motor work, this something could be anything like a 555 Timer or other
Microcontroller platforms like Arduino, PIC, ARM or even a microprocessor like
Raspberry Pie. Now, how to control the direction of the motor? To understand that
let us a look at the picture given in the datasheet.

From the picture we can understand that the PWM signal produced should have a
frequency of 50Hz that is the PWM period should be 20ms. Out of which the On-
Time can vary from 1ms to 2ms. So when the on-time is 1ms the motor will be in 0°
and when 1.5ms the motor will be 90°, similarly when it is 2ms it will be 180°. So, by
varying the on-time from 1ms to 2ms the motor can be controlled from 0° to 180°
 
Applications
 Used as actuators in many robots like Biped Robot, Hexapod, robotic arm etc..
 Commonly used for steering system in RC toys
 Robots where position control is required without feedback
 Less weight hence used in multi DOF robots like humanoid robots

L293,L293D(QUADRUPLE HALF H-DRIVERS)

Introduction:
The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide
bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to
provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are
designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as
other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible.
Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo-
Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3
and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their
outputs are active and in phase with their inputs. When the enable input is low, those drivers are
disabled, and their outputs are off and in the high-impedance state. With the proper data inputs,
each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor
applications.

Features:

 Featuring Unitrode L293 and L293D


Products Now From Texas Instruments

 Wide Supply-Voltage Range: 4.5 V to 36 V


 Separate Input-Logic Supply
 Internal ESD Protection
 Thermal Shutdown
 High-Noise-Immunity Inputs
 Functionally Similar to SGS L293 and
SGS L293D

 Output Current 1 A Per Channel


(600 mA for L293D)

 Peak Output Current 2 A Per Channel


(1.2 A for L293D)

 Output Clamp Diodes for Inductive


Transient Suppression (L293D)

Pin diagram:
Description:

On the L293, external high-speed output clamp diodes should be used for inductive transient
suppression. A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device
power dissipation. The L293and L293D are characterized for operation from 0C to 70C.
block diagram:

Logic diagram:
Applications:

 Audio
 Automotive
 Broadband
 Digital control
 Military
 Optical networking
 Security
 Telephony
 Video & Imaging
 Wire less

DC MOTORS

60 RPM Centre Shaft Economy Series DC Motor

Introduction

60RPM Centre Shaft Economy Series DC Motor is high quality low cost DC geared motor. It has steel gears and
pinions to ensure longer life and better wear and tear properties. The gears are fixed on hardened steel spindles
polished to a mirror finish. The output shaft rotates in a plastic bushing. The whole assembly is covered with a
plastic ring. Gearbox is sealed and lubricated with lithium grease and require no maintenance. The motor is
screwed to the gear box from inside.
Although motor gives 60 RPM at 12V but motor runs smoothly from 4V to 12V and gives wide range of RPM, and
torque. Tables below gives fairly good idea of the motor’s performance in terms of RPM and no load current as a
function of voltage and stall torque, stall current as a function of voltage.
For compatible wheels refer to Wheels and Accessories product category.

You can also mount this motor on the chassis using Motor Mount for Centre Shaft Economy Series DC Motor

For adding Position Encoder, refer to Encoder Kit for Centre Shaft Economy Series DC Motor

Specifications

 DC supply: 4 to 12V
 RPM: 60 at 12V
 Total length: 46mm
 Motor diameter: 36mm
 Motor length: 25mm
 Brush type: Precious metal
 Gear head diameter: 37mm
 Gear head length: 21mm
 Output shaft: Centred
 Shaft diameter: 6mm
 Shaft length: 22mm
 Gear assembly: Spur
 Motor weight: 100gms

Inside view of Centre Shaft Economy Series DC Motor

Motor Mounting Clamp and Position Encoder Kit for Centre Shaft Economy Series DC Motor
 

Motor performance in terms of RPM and no load Motor performance in terms of stall torque and
current as a function of input voltage stall current as a function of input voltage

Voltage (V) RPM (No Load) Current (A) Voltage (V) Stall torque (Kg/cm) Stall Current (A)
4 16 0.013 4 3.440 0.403
5 21 0.014 5 4.020 0.516
6 28 0.014 6 4.966 0.618
7 36 0.016 7 5.762 0.715
8 42 0.0 8 6.772 0.820
9 47 0.019 9 7.912 0.922
10 52 0.020 10 8.557 1.006
11 59 0.022 11 9.030 1.115
12 64 0.024 12 9.352 1.203

Active Passive Buzzer

Active Passive Buzzer Pinout


Buzzer Pin Configuration
Pin Pin Description
Number Name
1 Positive Identified by (+) symbol or longer terminal lead. Can be powered by
6V DC 
2 Negative Identified by short terminal lead. Typically connected to the ground
of the circuit
 
Buzzer Features and Specifications
 Rated Voltage: 6V DC
 Operating Voltage: 4-8V DC
 Rated current: <30mA
 Sound Type: Continuous Beep
 Resonant Frequency: ~2300 Hz 
 Small and neat sealed package
 Breadboard and Perf board friendly

How to use a Buzzer


A buzzer is a small yet efficient component to add sound features to our
project/system. It is very small and compact 2-pin structure hence can be easily used
on breadboard, Perf Board and even on PCBs which makes this a widely used
component in most electronic applications.
There are two types are buzzers that are commonly available. The one shown here is
a simple buzzer which when powered will make a Continuous Beeeeeeppp.... sound,
the other type is called a readymade buzzer which will look bulkier than this and will
produce a Beep. Beep. Beep. Sound due to the internal oscillating circuit present
inside it. But, the one shown here is most widely used because it can be customised
with help of other circuits to fit easily in our application.
This buzzer can be used by simply powering it using a DC power supply ranging from
4V to 9V. A simple 9V battery can also be used, but it is recommended to use a
regulated +5V or +6V DC supply. The buzzer is normally associated with a switching
circuit to turn ON or turn OFF the buzzer at required time and require interval.
 
Applications of Buzzer
 Alarming Circuits, where the user has to be alarmed about something
 Communication equipments
 Automobile electronics
 Portable equipments, due to its compact size

Active Passive Buzzer

Active Passive Buzzer Pinout

Buzzer Pin Configuration
Pin Pin Description
Number Name
1 Positive Identified by (+) symbol or longer terminal lead. Can be powered by
6V DC 
2 Negative Identified by short terminal lead. Typically connected to the ground
of the circuit
 
Buzzer Features and Specifications
 Rated Voltage: 6V DC
 Operating Voltage: 4-8V DC
 Rated current: <30mA
 Sound Type: Continuous Beep
 Resonant Frequency: ~2300 Hz 
 Small and neat sealed package
 Breadboard and Perf board friendly

How to use a Buzzer


A buzzer is a small yet efficient component to add sound features to our
project/system. It is very small and compact 2-pin structure hence can be easily used
on breadboard, Perf Board and even on PCBs which makes this a widely used
component in most electronic applications.
There are two types are buzzers that are commonly available. The one shown here is
a simple buzzer which when powered will make a Continuous Beeeeeeppp.... sound,
the other type is called a readymade buzzer which will look bulkier than this and will
produce a Beep. Beep. Beep. Sound due to the internal oscillating circuit present
inside it. But, the one shown here is most widely used because it can be customised
with help of other circuits to fit easily in our application.
This buzzer can be used by simply powering it using a DC power supply ranging from
4V to 9V. A simple 9V battery can also be used, but it is recommended to use a
regulated +5V or +6V DC supply. The buzzer is normally associated with a switching
circuit to turn ON or turn OFF the buzzer at required time and require interval.
 
Applications of Buzzer
 Alarming Circuits, where the user has to be alarmed about something
 Communication equipments
 Automobile electronics
 Portable equipments, due to its compact size

Power Supply

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

This power supply section is required to convert AC signal to DC signal and also to reduce the
amplitude of the signal. The available voltage signal from the mains is 230V/50Hz which is an AC
voltage, but the required is DC voltage(no frequency) with the amplitude of +5V and +12V for
various applications.

In this section we have Transformer, Bridge rectifier, are connected serially and voltage
regulators for +5V and +12V (7805 and 7812) via a capacitor (1000µF) in parallel are connected
parallel as shown in the circuit diagram below. Each voltage regulator output is again is connected to
the capacitors of values (100µF, 10µF, 1 µF, 0.1 µF) are connected parallel through which the
corresponding output(+5V or +12V) are taken into consideration.
Circuit Explanation

1) Transformer

A transformer is a device that transfers electrical energy from one circuit to another
through inductively coupled electrical conductors. A changing current in the first circuit (the
primary) creates a changing magnetic field; in turn, this magnetic field induces a changing
voltage in the second circuit (the secondary). By adding a load to the secondary circuit, one
can make current flow in the transformer, thus transferring energy from one circuit to the
other.

The secondary induced voltage VS, of an ideal transformer, is scaled from the primary
VP by a factor equal to the ratio of the number of turns of wire in their respective windings:

Basic principle

The transformer is based on two principles: firstly, that an electric current can produce
a magnetic field (electromagnetism) and secondly that a changing magnetic field within a coil
of wire induces a voltage across the ends of the coil (electromagnetic induction). By changing
the current in the primary coil, it changes the strength of its magnetic field; since the
changing magnetic field extends into the secondary coil, a voltage is induced across the
secondary.

A simplified transformer design is shown below. A current passing through the


primary coil creates a magnetic field. The primary and secondary coils are wrapped around a
core of very high magnetic permeability, such as iron; this ensures that most of the magnetic
field lines produced by the primary current are within the iron and pass through the secondary
coil as well as the primary coil.
An ideal step-down transformer showing magnetic flux in the core

Induction law

The voltage induced across the secondary coil may be calculated from Faraday's law
of induction, which states that:

Where VS is the instantaneous voltage, NS is the number of turns in the secondary coil
and Φ equals the magnetic flux through one turn of the coil. If the turns of the coil are
oriented perpendicular to the magnetic field lines, the flux is the product of the magnetic field
strength B and the area A through which it cuts. The area is constant, being equal to the
cross-sectional area of the transformer core, whereas the magnetic field varies with time
according to the excitation of the primary. Since the same magnetic flux passes through both
the primary and secondary coils in an ideal transformer, the instantaneous voltage across the
primary winding equals

Taking the ratio of the two equations for VS and VP gives the basic equation for
stepping up or stepping down the voltage
Ideal power equation

If the secondary coil is attached to a load that allows current to flow, electrical power
is transmitted from the primary circuit to the secondary circuit. Ideally, the transformer is
perfectly efficient; all the incoming energy is transformed from the primary circuit to the
magnetic field and into the secondary circuit. If this condition is met, the incoming electric
power must equal the outgoing power.

Pincoming = IPVP = Poutgoing = ISVS


giving the ideal transformer equation

Pin-coming = IPVP = Pout-going = ISVS


giving the ideal transformer equation

If the voltage is increased (stepped up) (VS > VP), then the current is decreased
(stepped down) (IS < IP) by the same factor. Transformers are efficient so this formula is a
reasonable approximation.

If the voltage is increased (stepped up) (VS > VP), then the current is decreased
(stepped down) (IS < IP) by the same factor. Transformers are efficient so this formula is a
reasonable approximation.

The impedance in one circuit is transformed by the square of the turns ratio. For
example, if an impedance ZS is attached across the terminals of the secondary coil, it appears
to the primary circuit to have an impedance of
This relationship is reciprocal, so that the impedance ZP of the primary circuit appears
to the secondary to be

Detailed operation

The simplified description above neglects several practical factors, in particular the
primary current required to establish a magnetic field in the core, and the contribution to the
field due to current in the secondary circuit.

Models of an ideal transformer typically assume a core of negligible reluctance with


two windings of zero resistance. When a voltage is applied to the primary winding, a small
current flows, driving flux around the magnetic circuit of the core. The current required to
create the flux is termed the magnetizing current; since the ideal core has been assumed to
have near-zero reluctance, the magnetizing current is negligible, although still required to
create the magnetic field.

The changing magnetic field induces an electromotive force (EMF) across each
winding. Since the ideal windings have no impedance, they have no associated voltage drop,
and so the voltages VP and VS measured at the terminals of the transformer, are equal to the
corresponding EMFs. The primary EMF, acting as it does in opposition to the primary
voltage, is sometimes termed the "back EMF". This is due to Lenz's law which states that the
induction of EMF would always be such that it will oppose development of any such change
in magnetic field.

2) Bridge Rectifier

A diode bridge or bridge rectifier is an arrangement of four diodes in a bridge


configuration that provides the same polarity of output voltage for any polarity of input
voltage. When used in its most common application, for conversion of alternating current
(AC) input into direct current (DC) output, it is known as a bridge rectifier. A bridge rectifier
provides full-wave rectification from a two-wire AC input, resulting in lower cost and weight
as compared to a center-tapped transformer design, but has two diode drops rather than one,
thus exhibiting reduced efficiency over a center-tapped design for the same output
voltage.

Basic Operation

When the input connected at the left corner of the diamond is positive with respect to
the one connected at the right hand corner, current flows to the right along the upper colored
path to the output, and returns to the input supply via the lower one.
When the right hand corner is positive relative to the left hand corner, current flows
along the upper colored path and returns to the supply via the lower colored path.

In each case, the upper right output remains positive with respect to the lower right
one. Since this is true whether the input is AC or DC, this circuit not only produces DC
power when supplied with AC power: it also can provide what is sometimes called "reverse
polarity protection". That is, it permits normal functioning when batteries are installed
backwards or DC input-power supply wiring "has its wires crossed" (and protects the
circuitry it powers against damage that might occur without this circuit in place).

Prior to availability of integrated electronics, such a bridge rectifier was always


constructed from discrete components. Since about 1950, a single four-terminal component
containing the four diodes connected in the bridge configuration became a standard
commercial component and is now available with various voltage and current ratings.
Output smoothing (Using Capacitor)

For many applications, especially with single phase AC where the full-wave bridge
serves to convert an AC input into a DC output, the addition of a capacitor may be important
because the bridge alone supplies an output voltage of fixed polarity but pulsating magnitude
(see diagram above).

The function of this capacitor, known as a reservoir capacitor (aka smoothing


capacitor) is to lessen the variation in (or 'smooth') the rectified AC output voltage waveform
from the bridge. One explanation of 'smoothing' is that the capacitor provides a low
impedance path to the AC component of the output, reducing the AC voltage across, and AC
current through, the resistive load. In less technical terms, any drop in the output voltage and
current of the bridge tends to be cancelled by loss of charge in the capacitor.
This charge flows out as additional current through the load. Thus the change of load
current and voltage is reduced relative to what would occur without the capacitor. Increases
of voltage correspondingly store excess charge in the capacitor, thus moderating the change
in output voltage / current. Also see rectifier output smoothing.

The simplified circuit shown has a well deserved reputation for being dangerous,
because, in some applications, the capacitor can retain a lethal charge after the AC power
source is removed. If supplying a dangerous voltage, a practical circuit should include a
reliable way to safely discharge the capacitor. If the normal load can not be guaranteed to
perform this function, perhaps because it can be disconnected, the circuit should include a
bleeder resistor connected as close as practical across the capacitor. This resistor should
consume a current large enough to discharge the capacitor in a reasonable time, but small
enough to avoid unnecessary power waste.

Because a bleeder sets a minimum current drain, the regulation of the circuit, defined
as percentage voltage change from minimum to maximum load, is improved. However in
many cases the improvement is of insignificant magnitude.

The capacitor and the load resistance have a typical time constant τ = RC where C and
R are the capacitance and load resistance respectively. As long as the load resistor is large
enough so that this time constant is much longer than the time of one ripple cycle, the above
configuration will produce a smoothed DC voltage across the load.

In some designs, a series resistor at the load side of the capacitor is added. The
smoothing can then be improved by adding additional stages of capacitor–resistor pairs, often
done only for sub-supplies to critical high-gain circuits that tend to be sensitive to supply
voltage noise.

The idealized waveforms shown above are seen for both voltage and current when the
load on the bridge is resistive. When the load includes a smoothing capacitor, both the
voltage and the current waveforms will be greatly changed. While the voltage is smoothed, as
described above, current will flow through the bridge only during the time when the input
voltage is greater than the capacitor voltage. For example, if the load draws an average
current of n Amps, and the diodes conduct for 10% of the time, the average diode current
during conduction must be 10n Amps. This non-sinusoidal current leads to harmonic
distortion and a poor power factor in the AC supply.

In a practical circuit, when a capacitor is directly connected to the output of a bridge,


the bridge diodes must be sized to withstand the current surge that occurs when the power is
turned on at the peak of the AC voltage and the capacitor is fully discharged. Sometimes a
small series resistor is included before the capacitor to limit this current, though in most
applications the power supply transformer's resistance is already sufficient.

Output can also be smoothed using a choke and second capacitor. The choke tends to
keep the current (rather than the voltage) more constant. Due to the relatively high cost of an
effective choke compared to a resistor and capacitor this is not employed in modern
equipment.

Some early console radios created the speaker's constant field with the current from
the high voltage ("B +") power supply, which was then routed to the consuming circuits,
(permanent magnets were considered too weak for good performance) to create the speaker's
constant magnetic field. The speaker field coil thus performed 2 jobs in one: it acted as a
choke, filtering the power supply, and it produced the magnetic field to operate the speaker.

3) Voltage Regulator

A voltage regulator is an electrical regulator designed to automatically maintain a


constant voltage level.

The 78xx (also sometimes known as LM78xx) series of devices is a family of self-
contained fixed linear voltage regulator integrated circuits. The 78xx family is a very popular
choice for many electronic circuits which require a regulated power supply, due to their ease
of use and relative cheapness. When specifying individual ICs within this family, the xx is
replaced with a two-digit number, which indicates the output voltage the particular device is
designed to provide (for example, the 7805 has a 5 volt output, while the 7812 produces 12
volts). The 78xx line is positive voltage regulators, meaning that they are designed to produce
a voltage that is positive relative to a common ground. There is a related line of 79xx devices
which are complementary negative voltage regulators. 78xx and 79xx ICs can be used in
combination to provide both positive and negative supply voltages in the same circuit, if
necessary.

78xx ICs have three terminals and are most commonly found in the TO220 form
factor, although smaller surface-mount and larger TrO3 packages are also available from
some manufacturers. These devices typically support an input voltage which can be anywhere
from a couple of volts over the intended output voltage, up to a maximum of 35 or 40 volts,
and can typically provide up to around 1 or 1.5 amps of current (though smaller or larger
packages may have a lower or higher current rating).

CHAPTER-5
SOFTWARE DESCRIPTION

5.1. RASPBERRY PI OS:

5.1.1. INTRODUCTION:

Raspbian is a free operating system based on Debian optimized for the Raspberry Pi
hardware. An operating system is the set of basic programs and utilities that make your
Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over
35,000 packages pre-compiled software bundled in a nice format for easy installation on your
Raspberry Pi. The initial build of over 35,000 Raspbian packages, optimized for best
performance on the Raspberry Pi, was completed in June of 2012. However, Raspbian is still
under active development with an emphasis on improving the stability and performance of as
many Debian packages as possible.

5.1.2. Preparing your SD card for the Raspberry Pi

The SD card contains the Raspberry Pi’s operating system (the OS is the software that makes
it work, like Windows on a PC or OSX on a Mac). This is very different from most
computers and it is what many people find the most daunting part of setting up their
Raspberry Pi. It is actually very straightforward— just different!

The following instructions are for Windows users.

 Download the Raspberry Pi operating system (The recommended OS is called


Raspbian)
 Unzip the file that you just downloaded
 Right click on the file and choose “Extract all”.
 Follow the instructions—you will end up with a file ending in .img
 This .img file can only be written to your SD card by special disk imaging software.
5.1.3. Download the Win32DiskImager software.
 Download win32diskimager-binary.
 Unzip it in the same way you did the Raspbian .zip file
 You now have a new folder called win32diskimager-binary You are now ready to
write the Raspbian image to your SD card.
5.1.4 Writing Raspbian to the SD card
Run the file named Win32DiskImager.exe (in Windows Vista, 7 and 8 we recommend
that you right-click this file and choose “Run as administrator”). You will see something like
this:

Figure 5.2.4. Win32 disk imager


 Plug your SD card into your PC
 In the folder you made in step 3(b),
 If the SD card (Device) you are using isn’t found automatically then click on the drop
down box and select it
 In the Image File box, choose the Raspbian .img file that you downloaded
 Click Write
 After a few minutes you will have an SD card that you can use in your Raspberry Pi
5.1.5 Booting your Raspberry Pi for the first time
 insert SD card in to raspberry pi b+ board
 On first boot you will come to the Raspi-config window
 Change settings such as timezone and locale if you want
 Finally, select the second choice: expand_rootfs and say ‘yes’ to a reboot
 The Raspberry Pi will reboot and you will see raspberrypi login:
 Type: pi
 You will be asked for your Password
 Type: raspberry
 You will then see the prompt: pi@raspberry ~ $
 Start the desktop by typing: startx
 You will find yourself in a familiar-but-different desktop environment.
 Experiment to start a new python project.
Remote Desktop on the Raspberry Pi with
VNC
Introduction
If you like the idea of a headless computer setup for your Raspberry Pi (i.e. one without a
keyboard, mouse, or monitor) but want access to the full graphical desktop, then you're in luck!
By using a Virtual Network Computing (VNC) program, you can access a remote desktop over
the network!
For schools and individuals that need to use the full desktop for certain applications (Scratch,
creating your own graphical interface, etc.), using a VNC client to access your Raspberry Pi
might be the way to go.

Using RealVNC to access the Raspberry Pi's graphical desktop

The good news is that Raspbian (the recommended Raspberry Pi operating system) comes with
RealVNC installed by default. The bad news is that we need to enable it using some other
means.

(Optional) Install RealVNC


By default, Raspbian should come with a VNC server (RealVNC) installed. If you are using
another operating system, you might need to install RealVNC. With most flavors of Debian (e.g.
Raspbian is built on top of Debian), you should be able to use apt-get to install RealVNC. In a
terminal, enter the following:

COPY CODEsudo apt-get update


sudo apt-get install real-vnc-server
sudo apt-get install real-vnc-client

Enable the VNC Server


You will need to go into the Raspberry Pi configuration tool to turn on the VNC server:

COPY CODEsudo raspi-config


Select Interfacing Option, and then select VNC. On the next screen, select Yes, and
press enter to save the changes.

Feel free to make any other changes you might like, including setting a new password and
changing the keyboard layout.
Back in the raspi-config homescreen, press right arrow twice to select Finish and press enter.

Use VNC Over a Local Network


If your host computer is on the same local network (e.g. connected to the same WiFi or Ethernet
network), then you can make a direct VNC connection to your Raspberry Pi. This method has
several up sides: it's the easier option, does not require signing up for a RealVNC account, and
can be done on a closed network (i.e. one not connected to the Internet). The down side is that
you must be on the same network to access your Pi (i.e. physically connected or through a VPN).
This is a known as a direct connection.
If you want to to access your Raspberry Pi over the Internet, then see the next section.
Still in your Raspberry Pi's terminal, enter the following command:
COPY CODEifconfig
Copy down the Raspberry Pi's IP address, which is given as a series of 4 numbers next to inet. If
you are connected over WiFi, this will appear under the wlan0 settings. If you are connected over
Ethernet, this will appear under the eth0 settings.

On your host computer, head to the RealVNC Viewer downloads page to download the VNC
client (known as VNC Viewer) for your operating system. Install it, accepting all the defaults.
Open VNC Viewer. At the top address bar, enter the IP address of the Raspberry Pi (once again,
make sure your host computer and Pi are on the same network!).
Press enter, and click Continue when warned that "VNC Server not recognized." You should be
prompted with an Authentication window. If you did not change the login username and
password for your Pi, your default login credentials are:

 Username: pi
 Password: raspberry

Heads up: it's highly recommended that you change your password! Anyone with access to your
network could easily gain access to your Pi by trying the default username and password.
Once you successfully authenticate, you should be presented with your Raspberry Pi's graphical
desktop. Now, you can do everything remotely as if you were sitting in front of your Pi with a
keyboard, mouse, and monitor! If you hover your mouse over the top part of the window, you
should see a drop-down box appear, giving you access to the various RealVNC settings,
including closing the session.
5.2. IDLE Python Programming

IDLE is the standard Python development environment Its name is an acronym of


"Integrated Development environment". It works well on both Unix and Windows platforms.
it has a Python shell window, which gives you access to the Python interactive mode. It also
has a file editor that lets you create and edit existing Python source files. The IDLE IDE
(Integrated Development Environment) is included with the Raspbian image.  

Figure 5.2.5: Python shell


Starting Programming With IDLE:

Run IDLE which will open the Python Shell window.

Select Menu > File > New Window

To run it select Menu > Run > Run Module and you should see your program appear in the
Python Shell window.

1. Start IDLE (see screen above). You will then see a window entitled "Python Shell"
2. From the Python Shell window, select New Window from the File menu.
3. You will see a window entitled "Untitled
4. From the File menu, select Save As, and select a folder to save your Python program
file.

5. Select a folder to save your file in.


In the File name: text box, type: program1.py
6. Then click on the Save button. You will then see a blank editor window ready for you
to type in your Python program.
7. To run this program, select Run Module from the Run menuYou should see a
reminder to save the Source (your program).
8. Click on OK to save. Then you will see your program running in a Python Shell
window.

Python is a widely used general-purpose, high-level programming language. Its


design philosophy emphasizes code readability, and its syntax allows programmers to express
concepts in fewer lines of code than would be possible in languages such as C++ or Java. The
language provides constructs intended to enable clear programs on both a small and large
scale. Python supports multiple programming paradigms, including object oriented,
imperative  and functional programming or procedural styles. It features a dynamic
type system and automatic memory management and has a large and comprehensive standard
library. Python interpreters are available for installation on many operating systems, allowing
Python code execution on a wide variety of systems. Using third-party tools, such
as Py2exe or Python installer, Python code can be packaged into stand-alone executable
programs for some of the most popular operating systems, allowing the distribution of
Python-based software for use on those environments without requiring the installation of a
Python interpreter.

C Python, the reference implementation of Python, is free and open-source


software and has a community-based development model, as do nearly all of its alternative
implementations. C Python is managed by the non-profit Python Software Foundation.
CHAPTER-6
RESULT ANALYSYS

The proposed method is tested for restoring videos which are degraded by haze or fog.
Experiments are done to evaluate the quality of dehazing as well as real time performance of the
proposed method. The real-time operation performance is characterized in terms of the frames per
second (fps) that the digital system is able to process. The results of the proposed method are
shown in Figures below.

Fig6.1 proposed Dehazing image


CHAPTER-7

CONCLUSION
Introduced an efficient method to dehaze fog in real time. This method was assessed in
terms of precision of image dehazing for restoring real-time foggy videos. The obtained results
shows superior performance of the proposed method comparing with well known existing methods
such as the dark channel prior and the color attenuation prior. According to the obtained
experimental results, the proposed method can effectively reduce the impacts of fog at high rate
from real time video input with high accuracy and without introducing noticeable over processing
artifacts.

REFERENCES

[1]. P. Chavez, “An improved dark-object subtraction technique for at- mospheric scattering
correction of multispectral data,”Remote Sens. Environ., vol. 24, no. 3, pp. 459479, 1988..

[2]. R. Fattal, (2005) “Single image dehazing”, ACM Trans. Graph., vol. 27, no. 3, pp. 72, Aug. 2008.

[3]. R. T. Tan, (2015) “Visibility in bad weather from a single image”,

[4]. Proc. IEEE Comput. Vis. Pattern Recognit., pp. 1- 8, Jun. 2008.. [5]. Victor H. Diaz-Ramirez, (2017)
“Real-time haze removal in monocular images using locally adaptive processing”, Journal of Real-
Time Image Processing..

You might also like