0% found this document useful (0 votes)
141 views78 pages

Raspberry Pi Based Black Box

This document describes a raspberry pi-based black box device that can be installed in vehicles to monitor and record data in the event of an accident. The black box uses a camera module, sensors for temperature, humidity, and motion detection to continuously log video, images, and sensor data to an SD card. This recorded information can then be accessed after an accident to help investigators determine the scenario and cause. The goal is to help lower accident fatalities by providing crucial information more quickly to emergency responders.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
141 views78 pages

Raspberry Pi Based Black Box

This document describes a raspberry pi-based black box device that can be installed in vehicles to monitor and record data in the event of an accident. The black box uses a camera module, sensors for temperature, humidity, and motion detection to continuously log video, images, and sensor data to an SD card. This recorded information can then be accessed after an accident to help investigators determine the scenario and cause. The goal is to help lower accident fatalities by providing crucial information more quickly to emergency responders.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 78

RASPBERRY PI BASED BLACK BOX

Abstract

Nowadays, people are facing one of the most and biggest problems which is an accident. Most
people are dying because of accidents. The death rate or even the smallest accident rate is
increasing day by day. Traveling is an important part of life, whether it is a workplace or any
other. The main reason for death recorded is due to the lack of unavailability of medical services
at the accident. Another cause that i personally think is the lack of co-operation of people to
follow signals. Practically thinking one cannot prevent or stop any kind of accident but can lower
the post-trauma. In present days we can see that every single person may come across with
accidents and this is one of the critical situations. Few people can survive and few people may
lose their lives, which occurs due to lack of information. To overcome these problems, a black
box came into existence. The main objective of the car black box using raspberry pi is to develop
a hardware system that will monitor image and video, motion detection, humidity & temperature
in real-time continuously on an SD card. So, any input can be logged into memory so that any
authenticated person can observe the specific data from any place (here from the same place too.
The data is stored in the SD card that is externally connected to the Raspberry pi. The
information is collected by Raspberry Pi processors using a camera module and other sensors
which are connected to the raspberry pi which is Linux based operating system that will give all
the collected data information to the monitoring system. The monitoring system will display the
data (if needed and wanted) in real-time which helps the investigation to find out the scenario of
the accident that occurred.
INTRODUCTION

In present situation any accident occurs the information about an accident is needed to find out
the cause of the accident. In this case the investigators should know about the accident at that
time the Black box is more useful. Then the investigators should easily know about the accident
[14]. The car black box is one of the promising and easy solutions for people’s safety. The car
black box is like a CCTV (Closed Circuit Television) that will record video, images, sound, time,
and many more parameters if included. We can call it an event data recorder as called in-flight
data recorder and older versions of the black box. The Black Box is a concept taken from the
aviation industry, a flight recorder, known as a black box, is an electronic recording device
placed in an aircraft for an investigation of aviation accidents. With the advance in the
technology and cost coming down, in our project we attempt to build a similar device for cars[1].
Fig.1 1 shows the flight data recorder.    

According to the World Health Organization, more than a million people in the world die each
year because of transportation-related accidents. Now a day, the technology has made amazing
facilities to have well designed cars. Some of the cars have more facilities compared to branded
cars. They have more speed and other Special features so that we are introducing devices which
can control or monitor the parameters of car [12]. To react to this situation, the black box system
draws the first step to solve the problem. Like flight data recorders in aircraft, "Black Box”
technology can now play a key role in motor vehicle crash investigations. A significant number
of vehicles currently on the roads contain electronic systems that record in the event of a crash
[1]. That is why it is so important to have recorders that objectively track what goes on in
vehicles before, during, and after a crash as a complement to the was used. Subjective input is
taken usually from victims, eyewitnesses, and police reports. The basic functions of a black box
system should include continuous audio/visual recording for both the front and rear of the
vehicle. This will be part of the voice and visual recorder. The next part of the black box system
is the vehicle data recorder including the status of the vehicle. Here to make it simple and easy to
access, we used a Camera sensor, PIR Motion Sensor, DHT11 humidity and temperature sensor,
and RTC. 

 
The problem statement associated with the accident is the victims depend on the help of nearby
people. There are chances where no people nearby the accident spot or people who are around
neglect the accident. This case can be possibly related to the place which is far away from a
living area like near hill station and at night time too. There are many solutions proposed for the
concerned problem and each one has some advantage over the others. All are trying to make the
best system to save people’s lives. Most of them have used a microcontroller for this purpose.
But the existing systems are available only in high-end vehicles because the monitoring system is
expensive. The Black Box will give us an easy solution that can be used in the vehicle. System
Boundary can be Vehicle, Climate conditions, Vibrations, Sufficient Power. The main problem
that I have faced not just once but three times is hardware that is SD card and sensors
compatibility.
INTRODUCTION TO EMBEDDED SYSTEMS

Each day, our lives become more dependent on 'embedded systems', digital information
technology that is embedded in our environment. More than 98% of processors applied today are
in embedded systems, and are no longer visible to the customer as 'computers' in the ordinary
sense. An Embedded System is a special-purpose system in which the computer is completely
encapsulated by or dedicated to the device or system it controls. Unlike a general-purpose
computer, such as a personal computer, an embedded system performs one or a few pre-defined
tasks, usually with very specific requirements. Since the system is dedicated to specific tasks,
design engineers can optimize it, reducing the size and cost of the product. Embedded systems
are often mass-produced, benefiting from economies of scale. The increasing use of PC hardware
is one of the most important developments in high-end embedded systems in recent years.
Hardware costs of high-end systems have dropped dramatically as a result of this trend, making
feasible some projects which previously would not have been done because of the high cost of
non-PC-based embedded hardware. But software choices for the embedded PC platform are not
nearly as attractive as the hardware.

Typically, an embedded system is housed on a single microprocessor board with the


programs stored in ROM. Virtually all appliances that have a digital interface -- watches,
microwaves, VCRs, cars -- utilize embedded systems. Some embedded systems include an
operating system, but many are so specialized that the entire logic can be implemented as a
single program.

Physically, Embedded Systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants.
In terms of complexity embedded systems can range from very simple with a single
microcontroller chip, to very complex with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.

Definition of an Embedded System

Embedded system is defined as, For a particular/specific application implementing the


software code to interact directly with that particular hardware what we built. Software is used
for providing features and flexibility, Hardware = {Processors, ASICs, Memory,...} is used for
Performance (& sometimes security)

There are many definitions of embedded system but all of these can be combined into a
single concept. An embedded system is a special purpose computer system that is used for
particular task.

Features of Embedded Systems

The versatility of the embedded computer system lends itself to utility in all kinds of enterprises,
from the simplification of deliverable products to a reduction in costs in their development and
manufacture. Complex systems with rich functionality employ special operating systems that
take into account major characteristics of embedded systems. Embedded operating systems have
minimized footprint and may follow real-time operating system specifics.

The special computers system is usually less powerful than general-purpose systems, although
some expectations do exist where embedded systems are very powerful and complicated.
Usually a low power consumption CPU with a limited amount of memory is used in embedded
systems. Many embedded systems use very small operating systems; most of these provide very
limited operating system capabilities.

Since the embedded system is dedicated to specific tasks, design engineers can optimize it,
reducing the size and cost of the product, or increasing the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.
Some embedded systems have to operate in extreme environment conditions such as very high
temperature & humidity.

For high volume systems such as portable music players or mobile phones, minimizing cost is
usually the primary design consideration. Engineers typically select hardware that is just “good
enough” to implement the necessary functions.

For low volume or prototype embedded systems, general purpose computers may be adapted by
limiting the programs or by replacing the operating system with a real-time operating system.

Characteristics of Embedded Systems

Embedded computing systems generally exhibit rich functionality—complex functionality is


usually the reason for introducing CPUs into the design. However, they also exhibit many non-
functional requirements that make the task especially challenging:

• Real-time deadlines that will cause system failure if not met;

• Multi-rate operation;

• In many cases, low power consumption;

• Low manufacturing cost, which often means limited code size.

Workstation programmers often concentrate on functionality. They may consider the


performance characteristics of a few computational kernels of their software, but rarely analyze
the total application. They almost never consider power consumption and manufacturing cost.
The need to juggle all these requirements makes embedded system programming very
challenging and is the reason why embedded system designers need to understand computer
architecture.
Overview of an Embedded System Architecture

Every Embedded system consists of a custom-built hardware built around a central processing
unit. This hardware also contains memory chips onto which the software is loaded.

Application Software

Operating
System
H/W

The operating system runs above the hardware and the application software runs above the
operating system. The same architecture is applicable to any computer including desktop
computer. However these are significant differences. It is not compulsory to have an operating
system in every embedded system. For small applications such as remote control units, air
conditioners, toys etc.

Applications of Embedded Systems

Some of the most common embedded systems used in everyday life are

Small embedded controllers: 8-bit CPUs dominate, simple or no operating system

(e.g., thermostats)
Control systems: Often use DSP chip for control computations

(e.g., automotive engine control)

Distributed embedded control: Mixture of large and small nodes on a real-time

Embedded networks

(e.g., cars, elevators, factory automation)

System on chip: ASIC design tailored to application area

(e.g., consumer electronics, set- top boxes)

Network equipment: Emphasis on data movement/packet flow

(e.g., network switches; telephone switches)

Critical systems: Safety and mission critical computing

(e.g., pacemakers, automatic trains)

Signal processing: Often use DSP chips for vision, audio, or other signal

Processing (e.g., face recognition)

Robotics: Uses various types of embedded computing (especially

Vision and control) (e.g., autonomous vehicles)

Computer peripherals: Disk drives, keyboards, laser printers, etc.

Wireless systems: Wireless network-connected “sensor networks” and

“Motes” to gather and report information

Embedded PCs: Palmtop and small form factor PCs embedded into

Equipment

Command and control: Often huge military systems and “systems of systems”
(e.g., a fleet of warships with interconnected

Computers)

Home Appliances, intercom, telephones, security systems, garage door openers, answering
machines, fax machines, home computers, TVs, cable TV tuner, VCR, camcorder, remote
controls, video games, cellular phones, musical instruments, sewing machines, lighting control,
paging, camera, pinball machines, toys, exercise equipment

Office Telephones, computers, security systems, fax machines, microwave, copier, laser printer,
color printer, paging

Auto Trip computer, engine control, air bag, ABS, instrumentation, security system,
transmission control, entertainment, climate control, cellular phone, keyless entry

TYPES OF EMBEDDED SYSTEMS

Based on functionality and performance embedded systems categorized as 4 types

1. Stand alone embedded systems

2. Real time embedded systems

3. Networked information appliances

4. Mobile devices

1. Stand alone embedded systems:-

As the name implies, stand alone systems work in stand alone mode. They take i/p, process them
and produce the desire o/p. The i/p can be an electrical signal from transducer or temperature
signal or commands from human being. The o/p can be electrical signal to drive another system
an led or LCD display
ex digital camera, microwave oven, CD player, Air conditioner etc

2. Real time embedded systems:-

In this type of an embedded system a specific work has to be complete in a particular


period of time.

Hard Real time systems: - embedded real time used in missiles

Soft Real time systems: - DVD players

3. Networked information appliances:-

Embedded systems that are provided with n/w interfaces and accessed by n/w such as local area
n/w or internet are called Network Information Appliances

Ex A web camera is connected to the internet. Camera can send pictures in real time to any
computers connected to the internet

4. Mobile devices:-

Actually it is a combination of both VLSI and Embedded System

Mobile devices such as Mobile phone, Personal digital assistants, smart phones etc are special
category of embedded systems
MICROCONTROLLER VERSUS MICROPROCESSOR

A system designer using a general-purpose microprocessor such as the Pentium or the 68040
must add RAM, ROM, I/O ports, and timers externally to make them functional. Although the
addition of external RAM, ROM, and I/O ports makes these systems bulkier and much more
expensive, they have the advantage of versatility such that the designer can decide on the amount
of RAM, ROM and I/O ports needed to fit the task at hand.

A Microcontroller has a CPU (a microprocessor) in addition to a fixed amount of RAM,


ROM, I/O ports, and a timer all on a single chip. In other words, the processor, the RAM, ROM,
I/O ports and the timer are all embedded together on one chip; therefore, the designer cannot add
any external memory, I/O ports, or timer to it. The fixed amount of on-chip ROM, RAM, and
number of I/O ports in Microcontrollers makes them ideal for many applications in which cost
and space are critical.
CPU platform:

Embedded processors can be broken into two distinct categories: microprocessors (μP) and
microcontrollers (μC). Microcontrollers have built-in peripherals on the chip, reducing size of
the system.

There are many different CPU architectures used in embedded designs such as ARM, MIPS,
Cold fire /68k, PowerPC, x86, PIC, 8051, Atmel AVR, Renesas H8, SH, V850, FR-V, M32R,
Z80, Z8, etc. This in contrast to the desktop computer market, which is currently limited to just a
few competing architectures.
PC/104 and PC/104+ are a typical base for small, low-volume embedded and ruggedized system
design. These often use DOS, Linux, NetBSD, or an embedded real-time operating system such
as QNX or VxWorks.

A common configuration for very-high-volume embedded systems is the system on a chip (SoC),
an application-specific integrated circuit (ASIC), for which the CPU core was purchased and
added as part of the chip design. A related scheme is to use a field-programmable gate array
(FPGA), and program it with all the logic, including the CPU.

Embedded systems are based on the concept of the microcontroller, a single integrated circuit
that contains all the technology required to run an application. Microcontrollers make integrated
systems possible by combining several features together into what is effectively a complete
computer on a chip, including:
* Central Processing Unit
* Input/Output interfaces (such as serial ports)
* Peripherals (such as timers)
* ROM, EEPROM or Flash memory for program storage
* RAM for data storage
* Clock generator

By integrating all of these features into a single chip it is possible to greatly reduce the number of
chips and wiring necessary to control an electronic device, dramatically reducing its complexity,
size and cost.

* Size & Weight: Microcontrollers are designed to deliver maximum performance for minimum
size and weight. A centralized on-board computer system would greatly outweigh a collection of
microcontrollers.
* Efficiency: Microcontrollers are designed to perform repeated functions for long periods of
time without failing or requiring service.

Based on the Processor side Embedded Systems is mainly divided into 3 types

1. Micro Processor: - are for general purpose eg: our personal computer
2. Micro Controller: - are for specific applications, because of cheaper cost we will go for these

3. DSP (Digital Signal Processor): - are for high and sensitive application purpose

EXISTING METHOD

The black box already exists in aircraft systems such as Airplanes and helicopters. It can be more
useful if any accident or crash occurs. At that time it can record the whole data about the
incident. So that it can helpful at the time of investigation. The GSM module can immediately
send the SMS to the provided mobile numbers. The GPS is used to know the location of the
incident. It can record the voice.

Proposed System:

Block Diagram

display
GPRS

Raspberry
server
temperature

gas
L298N

Mems

Mouse

Raspberry pi

We think you’re going to love the Raspberry Pi. This ultra-small, affordable computer costs less
than most video games, but can be used to learn coding, build robots, and create all kinds of
weird and wonderful projects. The Raspberry Pi is capable of doing all the things you’d expect
from a computer – everything from browsing the internet and playing games, to watching movies
and listening to music. But the Raspberry Pi is much more than a modern computer. With a
Raspberry Pi you can get into the heart of a computer. You get to set up your own operating
system, and can connect wires and circuits directly to the pins on its board. It was designed to
teach young people how to program in languages like Scratch and Python, and all the major
programming languages are included with the official operating system. The world needs
programmers more than ever, and the Raspberry Pi has ignited a love of computer science and
technology in a new generation. People of all ages use the Raspberry Pi to create exciting
projects: everything from retro games consoles to internet connected weather stations. So if you
want to make games, build robots, or hack weird and wonderful projects, then this book is here
to help you get started.

The Raspberry Pi is a remarkable device: a fully functional computer in a tiny and low-cost
package. Whether you’re looking for a device you can use to browse the web or play games, are
interested in learning how to write your own programs, or are looking to create your own circuits
and physical devices, the Raspberry Pi – and its amazing community – will support you every
step of the way. The Raspberry Pi is known as a single-board computer, which means exactly
what it sounds like: it’s a computer, just like a desktop, laptop, or smart phone, but built on a
single printed circuit board. Like most single-board computers, the Raspberry Pi is small –
roughly the same footprint as a credit card – but that doesn’t mean it’s not powerful: a Raspberry
Pi can do anything a bigger and more power-hungry computer can do, though not necessarily as
quickly. The Raspberry Pi family was born from a desire to encourage more hands-on computer
education around the world. Its creators, who joined together to form the non-profit Raspberry Pi
Foundation, had little idea that it would prove so popular: the few thousand built in 2012 to test
the waters were immediately sold out, and millions have been shipped all over the world in the
years since. These boards have found their ways into homes, classrooms, offices, data centers,
factories, and even self-piloting boats and space faring balloons. Various models of Raspberry Pi
have been released since the original Model B, each bringing either improved specifications or
features specific to a particular use-case. The Raspberry Pi Zero family, for example, is a tiny
version of the full-size Raspberry Pi which drops a few features – in particular the multiple USB
ports and wired network port – in favour of a significantly smaller layout and lowered power
needs.
The name system-on-chip is a great indicator of what you would find if you prised the metal
cover off: a silicon chip, known as an integrated circuit, which contains the bulk of the Raspberry
Pi’s system. This includes the central processing unit (CPU), commonly thought of as the ‘brain’
of a computer, and the graphics processing unit (GPU), which handles the visual side of things.
A brain is no good without memory, however, and on the underside of the Raspberry Pi you’ll
find exactly that: another chip, which looks like a small, black, plastic square (Figure 1-3). This
is the Pi’s random access memory (RAM). When you’re working on the Pi, it’s the RAM that
holds what you’re doing; only when you save your work will it be written to the microSD card.
Together, these components form the Pi’s volatile and non-volatile memories: the volatile RAM
loses its contents whenever the Pi is powered off, while the non-volatile microSD card keeps its
contents.

Pin description
the numbering of the GPIO pins is not in numerical order; GPIO pins 0 and 1 are present on the
board (physical pins 27 and 28) but are reserved for advanced use (see below).

Voltages

Two 5V pins and two 3V3 pins are present on the board, as well as a number of ground pins
(0V), which are unconfigurable. The remaining pins are all general purpose 3V3 pins, meaning
outputs are set to 3V3 and inputs are 3V3-tolerant.

Outputs

A GPIO pin designated as an output pin can be set to high (3V3) or low (0V).

Inputs

A GPIO pin designated as an input pin can be read as high (3V3) or low (0V). This is made
easier with the use of internal pull-up or pull-down resistors. Pins GPIO2 and GPIO3 have fixed
pull-up resistors, but for other pins this can be configured in software.

More

As well as simple input and output devices, the GPIO pins can be used with a variety of
alternative functions, some are available on all pins, others on specific pins.

PWM (pulse-width modulation)

Software PWM available on all pins

Hardware PWM available on GPIO12, GPIO13, GPIO18, GPIO19

SPI

SPI0: MOSI (GPIO10); MISO (GPIO9); SCLK (GPIO11); CE0 (GPIO8), CE1 (GPIO7)

SPI1: MOSI (GPIO20); MISO (GPIO19); SCLK (GPIO21); CE0 (GPIO18); CE1 (GPIO17);
CE2 (GPIO16)

I2C

Data: (GPIO2); Clock (GPIO3)


EEPROM Data: (GPIO0); EEPROM Clock (GPIO1)

Serial

TX (GPIO14); RX (GPIO15)

Working:

The Raspberry Pi board comes equipped with an SD card. This slot permits us to insert an SD
card and that can use it as our devices. The SD card is a main storage device for raspberry pi
board like a hard disk of a personal computer. The bootable Linux operating system is loaded
onto the card, you are planning to use. The raspberry pi supports Linux, Qtonpi, ARM, Mac
operating systems. You can select one OS; you will need to write it to an SD card using a Disk
manager application. You can also use other storage mechanism, like USB external hard drive or
USB drive. There are a numerous brands of SD cards are available in the market in  different
sizes. The raspberry pi supports max 64 GB SD card.

Before you start your raspberry pi, you are goin g to need to connect a display, keyboard, mouse
like as a PC. It supports three different O/Ps like  HDMI video, composite video, and DSI video,
where the DSI video needs some specific hardware. When you buy a raspberry pi board it may
sold with or without an SD card. It is a very important specification  in raspberry pi board.
Because, it keeps its operating system, documents and programs. If your raspberry pi did not
come with an SD card, then the min size you should get is 4GB.

Advantages of the raspberry pi is, it is small in size, and it works as a normal computer at low
cost server to handle web traffic.

The Raspberry pi is a single computer board with credit card size, that can be used for many
tasks that your computer does, like games, word processing, spreadsheets and also to play HD
video. It was established by the Raspberry pi foundation from the UK. It has been ready for
public consumption  since 2012 with the idea of making a low-cost educational microcomputer
for students and children. The main purpose of designing the raspberry pi board is, to encourage
learning, experimentation and innovation for school level students. The raspberry pi board is a
portable and low cost. Maximum of the raspberry pi computers is used in mobile phones. In the
2st century, the growth of mobile computing technologies is very high, a huge segment of this
being driven by the mobile industries. The 98% of the mobile phones were using ARM
technology.

Model A Raspberry Pi Board

The Raspberry Pi board is a Broadcom (BCM2835) SOC (system on chip) board. It comes
equipped with an ARM1176JZF-S core CPU, 256 MB of SDRAM and 700 MHz,. The raspberry
pi USB 2.0 ports use only external data connectivity options. The board draws its power from a
micro-USB adapter, with min range of 2. Watts (500 MA). The graphics, specialized chip is
designed to speed up the operation of image calculations. This is in built with Broadcom video
core IV cable, that is useful if you want to run a game and video through your raspberry pi.

Model B Raspberry pi Board

The Raspberry Pi is a Broadcom BCM2835 SOC (system on chip board). It comes equipped with
a 700 MHz, 512 MB of SDRAM  and ARM1176JZF-S core CPU. The USB 2.0 port of the
raspberry pi boars uses only external data connectivity options. The Ethernet in the raspberry pi
is the main gateway to interconnect with other devices and the internet in model B. This draws
its power from a micro USB adapter, with a minimum range of 2.5 watts(500 MA). The
graphics, specialized chip is designed to speed up the manipulation of image calculations. This is
in built with Broadcom video core IV cable, that is useful if you want to run a game and video
through your raspberry pi.

Model B raspberry pi board

Features of Raspberry PI Model B

 512 MB SDRAM memory


 Broadcom BCM2835 SoC full high-definition multimedia processor
 Dual Core Video Core IV Multimedia coprocessor
 Single 2.0 USB connector
 HDMI (rev 1.3 and 1.4) Composite RCA (PAL & NTSC) Video Out
 3.5 MM Jack, HDMI Audio Out
 MMC, SD, SDIO Card slot on board storage
 Linux Operating system
 Dimensions are 8.6cm*5.4cm*1.7cm
 On board 10/100 Ethernet RJ45 jack

Features of Raspberry PI Model A

 The Model A raspberry pi features mainly includes


 256 MB SDRAM memory
 Single 2.0 USB connector
 Dual Core Video Core IV Multimedia coprocessor
 HDMI (rev 1.3 & 1.4) Composite RCA (PAL and NTSC) Video Out
 3.5 MM Jack, HDMI, Audio Out
 SD, MMC, SDIO Card slot on board storage
 Linux Operating system
 Broadcom BCM2835 SoC full HD multimedia processor
 8.6cm*5.4cm*1.5cm dimensions

Applications of Raspberry Pi

The raspberry pi boards are used in many applications like Media streamer, Arcade machine,
Tablet computer, Home automation, Carputer, Internet radio, Controlling robots, Cosmic
Computer, Hunting for meteorites, Coffee and also in raspberry pi based projects.

The Raspberry Pi (/paɪ/) is a series of small single-board computers developed in the


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

The organisation behind the Raspberry Pi consists of two arms. The first two models were
developed by the Raspberry Pi Foundation. After the Pi Model B was released, the Foundation
set up Raspberry Pi Trading, with Eben Upton as CEO, to develop the third model, the B+.
Raspberry Pi Trading is responsible for developing the technology while the Foundation is an
educational charity to promote the teaching of basic computer science in schools and in
developing countries.

According to the Raspberry Pi Foundation, more than 5 million Raspberry Pis were sold by
February 2015, making it the best-selling British computer. By November 2016 they had sold 11
million units, and 12.5m by March 2017, making it the third best-selling "general purpose
computer". In July 2017, sales reached nearly 15 million. In March 2018, sales reached 19
million.

Most Pis are made in a Sony factory in Pencoed, Wales Some are made in China and Japan.

Several generations of Raspberry Pis have been released. All models feature a Broadcom system
on a chip (SoC) with an integrated ARM-compatible central processing unit (CPU) and on-chip
graphics processing unit (GPU).

Processor speed ranges from 700 MHz to 1.4 GHz for the Pi 3 Model B+ or 1.5 GHz for the Pi 4;
on-board memory ranges from 256 MB to 1 GB random-access memory (RAM), with up to
4 GB available on the Pi 4. Secure Digital (SD) cards in MicroSDHC form factor (SDHC on
early models) are used to store the operating system and program memory. The boards have one
to five USB ports. For video output, HDMI and composite video are supported, with a standard
3.5 mm tip-ring-sleeve jack for audio output. Lower-level output is provided by a number of
GPIO pins, which support common protocols like I²C. The B-models have an 8P8C Ethernet port
and the Pi 3, Pi 4 and Pi Zero W have on-board Wi-Fi 802.11n and Bluetooth. Prices range from
US$5 to $55.

The first generation (Raspberry Pi 1 Model B) was released in February 2012, followed by the
simpler and cheaper Model A. In 2014, the Foundation released a board with an improved
design, Raspberry Pi 1 Model B+. These boards are approximately credit-card sized and
represent the standard mainline form-factor. Improved A+ and B+ models were released a year
later. A "Compute Module" was released in April 2014 for embedded applications. The
Raspberry Pi 2, which added more RAM, was released in February 2015.

A Raspberry Pi Zero with smaller size and reduced input/output (I/O) and general-purpose
input/output (GPIO) capabilities was released in November 2015 for US$5. On 28 February
2017, the Raspberry Pi Zero W was launched, a version of the Zero with Wi-Fi and Bluetooth
capabilities, for US$10. On 12 January 2018, the Raspberry Pi Zero WH was launched, a version
of the Zero W with pre-soldered GPIO headers.

Raspberry Pi 3 Model B was released in February 2016 with a 1.2 GHz 64-bit quad core
processor, on-board 802.11n Wi-Fi, Bluetooth and USB boot capabilities. On Pi Day 2018 the
Raspberry Pi 3 Model B+ was launched with a faster 1.4 GHz processor and a three-times faster
gigabit Ethernet (throughput limited to ca. 300 Mbit/s by the internal USB 2.0 connection) or 2.4
/ 5 GHz dual-band 802.11ac Wi-Fi (100 Mbit/s). Other features are Power over Ethernet (PoE)
(with the add-on PoE HAT), USB boot and network boot (an SD card is no longer required).

Raspberry Pi 4 Model B was released in June 2019 with a 1.5 GHz 64-bit quad core ARM
Cortex-A72 processor, on-board 802.11ac Wi-Fi, Bluetooth 5, full gigabit Ethernet (throughput
not limited), two USB 2.0 ports, two USB 3.0 ports, and dual monitor support (4K resolution).
The Pi 4 is also powered via a USB-C port, enabling additional power to be provided to
downstream peripherals, when used with an appropriate PSU. The Raspberry Pi 4 has a design
flaw where third-party e-marked USB cables, such as those used on Apple Mac Books,
incorrectly identify it and refuse to provide power. This is expected to be corrected in a future
board revision. Tom's Hardware tested 14 different cables and found that 11 of them turned on
and powered the Pi without issue.

HARDWARE

The Raspberry Pi hardware has evolved through several versions that feature variations in
memory capacity and peripheral-device support.
This block diagram describes Model B and B+; Model A, A+, and the Pi Zero are similar, but
lack the Ethernet and USB hub components. The Ethernet adapter is internally connected to an
additional USB port. In Model A, A+, and the Pi Zero, the USB port is connected directly to the
system on a chip (SoC). On the Pi 1 Model B+ and later models the USB/Ethernet chip contains
a five-port USB hub, of which four ports are available, while the Pi 1 Model B only provides
two.

On the Pi Zero, the USB port is also connected directly to the SoC, but it uses a micro USB
(OTG) port. Unlike all other Pi models, the 40 pin GPIO connector is omitted on the Pi Zero
with solderable through holes only in the pin locations. The Pi Zero WH remedies this

This block diagram describes Model B and B+; Model A, A+, and the Pi Zero are similar,
but lack the Ethernet and USB hub components. The Ethernet adapter is internally connected to
an additional USB port. In Model A, A+, and the Pi Zero, the USB port is connected directly to
the system on a chip (SoC). On the Pi 1 Model B+ and later models the USB/Ethernet chip
contains a five-port USB hub, of which four ports are available, while the Pi 1 Model B only
provides two. On the Pi Zero, the USB port is also connected directly to the SoC, but it uses a
micro USB (OTG) port. Unlike all other Pi models, the 40 pin GPIO connector is omitted on the
Pi Zero with so lderable through holes only in the pin locations. The Pi Zero WH remedies this.

PROCESS

All So Cs used in Raspberry Pis are custom-developed under collaboration of Broadcom


and Raspberry Pi Foundation.

The Broadcom BCM2835 So C used in the first generation Raspberry Pi [26] includes a 700 MHz
ARM1176JZF-S processor, Video Core IV graphics processing unit (GPU),[27] and RAM. It has a
level 1 (L1) cache of 16 KB and a level 2 (L2) cache of 128 KB. The level 2 cache is used
primarily by the GPU. The SoC is stacked underneath the RAM chip, so only its edge is visible.
The ARM1176JZ (F)-S is the same CPU used in the original iPhone,[28] although at a higher
clock rate, and mated with a much faster GPU.

The earlier V1.1 model of the Raspberry Pi 2 used a Broadcom BCM2836 SoC with a 900 MHz
32-bit, quad-core ARM Cortex-A7 processor, with 256 KB shared L2 cache.[29] The Raspberry
Pi 2 V1.2 was upgraded to a Broadcom BCM2837 SoC with a 1.2 GHz 64-bit quad-core ARM
Cortex-A53 processor, the same SoC which is used on the Raspberry Pi 3, but under clocked (by
default) to the same 900 MHz CPU clock speed as the V1.1. The BCM2836 SoC is no longer in
production as of late 2016.

The Raspberry Pi 3 Model B uses a Broadcom BCM2837 SoC with a 1.2 GHz 64-bit quad-core
ARM Cortex-A53 processor, with 512 KB shared L2 cache. The Model A+ and B+ are 1.4 GHz

The Raspberry Pi 4 uses a Broadcom BCM2711 SoC with a 1.5 GHz 64-bit quad-core ARM
Cortex-A72 processor, with 1MB shared L2 cache.

The Raspberry Pi Zero and Zero W use the same Broadcom BCM2835 SoC as the first
generation Raspberry Pi, although now running at 1 GHz CPU clock speed.
PERFORMANCE

While operating at 700 MHz by default, the first generation Raspberry Pi provided a real-world
performance roughly equivalent to 0.041 GFLOPS. On the CPU level the performance is similar
to a 300 MHz Pentium II of 1997–99. The GPU provides 1 Gpixel/s or 1.5 Gtexel/s of graphics
processing or 24 GFLOPS of general purpose computing performance. The graphical capabilities
of the Raspberry Pi are roughly equivalent to the performance of the Xbox of 2001.

Raspberry Pi 2 V1.1 included a quad-core Cortex-A7 CPU running at 900 MHz and 1 GB RAM.
It was described as 4–6 times more powerful than its predecessor. The GPU was identical to the
original. In parallelised benchmarks, the Raspberry Pi 2 V1.1 could be up to 14 times faster than
a Raspberry Pi 1 Model B+.

The Raspberry Pi 3, with a quad-core ARM Cortex-A53 processor, is described as having ten
times the performance of a Raspberry Pi 1. Benchmarks showed the Raspberry Pi 3 to be
approximately 80% faster than the Raspberry Pi 2 in parallelised tasks.

Over clocking

Most Raspberry Pi systems-on-chip could be overclocked to 800 MHz, and some to


1000 MHz. There are reports the Raspberry Pi 2 can be similarly overclocked, in extreme cases,
even to 1500 MHz (discarding all safety features and over-voltage limitations). In the Raspbian
Linux distro the over clocking options on boot can be done by a software command running
"sudo raspi-config" without voiding the warranty.[42] In those cases the Pi automatically shuts the
over clocking down if the chip temperature reaches 85 °C (185 °F), but it is possible to override
automatic over-voltage and overclocking settings (voiding the warranty); an appropriately sized
heat sink is needed to protect the chip from serious overheating.

Newer versions of the firmware contain the option to choose between five overclock ("turbo")
presets that when used, attempt to maximise the performance of the SoC without impairing the
lifetime of the board. This is done by monitoring the core temperature of the chip and the CPU
load, and dynamically adjusting clock speeds and the core voltage. When the demand is low on
the CPU or it is running too hot the performance is throttled, but if the CPU has much to do and
the chip's temperature is acceptable, performance is temporarily increased with clock speeds of
up to 1 GHz, depending on the board version and on which of the turbo settings is used.

The seven overclock presets are:

 none; 700 MHz ARM, 250 MHz core, 400 MHz SDRAM, 0 overvolting

 modest; 800 MHz ARM, 250 MHz core, 400 MHz SDRAM, 0 overvolting,

 medium; 900 MHz ARM, 250 MHz core, 450 MHz SDRAM, 2 overvolting,

 high; 950 MHz ARM, 250 MHz core, 450 MHz SDRAM, 6 overvolting,

 turbo; 1000 MHz ARM, 500 MHz core, 600 MHz SDRAM, 6 overvolting,

 Pi 2; 1000 MHz ARM, 500 MHz core, 500 MHz SDRAM, 2 overvolting,

 Pi 3; 1100 MHz ARM, 550 MHz core, 500 MHz SDRAM, 6 overvolting. In system


information the CPU speed will appear as 1200 MHz. When idling, speed lowers to
600 MHz.

In the highest (turbo) preset the SDRAM clock was originally 500 MHz, but this was later
changed to 600 MHz because 500 MHz sometimes causes SD card corruption. Simultaneously in
high mode the core clock speed was lowered from 450 to 250 MHz, and in medium mode from
333 to 250 MHz.

The CPU on the first and second generation Raspberry Pi board did not require cooling, such as a
heat sink or fan, even when overclocked, but the Raspberry Pi 3 may generate more heat when
overclocked.

RAM:

The early designs of the Raspberry Pi Model A and B boards included only 256 MB of
random access memory (RAM). Of this, the early beta Model B boards allocated 128 MB to the
GPU by default, leaving only 128 MB for the CPU. On the early 256 MB releases of models A
and B, three different splits were possible. The default split was 192 MB for the CPU, which
should be sufficient for standalone 1080p video decoding, or for simple 3D processing. 224 MB
was for Linux processing only, with only a 1080p framebuffer, and was likely to fail for any
video or 3D. 128 MB was for heavy 3D processing, possibly also with video decoding. In
comparison, the Nokia 701 uses 128 MB for the Broadcom VideoCore IV.

The later Model B with 512 MB RAM, was initially released with new standard memory split
files (arm256_start.elf, arm384_start.elf, arm496_start.elf) with 256 MB, 384 MB, and 496 MB
CPU RAM, and with 256 MB, 128 MB, and 16 MB video RAM, respectively. But about one
week later, the foundation released a new version of start. Elf that could read a new entry in
config.txt (gpu_mem=xx) and could dynamically assign an amount of RAM (from 16 to 256 MB
in 8 MB steps) to the GPU, obsoleting the older method of splitting memory, and a single start.
Elf worked the same for 256 MB and 512 MB Raspberry Pis.

The Raspberry Pi 2 has 1 GB of RAM. The Raspberry Pi 3 has 1 GB of RAM in the B and B+
models, and 512 MB of RAM in the A+ model. The Raspberry Pi Zero and Zero W have
512 MB of RAM.

The Raspberry Pi 4 has a choice of 1, 2 or 4 GB of RAM, set at time of manufacture. The


Raspberry Pi 4 Model B Safety and User guide mentions "Raspberry Pi 4 Model B 1 GB, 2 GB,
4 GB + 8 GB variants" but the 8GB model was not available as of the 2019 launch.

Networking
the Model A, A+ and Pi Zero have no Ethernet circuitry and are commonly connected to a
network using an external user-supplied USB Ethernet or Wi-Fi adapter. On the Model B and B+
the Ethernet port is provided by a built-in USB Ethernet adapter using the SMSC LAN9514 chip.
The Raspberry Pi 3 and Pi Zero W (wireless) are equipped with 2.4 GHz WIFI 802.11n (150
Mbit/s) and Bluetooth 4.1 (24 Mbit/s) based on the Broadcom BCM43438 FullMAC chip with
no official support for monitor mode but implemented through unofficial firmware patching[55]
and the Pi 3 also has a 10/100 Mbit/s Ethernet port. The Raspberry Pi 3B+ features dual-band
IEEE 802.11b/g/n/ac Wi-Fi, and Gigabit Ethernet (limited to approximately 300 Mbit/s by the
USB 2.0 bus between it and the SoC). The Raspberry Pi 4 has full gigabit Ethernet (throughput is
not limited as it is not funnelled via the USB chip.)
POWER SUPPLY MODULES:

 STEP DOWN TRANSFORMER

 BRIDGE RECTIFIER WITH FILTER

 VOLTAGE REGULATORS

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 voltage, step-down transformers reduce voltage.

A step down power transformer is used to step down the AC voltage from the line voltage

of 110 VAC or 220 VAC i.e, it converts higher voltage at the input side to a lower voltage at the
output.
Rectifier

There are several ways of connecting diodes to make a rectifier to convert AC to DC. The
bridge rectifier is the most important and it produces full-wave varying DC

Bridge rectifier Output: full-wave varying DC


Alternate pairs of diodes conduct, changing over (using all the AC wave)
the connections so the alternating directions of
AC are converted to the one direction of DC.
Filter
Filtering is performed by a large value electrolytic capacitor connected across the DC supply to
act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier
is falling. The diagram shows the unfiltered varying DC (dotted line) and the filtered DC (solid
line). The capacitor charges quickly near the peak of the varying DC, and then discharges as it
supplies current to the output.

Typically 1000 μf capacitor is used in microcontroller of 8051.

Regulator

This is a simple DC regulated supply project using 7805 voltage regulator to obtain a variable
DC voltage range from 5V to 15V

Pin out of the 7805 regulator IC.


1. Unregulated voltage in

2. Ground

3. Regulated voltage out

If you need other voltages than +5V, you can modify the circuit by replacing the 7805 chips with
another regulator with different output voltage from regulator 78xx chip family. The last
numbers in the the chip code tells the output voltage. Remember that the input voltage must be at
least 3V greater than regulator output voltage ot otherwise the regulator does not work well.

Light Emitting Diodes

Light Emitting Diodes or LEDs, are among the most widely used of all the types of
diodes available. They are the most visible type of diode that emits a fairly narrow bandwidth of
either visible colored light, invisible infra-red or laser type light when a forward current is passed
through them. A "Light Emitting Diode" or LED as it is more commonly called, is basically just
a specialized type of PN-junction diode, made from a very thin layer of fairly heavily doped
semiconductor material. When the diode is Forward Biased, electrons from the semiconductors
conduction band combine with holes from the valence band, releasing sufficient energy to
produce photons of light. Because of this thin layer a reasonable number of these photons can
leave the junction and radiate away producing a coloured light output.

Unlike normal diodes which are made for detection or power rectification, and which are
generally made from either Germanium or Silicon semiconductor material, Light Emitting
Diodes are made from compound type semiconductor materials such as Gallium Arsenide
(GaAs), Gallium Phosphide (GaP), Gallium Arsenide Phosphide (GaAsP), Silicon Carbide (SiC)
or Gallium Indium Nitride (GaInN). The exact choice of the semiconductor material used will
determine the overall wavelength of the photon light emissions and therefore the resulting colour
of the light emitted, as in the case of the visible light coloured LEDs, (RED, AMBER, GREEN
etc).
Typical LED Characteristics

Semiconductor
Wavelength Colour VF @ 20mA
Material

++++GaAs 850-940nm Infra-Red 1.2v

GaAsP 630-660nm Red 1.8v

GaAsP 605-620nm Amber 2.0v

GaAsP:N 585-595nm Yellow 2.2v

GaP
550-570nm Green 3.5v

SiC 430-505nm Blue 3.6v

GaInN 450nm White 4.0v

From the table above we can see that the main P-type dopant used in the manufacture of
Light Emitting Diodes is Gallium (Ga, atomic number 31) and the main N-type dopant used is
Arsenic (As, atomic number 31) giving the resulting Gallium Arsenide (GaAs) crystal structure,
which has the characteristics of radiating significant amounts of infrared radiation from its
junction when a forward current is flowing through it. By also adding Phosphorus (P, atomic
number 15), as a third dopant the overall wavelength of the emitted radiation is reduced to give
visible red light to the human eye. Further refinements in the doping process of the PN-junction
have resulted in a range of colours available from red, orange and amber through to yellow, and
the recently developed blue LED which is achieved by injecting nitrogen atoms into the crystal
structure during the doping process.

Light Emitting Diodes I-V Characteristics:

Before a light emitting diode can "emit" any form of light it needs a current to flow
through it, as it is a current dependant device. As the LED is to be connected in a forward bias
condition across a power supply it should be Current Limited using a series resistor to protect it
from excessive current flow. From the table above we can see that each LED has its own forward
voltage drop across the PN-junction and this parameter which is determined by the
semiconductor material used is the forward voltage drop for a given amount of forward
conduction current, typically for a forward current of 20mA. In most cases LEDs are operated
from a low voltage DC supply, with a series resistor to limit the forward current to a suitable
value from say 5mA for a simple LED indicator to 30mA or more where a high brightness light
output is needed.

LED Series Resistance:

The series resistor value RS is calculated by simply using Ohm´s Law, knowing the
required forward current IF, the supply voltage VS and the expected forward voltage drop of the
LED, VF at this current level as shown below:
LED Typical Applications:The following figure shows how to interface the LED to
microcontroller. As you can see the Anode is connected through a resistor to Vcc and the
Cathode is connected to the Microcontroller pin. So when the Port Pin is HIGH the LED is OFF
and when the Port Pin is LOW the LED is turned ON.

GAS (MQ2):
MQ-2 Semiconductor Sensor for Combustible Gas. MQ-2 gas sensor has high sensitivity to
LPG, Propane and Hydrogen, also could be used to Methane and other combustible steam, it is
with low cost and suitable for different application.

Features

Good sensitivity to Combustible gas in wide range

High sensitivity to LPG, Propane and Hydrogen

Long life and low cost

Simple drive circuit

Sensor Type - Semiconductor


Micro machined Accelerometer (MEMS)

Features

 Selectable Sensitivity (1.5g/2g/4g/6g)


 Low Current Consumption: 500 μA
 Sleep Mode: 3 μA
 Low Voltage Operation: 2.2 V – 3.6 V
 6mm x 6mm x 1.45mm QFN
 High Sensitivity (800 mV/g @ 1.5g)
 Fast Turn On Time
 Integral Signal Conditioning with Low Pass Filter
 Robust Design, High Shocks Survivability
 Pb-Free Terminations
 Environmentally Preferred Package
 Low Cost
3.3V GND X Y Z G1 G2 SLEEPMODE

AXIES
INTRODUCTION TO MEMs

Micro electro mechanical systems (MEMS) is the technology of the very small and
miniature systems and merges at the nano-scale into nano electromechanical systems (NEMS)
and nanotechnology. MEMS are made up of components between 1 to 100 micrometers in size
(i.e. 0.001 to 0.1 mm) and MEMS devices generally range in size from 20 micrometers (20
millionths of a meter) to a millimeter. They usually consist of a central unit that processes data,
the microprocessor and several components that interact with the outside such as micro sensors.
At these size scales, the standard constructs of classical physics are not always useful. Due to
MEMS' large surface area to volume ratio, surface effects such as electrostatics and wetting
dominate volume effects such as inertia or thermal mass.

Micro-Electro-Mechanical Systems (MEMS) is the integration of mechanical elements,


sensors, actuators, and electronics on a common silicon substrate through micro fabrication
technology. While the electronics are fabricated using integrated circuit (IC) process sequences
(e.g., CMOS, Bipolar, or BICMOS processes), the micromechanical components are fabricated
using compatible "micromachining" processes that selectively etch away parts of the silicon
wafer or add new structural layers to form the mechanical and electromechanical devices.

MEMS promises to revolutionize nearly every product category by bringing together


silicon-based microelectronics with micromachining technology, making possible the realization
of complete systems-on-a-chip. MEMS is an enabling technology allowing the development of
smart products, augmenting the computational ability of microelectronics with the perception
and control capabilities of micro sensors and micro actuators and expanding the space of possible
designs and applications.
Microelectronic integrated circuits can be thought of as the "brains" of a system and
MEMS augments this decision-making capability with "eyes" and "arms", to allow
Microsystems to sense and control the environment. Sensors gather information from the
environment through measuring mechanical, thermal, biological, chemical, optical, and magnetic
phenomena. The electronics then process the information derived from the sensors and through
some decision making capability direct the actuators to respond by moving, positioning,
regulating, pumping, and filtering, thereby controlling the environment for some desired
outcome or purpose. Because MEMS devices are manufactured using batch fabrication
techniques similar to those used for integrated circuits, unprecedented levels of functionality,
reliability, and sophistication can be placed on a small silicon chip at a relatively low cost.

APPLICATIONS

There are numerous possible applications for MEMS and Nanotechnology. As a


breakthrough technology, allowing unparalleled synergy between previously unrelated fields
such as biology and microelectronics, many new MEMS and Nanotechnology applications will
emerge, expanding beyond that which is currently identified or known. Here are a few
applications of current interest:

Biotechnology

MEMS and Nanotechnology is enabling new discoveries in science and engineering such
as the Polymerase Chain Reaction (PCR) Microsystems for DNA amplification and
identification, micro machined Scanning Tunneling Microscopes (STMs), biochips for detection
of hazardous chemical and biological agents, and Microsystems for high-throughput drug
screening and selection.
Communications
High frequency circuits will benefit considerably from the advent of the RF-MEMS
technology. Electrical components such as inductors and tunable capacitors can be
improved significantly compared to their integrated counterparts if they are made using
MEMS and Nanotechnology. With the integration of such components, the performance of
communication circuits will improve, while the total circuit area, power consumption and
cost will be reduced. In addition, the mechanical switch, as developed by several research
groups, is a key component with huge potential in various microwave circuits. The
demonstrated samples of mechanical switches have quality factors much higher than
anything previously available.

Reliability and packaging of RF-MEMS components seem to be the two critical issues
that need to be solved before they receive wider acceptance by the market.

Accelerometers

MEMS accelerometers are quickly replacing conventional accelerometers for crash air-
bag deployment systems in automobiles. The conventional approach uses several bulky
accelerometers made of discrete components mounted in the front of the car with separate
electronics near the air-bag. MEMS and Nanotechnology has made it possible to integrate the
accelerometer and electronics onto a single silicon chip at a 5-10 times lower cost. These MEMS
accelerometers are much smaller, more functional, lighter, more reliable, and are produced for a
fraction of the cost of the conventional macro scale accelerometer elements.

A/D CONVERTER

An analog-to-digital converter (abbreviated ADC, A/D or A to D) is a device which converts


continuous signals to discrete digital numbers. The reverse operation is performed by a digital-
to-analog converter (DAC).Typically, an ADC is an electronic device that converts an input
analog voltage (or current) to a digital number proportional to the magnitude of the voltage or
current. However, some non-electronic or only partially electronic devices, such as rotary
encoders, can also be considered ADCs.

RESOLUTION

The resolution of the converter indicates the number of discrete values it can produce over the
range of analog values. The values are usually stored electronically in binary form, so the
resolution is usually expressed in bits. In consequence, the number of discrete values available,
or "levels", is usually a power of two. For example, an ADC with a resolution of 8 bits can
encode an analog input to one in 256 different levels, since 28 = 256. The values can represent
the ranges from 0 to 255 (i.e. unsigned integer) or from -128 to 127 (i.e. signed integer),
depending on the application.

ACCURACY

An ADC has several sources of errors. Quantization error and (assuming the ADC is intended to
be linear) non-linearity is intrinsic to any analog-to-digital conversion. There is also a so-called
aperture error which is due to a clock jitter and is revealed when digitizing a time-variant signal
(not a constant value).

These errors are measured in a unit called the LSB, which is an abbreviation for least significant
bit. In the above example of an eight-bit ADC, an error of one LSB is 1/256 of the full signal
range, or about 0.4%.

QUANTIZATION ERROR

Quantization error is due to the finite resolution of the ADC, and is an unavoidable imperfection
in all types of ADC. The magnitude of the quantization error at the sampling instant is between
zero and half of one LSB.

In the general case, the original signal is much larger than one LSB. When this happens, the
quantization error is not correlated with the signal, and has a uniform distribution. Its RMS value
is the standard deviation of this distribution, given by . In the eight-bit
ADC example, this represents 0.113% of the full signal range.

At lower levels the quantizing error becomes dependent of the input signal, resulting in
distortion. This distortion is created after the anti-aliasing filter, and if these distortions are above
1/2 the sample rate they will alias back into the audio band. In order to make the quantizing error
independent of the input signal, noise with an amplitude of 1 quantization step is added to the
signal. This slightly reduces signal to noise ratio, but completely eliminates the distortion. It is
known as dither.

SAMPLING RATE

The analog signal is continuous in time and it is necessary to convert this to a flow of digital
values. It is therefore required to define the rate at which new digital values are sampled from the
analog signal. The rate of new values is called the sampling rate or sampling frequency of the
converter.

A continuously varying band limited signal can be sampled (that is, the signal values at intervals
of time T, the sampling time, are measured and stored) and then the original signal can be
exactly reproduced from the discrete-time values by an interpolation formula. The accuracy is
limited by quantization error. However, this faithful reproduction is only possible if the sampling
rate is higher than twice the highest frequency of the signal. This is essentially what is embodied
in the Shannon- Nyquist sampling theorem.

Since a practical ADC cannot make an instantaneous conversion, the input value must
necessarily be held constant during the time that the converter performs a conversion (called the
conversion time). An input circuit called a sample and hold performs this task—in most cases by
using a capacitor to store the analog voltage at the input, and using an electronic switch or gate to
disconnect the capacitor from the input. Many ADC integrated circuits include the sample and
hold subsystem internally.

MCP3208 (ADC)
Description

The Microchip Technology Inc. MCP3204/3208 devices are successive approximation 12-bit
Analog to Digital (A/D) Converters with on-board sample and hold circuitry. The MCP3204 is
programmable to provide two pseudo-differential input pairs or four single ended inputs. The
MCP3208 is programmable to provide four pseudo-differential input pairs or eight single ended
inputs. Differential Nonlinearity (DNL) is specified at ±1 LSB, while Integral Nonlinearity (INL)
is offered in ±1 LSB (MCP3204/3208-B) and ±2 LSB (MCP3204/3208-C) versions.

Communication with the devices is accomplished using a simple serial interface compatible with
the SPI protocol. The devices are capable of conversion rates of up to 100 ksps. The
MCP3204/3208 devices operate over a broad voltage range (2.7V - 5.5V). Low current design
permits operation with typical standby and active currents of only 500 nA and 320 μA,
respectively.
MMA7260 (MEMs Sensor)

The device consists of two surface micro machined capacitive sensing cells (g-cell) and a signal
conditioning ASIC contained in a single integrated circuit package. The sensing elements are
sealed hermetically at the wafer level using a bulk micro machined cap wafer. The g-cell is a
mechanical structure formed from semiconductor materials (poly silicon) using semiconductor
processes (masking and etching). It can be modeled as a set of beams attached to a movable
central mass that move between fixed beams. The movable beams can be deflected from their
rest position by subjecting the system to acceleration.

As the beams attached to the central mass move, the distance from them to the fixed beams on
one side will increase by the same amount that the distance to the fixed beams on the other side
decreases. The change in distance is a measure of acceleration. The g-cell beams form two back-
to-back capacitors. As the center beam moves with acceleration, the distance between the beams
changes and each capacitor's value will change, (C = Aε/D). Where A is the area of the beam, ε
is the dielectric constant, and D is the distance between the beams. The ASIC uses switched
capacitor techniques to measure the g-cell capacitors and extract the acceleration data from the
difference between the two capacitors. The ASIC also signal conditions and filters (switched
capacitor) the signal, providing a high level output voltage that is ratio metric and proportional to
acceleration.
L293D “H” BRIDGE
The motor driver package L293D is interfaced with 89C51 microcontroller through IN1 to IN4 of
H Bridge (L293D). Both the enable pins (EN1 and EN2) of motor driver L293D is combined together and
fed to controller to access the command signals. Depending up on the command signals issued by the
controller, the enable pins are activated to control all the four internal drivers of L293D respectively to
drive two geared DC motors. Hear H Bridge is required, because the microcontroller output is not
sufficient to drive the DC motors, so current drivers are required for motor rotation.

The L293D is a quad, high current, half-H driver designed to provide bidirectional drive currents
of up to 600mA at voltages from 4.5V to 36V. It makes it easier to drive the DC motors. The L293D
consists of four drivers. Pins IN1 through IN4 and OUT1 through OUT4 are input and output pins,
respectively, of driver 1 through driver 4. Drivers 1 and 2, and drivers 3 and 4 are enabled by enable pin 1
(EN1) and pin 9 (EN2), respectively. When enable input EN1 (Pin1) is high, drivers 1 and 2 are enabled
and the outputs corresponding to their inputs are active. Similarly, enable input EN2 (Pin9) enables drivers
3 and 4.

DETAILS ABOUT DC MOTORS

Permanent magnet DC motor responds to both voltage and current. The steady state voltage across a
motor determines the motor’s running speed, and the current through its armature windings determines the
torque. Apply a voltage and the motor will start running in one direction; reverse the polarity and the
direction will be reversed. If you apply a load to the motor shaft, it will draw more current, if the power
supply does not able to provide enough current, the voltage will drop and the speed of the motor will be
reduced. However, if the power supply can maintain voltage while supplying the current, the motor will
run at the same speed. In general, you can control the speed by applying the appropriate voltage, while
current controls torque. In most cases, DC motors are powered up by using fixed DC power supply,
therefore; it is more efficient to use a chopping circuit.

Consider what happens when a voltage applied to a motor’s windings is rapidly turned ON and OFF
in such a way that the frequency of the pulses produced remains constant, but the width of the ON pulse is
varied. This is known as Pulse Width Modulation (PWM). Current only flows through the motor during
the ON portion of the PWM waveform. If the frequency of the PWM input is high enough, the mechanical
inertia of the motor cannot react to the ripple wave; instead, the motor behaves as if the current were the
DC average of the ripple wave. Therefore, by changing the width of pulse, we can control the motor
speed.

At the most basic level, electric motors exist to convert electrical energy into mechanical energy.
This is done by way of two interacting magnetic fields -- one stationary, and another attached to a part that
can move. A number of types of electric motors exist, but most BEAM bots use DC motors in some form
or another. DC motors have the potential for very high torque capabilities (although this is generally a
function of the physical size of the motor), are easy to miniaturize, and can be "throttled" via adjusting
their supply voltage. DC motors are also not only the simplest, but the oldest electric motors.

Oersted, Gauss, and Faraday discovered the basic principles of electromagnetic induction in the early
1800’s. By 1820, Hans Christian Oersted and Andre Marie Ampere had discovered that an electric current
produces a magnetic field. The next 15 years saw a flurry of cross-Atlantic experimentation and
innovation, leading finally to a simple DC rotary motor. A number of men were involved in the work, so
proper credit for the first DC motor is really a function of just how broadly you choose to define the word
"motor

Principles of operation

In any electric motor, operation is based on simple electromagnetism. A current carrying conductor
generates a magnetic field; when this is then placed in an external magnetic field, it will experience a force
proportional to the current in the conductor, and to the strength of the external magnetic field. As you are
well aware of from playing with magnets as a kid, opposite (North and South) polarities attract, while like
polarities (North and North, South and South) repel. The internal configuration of a DC motor is designed
to harness the magnetic interaction between a current -carrying conductor and an external magnetic field
to generate rotational motion. Let's start by looking at a simple 2-pole DC electric motor (here dark black
represents a magnet or winding with a "North" polarization, while light color 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, the external magnetic field is produced by high-
strength permanent magnets. 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. Given our example two-pole motor,
the rotation reverses the direction of current through the rotor winding, leading to a "flip" of the rotor's
magnetic field, driving it to continue rotating.

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).

D.C. Motors with field coils are classified as series. Shunt, compound and separately
excited according to how the field windings and armature windings are connected. With
the series wound motor the armature and fields coils are in series. Such a motor exerts the
highest starting torque and has the greatest no-load speed. With light loads there is a
danger that a series wound motor might run at too high a speed. Reversing the polarity of
the supply to the coils has no effect on the direction of rotation of the motor, it will continue
rotating in the same direction since both the field and armature currents have been
reversed.
With the shunt wound motor the armature and field coils are in parallel. it provides
the lowest starting torque, a much lower no- load speed and has good speed regulation.
Because of this almost constant speed regardless of load, shunt wound motors are very
widely used to reverse the direction of rotation, either the armature or field supplied must be
reversed. For this reason, the separately excited windings are preferable for such a situation.
The compound motor has two field windings, one in series with the armature and one
in parallel. Compound wound motors aim to got the best features of the series and shunt
wound motors, namely a high starting torque and good speed regulation. The separately
excited motor has separate control of the armature and field currents and can be considered
to be a special case of the shunt wound motor. The torque-speed characteristics of the above
motors and the speed of such D.C. Motors can be changed by either changing the armature
current or the field current. Generally it is the armature current that is varied. The choice of
motor will depend on its application. For example, with a robot, manipulator, and the robot
wrist might use a series wound motor because the speed decreases as the load increases. a
shunt wound motor would be used where a constant speed was required, regardless of the
load. The speed of a permanent magnet motor depends on the current through the armature
coil. With a field coil motor either varying the armature current or the field current can
change the speed; generally it is the armature current that is varied. Thus speed control can
be obtained by controlling the voltage applied to the armature. However, because fixed
voltage supplies are often used, an electronic circuit obtains a variable voltage.

With an alternating current supply, the thyristor circuit can be used to control the
average voltage applied to the armature. However, we are often concerned with the control
of D.C. Motors by means of control signals emanating from microprocessors. In such cases
the technique known as pulse width modulation (PWM) is generally used. This basically
involves taking a constant D.C. supply voltage and chopping it so that the average value is
varied.
DESCRIPTION ABOUT ‘H’ - BRIDGE
Introduction

Whenever a robotics hobbyist talk about making a robot, the first thing comes to his mind is
making the robot move on the ground. And there are always two options in front of the designer whether
to use a or a stepper motor. When it comes to speed, weight, size, and cost... DC motors are always
preferred over stepper motors. There are many things, which we can do with DC motor when interfaced
with a micro controller. For example we can control the speed of motor, we can control the direction of
rotation, we can also do encoding of the rotation made by DC motor i.e. keeping track of how many turns
are made by the motors etc. So we can see DC motors are better then stepper motors.

In this part of tutorial we will learn to interface a DC motor with a micro controller. Usually H-
bridge is preferred way of interfacing a DC motor. These days many IC manufacturers have H-bridge
motor drivers available in the market like L293D is most used H-Bridge driver IC. H-bridge can also be
made with the help of transistors and MOSFET’s etc. rather of being cheap, they only increase the size of
the design board, which is some times not required so using a small 16 pin IC is preferred for this purpose.
L293D is having two ‘H’ Bridges inside, so that we can drive two DC motors simultaneously. Before
discussing about this device, first we must learn basic theory of ‘H’ Bridges. The following is the
description.
Basic Theory

Let's start with the name, H-bridge. Sometimes called a "full bridge" the H-bridge is so named
because it has four switching elements at the "corners" of the H and the motor forms the cross bar. The
basic bridge is shown in the figure above. The key fact to note is that there are, in theory, four switching
elements within the bridge. These four elements are often called, high side left, high side right, low side
right, and low side left (when traversing in clockwise order).

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, turn on two switches that are diagonally opposed. The current flows and the
motor begin to turn in a "positive" direction. Switch off these two switches and switch on other two
switches diagonally in other direction then the motor starts rotating in opposite direction. Actually it is
quite simple, the tricky part comes in when we 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 MOSFET’s.

One more topic in the basic theory section is quadrants. If each switch can be controlled
independently then we can do some interesting things with the bridge, some folks call such a bridge a
"four quadrant device" (4QD). If we built it out of a single DPDT relay, we can really only control
forward or reverse. We can build a small truth table that tells us 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", there are in fact only four
useful states (the four quadrants) where the transistors are turned on.

High Side Left High Side Right Low Side Left Low Side Right Quadrant Description

On Off Off On Forward Running

Off On On Off Backward Running

On On Off Off Braking

Off Off On On Braking

In the above table the last two rows describes condition about short circuit the motor that causes
the motors generator effect to work against it. 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.

1. Using Relays:

A simple implementation of a H Bridge using four SPST relays is shown. Terminal A is High Side
Left, Terminal B is High Side Right, Terminal C is Low Side Left and Terminal D is Low Side Right. The
logic followed is according to the table above.

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.
2. Using Transistors:
We can better control our motor by using transistors or Field Effect Transistors (FET’s). Most of
what we have discussed about the relays H-Bridge is true of these circuits. See the diagram showing how
they are connected. We 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.

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.

MOSFET’s 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 we don't need the diodes anymore. This helps guard against fly
back voltage frying our ICs.To use MOSFET’s in an H-Bridge, we need P-Channel MOSFET’s on top
because they can "source" power and N-Channel MOSFET’s on the bottom because they 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 groundside 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. There are H-bridge chips
available that are much easier, and safer, to use than designing our own H-Bridge circuit.

L293D Dual H-Bridge Motor Driver

L293D is a dual H-Bridge motor driver, so with one IC we can interface two DC motors, which
can be controlled in both clockwise and counter clockwise directions. Since the device is having four half
‘H’ Bridges, there by if required four motors can be driven through this single device, moreover the task is
to run all four motors in one direction only. L293D has output current of 600mA and peak output current
of 1.2A per channel. Moreover for protection of circuit from back EMF output diodes are included within
the IC. The output supply (VCC2) has a wide range from 4.5V to 36V, which has made L293D a best
choice for DC motor driver.
In this IC there are two different power supplies (Vcc1 and Vcc2). Vcc1 is for logic input circuit while
Vcc2 is supply for the output circuit. This means that we should apply about 5V to Vcc1 and whatever
voltage required by the motor (up to 36V max for this IC) to Vcc2. Each Half H-Bridge has an individual
Ground. So we must ground the terminal corresponding to the Half H-Bridge, depending up on the circuit
design, if required all four terminals of bridges can be connected to the ground.
Each Half H-Bridge has an Input (A) and output (Y). Also there are enable pins to turn on the Half
H-Bridges. Once a Half H-bridge is enabled, then the truth table is as follows:
INPUT OUTPUT
A Y

L L

H H

So we just give a High level when we want to turn the Half H-Bridge on and Low level when we
want to turn it off. When the Half H-Bridge is on, the voltage at the output is equal to Vcc2.If we want to
make a Full H-Bridge, we must 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:

OUTPU
INPUT INPUT OUTPUT
T Description
1A 2A 2Y
1Y

Braking (both terminals of motor are


L L L L
Gnd)

L H L H Forward Running

H L H L Backward Running

H H H H Braking (both terminals of motor at


Vcc2)

LM35 TEMPERATURE SENSOR:

DESCRIPTION:

The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is
linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage
over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a
large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does
not require any external calibration or trimming to provide typical accuracies of ±¼°C at room
temperature and ±¾°C over a full -55 to +150°C temperature range. Low cost is assured by
trimming and calibration at the wafer level. The LM35's low output impedance, linear output,
and precise inherent calibration make interfacing to readout or control circuitry especially easy.
It can be used with single power supplies, or with plus and minus supplies. As it draws only
60 µA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated
to operate over a -55° to +150°C temperature range, while the LM35C is rated for a -40° to
+110°C range (-10° with improved accuracy). The LM35 series is available packaged in
hermetic TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are also available
in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface mount
small outline package and a plastic TO-220 package

FEATURES
 Calibrated directly in ° Celsius (Centigrade)
 Linear + 10.0 mV/°C scale factor
 0.5°C accuracy guarantee able (at +25°C)
 Rated for full -55° to +150°C range
 Suitable for remote applications
 Low cost due to wafer-level trimming
 Operates from 4 to 30 volts
 Less than 60 µA current drain
 Low self-heating, 0.08°C in still air
 Nonlinearity only ±¼°C typical
 Low impedance output, 0.1 Ohm for 1 mA load

Global System for Mobile Communication (GSM)

Definition:

Global system for mobile communication (GSM) is a globally accepted standard for digital
cellular communication. GSM is the name of a standardization group established in 1982 to
create a common European mobile telephone standard that would formulate specifications for a
pan-European mobile cellular radio system operating at 900 MHz.

A GSM modem is a wireless modem that works with a GSM wireless network. A wireless
modem behaves like a dial-up modem. The main difference between them is that a dial-up
modem sends and receives data through a fixed telephone line while a wireless modem sends and
receives data through radio waves.

A GSM modem can be an external device or a PC Card / PCMCIA Card. Typically, an external
GSM modem is connected to a computer through a serial cable or a USB cable. A GSM modem
in the form of a PC Card / PCMCIA Card is designed for use with a laptop computer. It should
be inserted into one of the PC Card / PCMCIA Card slots of a laptop computer.

Like a GSM mobile phone, a GSM modem requires a SIM card from a wireless carrier in order
to operate.

As mentioned in earlier sections of this SMS tutorial, computers use AT commands to control
modems. Both GSM modems and dial-up modems support a common set of standard AT
commands. You can use a GSM modem just like a dial-up modem.

In addition to the standard AT commands, GSM modems support an extended set of AT


commands. These extended AT commands are defined in the GSM standards. With the extended
AT commands, you can do things like:

 Reading, writing and deleting SMS messages.


 Sending SMS messages.
 Monitoring the signal strength.
 Monitoring the charging status and charge level of the battery.
 Reading, writing and searching phone book entries.

The number of SMS messages that can be processed by a GSM modem per minute is very low --
only about six to ten SMS messages per minute.

GSM AT COMMANDS

 AT
 AT&D0
 AT+IFC=00
 AT+CMGF=1
 AT+CNMI=22000

AT commands features

1. Setting up your GSM modem

Most GSM modems comes with a simple manual and necessary drivers. To setup your
T-ModemUSB, download the USB GSM Modem Quick Start ( Windows ) guide (460kB PDF).
You would be able to send SMS from the Windows application and also setup GPRS
connectivity. The GSM modem will map itself as a COM serial port on your computer.

Windows based control panel to setup GSM modem, GPRS and send SMS

2. Using the HyperTerminal

Hint :: By developing your AT commands using HyperTerminal, it will be easier for you to
develop your actual program codes in VB, C, Java or other platforms.

Go to START\Programs\Accessories\Communications\HyperTerminal (Win 2000) to create a


new connection, eg. "My USB GSM Modem". Suggested settings ::
 - COM Port :: As indicated in the T-Modem Control Tool 
 - Bits per second :: 230400 ( or slower ) -Data Bits : 8  - Parity : None- StopBitsFlowControl:
HardwareYou are now ready to start working with AT commands. Type in "AT" and you should
get a "OK", else you have not setup your HyperTerminal correctly. Check your port settings and
also make sure your GSM modem is properly connected and the drivers installed.

3. Initial setup AT commands

We are ready now to start working with AT commands to setup and check the status of
the GSM modem.

AT Returns a "OK" to confirm that modem is working

AT+CPIN="xxxx"   To enter the PIN for your SIM ( if enabled )

AT+CREG? A "0,1" reply confirms your modem is connected to GSM network

AT+CSQ Indicates the signal strength, 31.99 is maximum.

4. Sending SMS using AT commands

We suggest try sending a few SMS using the Control Tool above to make sure your GSM
modem can send SMS before proceeding. Let's look at the AT commands involved ..

AT+CMGF=1 To format SMS as a TEXT message

AT+CSCA="+xxxxx"   Set your SMS center's number. Check with your provider.

To send a SMS, the AT command to use is AT+CMGS..


AT+CMGS="+yyyyy"<Enter>> Your SMS text message here <Ctrl-Z>
The "+yyyyy" is your receipent's mobile number. Next, we will look at
receivingSMSviaATcommands.

5. Receiving SMS using AT commands

The GSM modem can be configured to response in different ways when it receives a SMS.
a) Immediate - when a SMS is received, the SMS's details are immediately sent to the host
computer (DTE) via the +CMT command

AT+CMGF=1 To format SMS as a TEXT message

AT+CNMI=1,2,0,0,0   Set how the modem will response when a SMS received

When a new SMS is received by the GSM modem, the DTE will receive the following +CMT : 
"+61xxxxxxxx" , , "04/08/30,23:20:00+40"
This the text SMS message sent to the modem
Your computer (DTE) will have to continuously monitor the COM serial port, read and parse the
message.

b) Notification - when a SMS is recieved, the host computer (DTE) will be notified of the new
message. The computer will then have to read the message from the indicated memory location
and clear the memory location.

AT+CMGF=1 To format SMS as a TEXT message

AT+CNMI=1,1,0,0,0   Set how the modem will response when a SMS is received

When a new SMS is received by the GSM modem, the DTE will receive the following ..

+CMTI: "SM",3 Notification sent to the computer. Location 3 in SIM memory

AT+CMGR=3 <Enter>  AT command to send read the received SMS from modem

The modem will then send to the computer details of the received SMS from the specified
memory location ( eg. 3 ) +CMGR: "REC READ","+61xxxxxx",,"04/08/28,22:26:29+40"

This is the new SMS received by the GSM modem


After reading and parsing the new SMS message, the computer (DTE) should send a AT
command to clear the memory location in the GSM modem..
AT+CMGD=3 <Enter>   To clear the SMS receive memory location in the GSMmodem If the
computer tries to read a empty/cleared memory location, a +CMS ERROR: 321 will be sent to
the computer.
GSM INTERFACE WITH MICROCONTROLLER

In this project GSM Modem is interfaced with the microcontroller through rs232 interface.
Since the voltage levels of the microcontroller are different with that of the GSM modem we use
a voltage converter or the line driver such as MAX232 to make them rs232 compatible.

GSM and GPS both communicate through UART. Since microcontroller has only one inbuilt
UART a multiplexer is used to interface GSM and GPS to the microcontroller.

RS232
The most popular serial communication standard for asynchronous communications is
RS-232 (Recommended Standard – 232. This specifies the rule of how different connected
devices communicate. The connected devices can either be terminals or communication
equipments commonly referred as DTE & DCE.

According to RS232 interface, it requires only 3 lines i.e. Rx, Tx & Ground when
compared to the bunch of connectors required for parallel communication. Even though parallel
communication is easier to establish, serial communication is preferred based on the costs for the
communication lines.

  The EIA (Electronics Industry Association) RS232C Standard specifies & suggests a
maximum baud rate of 20,000bps, and RS232D is an advanced version of the same, which
allows 1.5 Mbps. The connectors specified are D-TYPE 25 pin connector and D-TYPE 9 pin
connector.
D-Type-25 pin Pin outs Function
no.

3 2 RD Receive Data (Serial data input)


2 3 TD Transmit Data (Serial data output)
7 4 RTS Request to send (acknowledge to modem that UART is ready
to exchange data
8 5 CTS Clear to send (i.e.; modem is ready to exchange data)
6 6 DSR Data ready state (UART establishes a link)
5 7 SG Signal ground
1 8 DCD Data Carrier detect (This line is active when modem detects a
carrier
4 20 DTR Data Terminal Ready.
9 22 RI Ring Indicator (Becomes active when modem detects ringing
signal from PSTN

FIGURE 4.1 DB-9 PIN CONNECTOR

According to RS232 specifications, the logic ‘1’ and logic ‘0’ are called as ‘mark &
‘space’. The signal voltage levels are specified as ‘mark’ should be in the range of -3 to -15 volts
and ‘space’ should be in the range of 3 to 15 volts. The modern low power consuming CMOS
devices use different logic levels than the RS232 line specification. The logic levels of CMOS
devices are in the range of 3.3v-5.5v for ‘1’ and -0.3v to 0.8v for ‘0’. Therefore when
communicating with such CMOS/TTL devices, the logic levels need to be converted
RS232 INTERFACED TO MAX 232

J2
C1
U3 1 uf

16
9 5
8 4 13 12 P 3. 0 R XD
7 3 T1 O U T R 1 IN R 1O U T

VC C
8 9
6 2 R 2 IN R 2O U T
1 10 14 T1 O U T
TXD P 3 . 1 11 T2I N T1 O U T 7
C4 T1I N T2 O U T
5V 1
3 C 1+
C0 .15 u f 4 C 1-
5 C 2+
C6 C 2-
0 .1 u f 2
0 .1 u f V+
GN D

6
V-
C7
MA X3 2 3 2
15

0 . 1u f

Fig 4.2 RS232 INTERFACED TO MAX232

Rs232 is 9 pin db connector, only three pins of this are used ie 2, 3, 5 the transmit pin of rs232 is
connected to rx pin of microcontroller

MAX232 INTERFACED TO MICROCONTROLLER


.

MAX232 is connected to the microcontroller as shown in the figure above 17, 18 pins are
connected to the TX and RX pin i.e., transmit and receive pin of microcontroller
SOFTWARE

Python:

Python is an interpreted, high-level, general-purpose programming language. Created by Guido


van Rossum and first released in 1991, Python's design philosophy emphasizes code
readability with its notable use of significant whitespace. Its language constructs and object-
oriented approach aim to help programmers write clear, logical code for small and large-scale
projects.

Python is dynamically typed and garbage-collected. It supports multiple programming


paradigms, including structured (particularly, procedural,) object-oriented, and functional
programming. Python is often described as a "batteries included" language due to its
comprehensive standard library.

Python was conceived in the late 1980s as a successor to the ABC language. Python 2.0, released
in 2000, introduced features like list comprehensions and a garbage collection system capable of
collecting reference cycles. Python 3.0, released in 2008, was a major revision of the language
that is not completely backward-compatible, and much Python 2 code does not run unmodified
on Python 3.

The Python 2 language, i.e. Python 2.7.x, was officially discontinued on 1 January 2020 (first
planned for 2015) after which security patches and other improvements will not be released for
it. With Python 2's end-of-life, only Python 3.5.xand later are supported.

Python interpreters are available for many operating systems. A global community of


programmers develops and maintains CPython, an open sourcereference implementation. A non-
profit organization, the Python Software Foundation, manages and directs resources for Python
and CPython development.

Python is used for:


 web development (server-side),
 software development,
 mathematics,
 system scripting.

Python do?:

 Python can be used on a server to create web applications.


 Python can be used alongside software to create workflows.
 Python can connect to database systems. It can also read and modify files.
 Python can be used to handle big data and perform complex mathematics.
 Python can be used for rapid prototyping, or for production-ready software development.

Why Python?:

 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
 Python has a simple syntax similar to the English language.
 Python has syntax that allows developers to write programs with fewer lines than some
other programming languages.
 Python runs on an interpreter system, meaning that code can be executed as soon as it is
written. This means that prototyping can be very quick.
 Python can be treated in a procedural way, an object-orientated way or a functional way.

Python compared to other programming languages

 Python was designed for readability, and has some similarities to the English language
with influence from mathematics.
 Python uses new lines to complete a command, as opposed to other programming
languages which often use semicolons or parentheses.
 Python relies on indentation, using whitespace, to define scope; such as the scope of
loops, functions and classes. Other programming languages often use curly-brackets for
this purpose.
Python installation procedure:

Windows Based

It is highly unlikely that your Windows system shipped with Python already installed. Windows
systems typically do not. Fortunately, installing does not involve much more than downloading
the Python installer from the python.org website and running it. Let’s take a look at how to
install Python 3 on Windows:

Step 1: Download the Python 3 Installer

1. Open a browser window and navigate to the Download page for Windows at python.org.


2. Underneath the heading at the top that says Python Releases for Windows, click on the link
for the Latest Python 3 Release - Python 3.x.x . (As of this writing, the latest is Python
3.6.5.)
3. Scroll to the bottom and select either Windows x86-64 executable installer for 64-bit
or Windows x86 executable installer for 32-bit. (See below.)

Sidebar: 32-bit or 64-bit Python?


For Windows, you can choose either the 32-bit or 64-bit installer. Here’s what the difference
between the two comes down to:

 If your system has a 32-bit processor, then you should choose the 32-bit installer.
 On a 64-bit system, either installer will actually work for most purposes. The 32-bit
version will generally use less memory, but the 64-bit version performs better for
applications with intensive computation.
 If you’re unsure which version to pick, go with the 64-bit version.

Note: Remember that if you get this choice “wrong” and would like to switch to another version
of Python, you can just uninstall Python and then re-install it by downloading another installer
from python.org.
Step 2: Run the Installer
Once you have chosen and downloaded an installer, simply run it by double-clicking on the
downloaded file. A dialog should appear that looks something like this:

Important: You want to be sure to check the box that says Add Python 3.x to PATH as shown
to ensure that the interpreter will be placed in your execution path.
Then just click Install Now. That should be all there is to it. A few minutes later you should
have a working Python 3 installation on your system.
RESULTS
CONCLUSION

In this project we proposed safety information gathering system by using A Smart Black Box
System. Presently it is applicable in Vehicles. Now we are implementing it in our own vehicles.
We are using sensor for finding accident and IOT functionality for sending Data link through
Server. So, that if an accident occurs then immediately information will send with the link of
location to provided mobile numbers. We can present the surrounding images and sensor values
in webpage. So, that it can be more helpful while the time of investigation.
REFERENCES

[1]. http://www.circuitdb.com/?p=1162

[2]. http://www.micropik.com/PDF/HCSR04.pdf

[3]. http://randomnerdtutorials.com/completeguideforultrasonicsensorhcsr04/

[4]. http://www.ezdenki.com/ultrasonic.php (^fantastic tutorial, explains a lot of stuff)

[5]. http://www.elecrow.com/hcsr04ultrasonicrangingsensorp316.html

[6]. http://researchdesignlab.com/index.php/modules/gsm-sim900.html

[7]. http://forum.researchdesignlab.com/datasheet/SIM900A

[8]. Black-box theory used to understand Consumer behavior Marketing By Richard L.


Sandhusen. Retrieved 11/09/2011

[9]. Black box theory applied briefly to Isaac Newton

[10].L. Dae Geun, J. Se Myoung, L. Myoung Seob, “System on Chip design of Embedded
Controller for Car Black Box”, Intelligent Vehicles Symposium IEEE 2007, pp. 1174-1177, 13
June 2007.

[11].(PDF)Vehicle Black Box System. Available from:


https://www.researchgate.net/publication/4334587_Vehicle_Bla ck_Box_System

[12].International journal of Innovative Science and Modern Engineering (IJISME) ISSN : 2319-
6386 , Volume -2

[13].Prof. M. Nirmala, M.Dineshkumar,”Design and Implementation of automotive control


features using ARM”, Volume-2.

You might also like