Designing A Complete Vehicle Safety and Alert System Integrated Iot

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

DESIGNING A COMPLETE VEHICLE SAFETY AND ALERT SYSTEM

INTEGRATED IOT

INTRODUCTION:

Vehicle security system has been a topic of great interest over the years due to the increasing

vehicle theft cases reported all over the world. Most of the advanced vehicle security

systems best suit the four wheelers. As far as the security system for two wheelers is

concerned, the systems available in market are of no match to the well equipped thieves.

When under attack, these systems can only immobilize the vehicle safety alert. It is a serious

limitation. In this project we propose a reliable and robust design of Vehicle Security System

(VSS) with features enhancing the security of the vehicle. In our proposed security system

various new features are included in addition to the Key alert system. Few of the important

features supported by this system are Internet of Things Technology. Redundancy is

maintained to make the system reliable even in the worst case scenario, but due to cost

constraints a tradeoff between cost and redundancy was necessary. This system is designed

to be compatible with almost all the brands of vehicle.

ABSTRACT:
In automotive applications, vehicle safety is one of the important aspects in the area of

security system. The crime related to vehicle safety and alert system has been a tremendous

rise in every day. This generates a crucial need for an effective vehicle safety diagnosis

system. In this project, a compact, efficient system is studied, designed and explored. An

integrated control system, which is monitors vehicle status conditions and the right

authentication using fingerprint sensor. Alcohol presence is continuously monitored using

sensors and whenever alcohol detects vehicle engine needs to shut down to avoid accidents.

EXISTING SYSTEM:

At present the vehicle theft cases are common in cities Insecurity of vehicle is one of

the major challenges that the India is facing now, each state having their peculiar security

issues. The crime rate in society these days has become a threatening issue such that vehicles

are now used for committing criminal activities more than before.

LITERATURE SURVEY

SECURITY AND PRIVACY IN THE INTERNET OF VEHICLES

ABSTRACT:

Internet of Vehicles (IOV) is a typical application of Internet of things in the


field of transportation, which aims at achieving an integrated intelligent
transportation system to enhance traffics, to avoid accidents, to ensure road
safety, and to improve driving experiences. Due to its characteristics of dynamic
topological structures, huge network scale, non-uniform distribution of nodes,
and mobile limitation, IOV systems face various types of attacks, such as
authentication and identification attacks, availability attacks, confidentiality
attacks, routing attacks, data authenticity attacks and etc., which result in several
challenging requirements in security and privacy. Many security scientists made
numerous efforts to ensure the security and privacy for the Internet of Vehicles in
recent years. This paper aims to review the advances on issues of security and
privacy in IOV, including security and privacy requirements, attack types, and
the relevant solutions, and discuss challenges and future trends in this area.

AUTHORS: Yunchuan Sun, Lei Wu, Shizhong Wu, Shoupeng Li,

A SECURE AUTHENTICATION PROTOCOL FOR INTERNET OF


VEHICLE

ABSTRACT:

An Internet of Vehicles (IoV) allows forming a self-organized network and


broadcasting messages for the vehicles on roads. However, as the data are
transmitted in an insecure network, it is essential to use an authentication
mechanism to protect the privacy of vehicle users. Recently, Ying et al. proposed
an authentication protocol for IoV and claimed that the protocol could resist
various attacks. Unfortunately, we discovered that their protocol suffered from
an offline identity guessing attack, location spoofing attack, and replay attack,
and consumed a considerable amount of time for authentication. To resolve these
shortcomings, we propose an improved protocol. In addition, we provide a
formal proof to the proposed protocol to demonstrate that our protocol is indeed
secure. Compared with previous methods, the proposed protocol performs better
in terms of security and performance.

AUTHORS: CHIEN-MING CHEN , BIN XIANG, YINING LIU ,

FACE RECOGNITION IN AUTOMOTIVE APPLICATIONS

ABSTRACT:

Already available Advanced driver-assistance systems technologies, like lane


departure, cruse control, blind spot detection, etc. are constructing a model of the
external environment, helping to increase the security in traffic. With the
advance of the autonomous driving, the car makers are shifting the focus also
into the interior of the car. Face recognition, i.e. recognizing a person, based on a
picture, which is highly available on social platforms(e.g. Facebook) poses a
challenge when it has to be implemented in an automotive system, due to smaller
computational power and lower memory currently available in such system. This
paper explores the possibility to implement a face recognition on an automotive
embedded system. The system is composed from a infrared camera, 1MPixel
resolution, and an image processing unit based on TDA3x

AUTHORS: Danut Rotar, Horia Popa Andreescu.

REAL TIME APPLICATION OF VEHICLE ANTI THEFT DETECTION


AND PROTECTION WITH SHOCK USING FACIAL RECOGNITION
AND IOT NOTIFICATION
ABSTRACT:

Enhancement in vehicle technology system is getting increased research


popularity and adding a vehicle theft security system in order to avoid getting
vehicle theft in the parking and sometimes driving in unsecured places. The
proposed system provided security and better theft control by using facial
recognition and giving shock treatment, when the unauthorized person try to start
the ignition and will be notified by the IOT application. The system uses
Microprocessor raspberry pi along with a pie cam and a WIFI controller installed
in the vehicle the implemented system is very simple with greater security for
vehicle anti-theft protection and low cost technique compared to others.

AUTHORS: Syed fasiuddin, Syed Omer, Dr. Khan Sohelrana.

REAL TIME SMART CAR LOCK SECURITY SYSTEM USING FACE


DETECTION AND RECOGNITION

ABSTRACT

An improved face detection and recognition method based on information of


skin color is proposed in this paper. Color is a powerful fundamental cue of
human faces. Skin color detection is first performed on the input color image
to reduce the computational complexity. Morphological operations are used
and it gives a prior knowledge for face detection. Face is detected by
Adaboost algorithm. AdaBoost learning is used to choose a small number of
weak classifiers and to combine them into a strong classifier deciding
whether an image is a face or not. Then, by using principal component
analysis(PCA) algorithm, a specific face can be recognized by comparing the
principal components of the current face to those of the known individuals in
a facial database built in advance.

AUTHORS: S.Padmapriya ,Esther Annlin KalaJames,

PROPOSED SYSTEM:

The proposed system consists of two sections

 Authorization section

 Helmet section

Authorization section consists of microcontroller with finger print and face recognition by

python image processing. Only the vehicle on, when the fingerprint sensor is matching with

face. If the fingerprint does not match, then the vehicle does not turn on. And that data

updated in IOT.

In vehicle section consists microcontroller with gas sensor and IR sensor If the driver

consumes the alcohol sensed by the gas sensor, then the alcohol consumption is updated in

IOT web page and turn off motor. And also need helmet wear identify by the IR sensor.
BLOCK DIAGRAM:

AUTHORIZATION SECTION:

FACE DETECTION POWER SUPPLY


SYSTEM

UART

LCD

DRIVER CIRCUIT
IOT
MICRO
CONTROLLER

DC MOTOR
WSN

FINGER PRINT
SENSOR
HELMET SECTION:

POWER SUPPLY

GAS SENSOR

LCD

WSN
MICRO
CONTROLLER

IR SENSOR

HARDWARE COMPONENTS:

 MICROCONTROLLER

 FINGER PRINT SENSOR

 UART

 DRIVER CIRCUIT

 DC MOTOR
 IOT

 GAS SENSOR

 LCD DISPLAY

 IR SENSOR

 POWER SUPPLY

 WSN

SOFTWARE COMPONENTS:

 EMBEDDED C

 ARDUINO IDE

 PYTHON IDE

HARDWARE DESCRIPTION:

MICROCONTROLLER

ESP32

INTRODUCTION
Arduino is a great platform for beginners into the World of Microcontrollers and
Embedded Systems. With a lot of cheap sensors and modules, you can make
several projects either as a hobby or even commercial.

As technology advanced, new project ideas and implementations came into play
and one particular concept is the Internet of Things or IoT. It is a connected
platform, where several “things” or devices are connected over internet for
exchange of information.

In DIY community, the IOT projects are mainly focused on Home Automation
and Smart Home applications but commercial and industrial IoT projects have
far complex implementations like Machine Learning, Artificial Intelligence,
Wireless Sensor Networks etc.

The important thing in this brief intro is whether it is a small DIY project by a
hobbyist or a complex industrial project, any IoT project must have connectivity
to Internet. This is where the likes of ESP8266 and ESP32 come into picture.

If you want to add Wi-Fi connectivity to your projects, then ESP8266 is a great
option. But if you want build a complete system with Wi-Fi connectivity,
Bluetooth connectivity, high resolution ADCs, DAC, Serial Connectivity and
many other features, then ESP32 is the ultimate choice.

What is ESP32?
ESP32 is a low-cost System on Chip (SoC) Microcontroller from Espressif
Systems, the developers of the famous ESP8266 SoC. It is a successor to
ESP8266 SoC and comes in both single-core and dual-core variations of the
Tensilica’s 32-bit Xtensa LX6 Microprocessor with integrated Wi-Fi and
Bluetooth.

The good thing about ESP32, like ESP8266 is its integrated RF components like
Power Amplifier, Low-Noise Receive Amplifier, Antenna Switch, Filters and RF
Balun. This makes designing hardware around ESP32 very easy as you require
very few external components.
Another important thing to know about ESP32 is that it is manufactured using
TSMC’s ultra-low-power 40 nm technology. So, designing battery operated
applications like wearables, audio equipment, baby monitors, smart watches, etc.,
using ESP32 should be very easy.

GENERAL DESCRIPTION:

ESP32 is a series of low-cost, low-power system on a chip microcontrollers with


integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs either a
Tensilica Xtensa LX6 microprocessor in both dual-core and single-core
variations, Xtensa LX7 dual-core microprocessor or a single-core RISC-V
microprocessor and includes built-in antenna switches, RF balun, power
amplifier, low-noise receive amplifier, filters, and power-management modules.
ESP32 is created and developed by Espressif Systems, a Shanghai-based Chinese
company, and is manufactured by TSMC using their 40 nm process.
Specifications of ESP32

ESP32 has a lot more features than ESP8266 and it is difficult to include all the
specifications in this Getting Started with ESP32 guide. So, I made a list of some
of the important specifications of ESP32 here. But for complete set of
specifications, I strongly suggest you to refer to the Datasheet.

 Single or Dual-Core 32-bit LX6 Microprocessor with clock frequency up to


240 MHz.
 520 KB of SRAM, 448 KB of ROM and 16 KB of RTC SRAM.
 Supports 802.11 b/g/n Wi-Fi connectivity with speeds up to 150 Mbps.
 Support for both Classic Bluetooth v4.2 and BLE specifications.
 34 Programmable GPIOs.
 Up to 18 channels of 12-bit SAR ADC and 2 channels of 8-bit DAC
 Serial Connectivity include 4 x SPI, 2 x I2C, 2 x I2S, 3 x UART.
 Ethernet MAC for physical LAN Communication (requires external PHY).
 1 Host controller for SD/SDIO/MMC and 1 Slave controller for SDIO/SPI.
 Motor PWM and up to 16-channels of LED PWM.
 Secure Boot and Flash Encryption.
 Cryptographic Hardware Acceleration for AES, Hash (SHA-2), RSA, ECC
and RNG.

POWER SUPPLY

ADAPTER

GENERAL DESCRIPTION

An adapter is a device that converts attributes of one electrical device or system


to those of an otherwise incompatible device or system. Some modify power or
signal attributes, while others merely adapt the physical form of one electrical
connector to another. In a computer, an adapter is often built into a card that can
be inserted into a slot on the computer's motherboard. The card adapts
information that is exchanged between the computer's microprocessor and the
devices that the card supports.

PRODUCT DESCRIPTION
An electric power adapter may enable connection of a power plug, sometimes
called, used in one region to a AC power socket used in another, by offering
connections for the disparate contact arrangements, while not changing the
voltage. An AC adapter, also called a "recharger", is a small power supply that
changes household electric current from distribution voltage) to low voltage DC
suitable for consumer electronics. Some modify power or signal attributes, while
others merely adapt the physical form of one electrical connector to another. For
computers and related items, one kind of serial port adapter enables connections
between 25-contact and nine-contact connectors, but does not affect electrical
power- and signalling-related attributes.

FEATURES

 Output current:1A

 Supply voltage: 220-230VAC

 Output voltage: 12VDC

 Reduced costs
 Increased value across front-office and back-office functions

 Access to current, accurate, and consistent data

 It generates adapter metadata as WSDL files with J2CA extension.

APPLICATIONS

 Back-end systems which need to send purchase order data to oracle


applications send it to the integration service via integration server client.

 SMPS applications.

FINGERPRINT READER WITH BOARD

GENERAL DESCRIPTION

SM-621 is RS232 /UART fingerprint module scanner for the demand of access
control system, door lock, T&A and safety box OEM POS Consisting of high
function DSP, large capacity FLASH and color CMOS, etc, SM621 optical
fingerprint module can conduct fingerprint enrollment, image processing,
templates storage, fingerprint matching and fingerprint searching. This Optical
biometric fingerprint reader is with great features and can be embedded into a
variety of end products, such as: access control, attendance, safety deposit box,
car door locks. PRODUCT DESCRIPTION R305 fingerprint module is
fingerprint sensor with TTL UART interface for direct connections to
microcontroller UART or to PC through MAX232 / USBSerial adapter. The user
can store the fingerprint data in the module and can configure it in 1:1 or 1: N
mode for identifying the person. The FP module can directly interface with 3v3
or 5v Microcontroller. A level converter (like MAX232) is required for
interfacing with PC serial port.

FEATURES

 Input voltage: 5v
 Interface: RS232.
 Matching Mode: 1:1 and 1:N.
 Baud rate: 9600 – 115200.
 Storage Capacity: 256.

APPLICATIONS

 Attendance system.
 Safety deposit box system.
 Car door locking system.
DC MOTOR:

GENERAL DESCRIPTION

The relationship between torque vs speed and current is linear as shown left; as
the load on a motor increases, Speed will decrease. The graph pictured here
represents the characteristics of a typical motor. As long as the motor is used in
the area of high efficiency (as represented by the shaded area) long life and good
performance can be expected. However, using the motor outside this range will
result in high temperature rises and deterioration of motor parts. A motor's basic
rating point is slightly lower than its maximum efficiency point. Load torque can
be determined by measuring the current drawn when the motor is attached to a
machine whose actual load value is known.

PRODUCT DESCRIPTION

Geared dc motors can be defined as an extension of dc motors. A geared DC


Motor has a gear assembly attached to the motor. The speed of motor is counted
in terms of rotations of the shaft per minute and is termed as RPM .The gear
assembly helps in increasing the torque and reducing the speed. Using the correct
combination of gears in a gear motor, its speed can be reduced to any desirable
figure. This concept where gears reduce the speed of the vehicle but increase its
torque is known as gear reduction. A DC motor can be used at a voltage lower
than the rated voltage. But, below 1000 rpm, the speed becomes unstable, and the
motor will not run smoothly.

FEATURES

 Supply voltage: 12VDC


 Speed: 60rpm
 Long Lifetime, Low Noise, Smooth Motion
 Equipped with high efficiency

APPLICATIONS

 Coin Changing equipment


 Peristaltic Pumps
 Damper Actuators
 Fan Oscillators
 Photo copier
 Ticket printer
 Low Current Consumption: 400 μA
 Sleep Mode: 3μA
 Low Voltage Operation: 2.2 V – 3.6 V
 High Sensitivity (800 mV/g @ 1.5g)
 Selectable Sensitivity (±1.5g, ±6g)
 Fast Turn on Time (0.5 ms Enable Response Time)
 Self Test for Freefall Detect Diagnosis

APPLICATIONS

 Self-balancing robots
 Tilt-mode game controllers
 Model airplane auto pilot
 Car alarm systems
 Crash detection/airbag deployment

IOT

The Internet of things (IoT) is the network of everyday objects — physical


things embedded with electronics, software, sensors, and connectivity enabling
data exchange. Basically, a little networked computer is attached to a thing,
allowing information exchange to and from that thing. Be it lightbulbs, toasters,
refrigerators, flower pots, watches, fans, planes, trains, automobiles, or anything
else around you, a little networked computer can be combined with it to accept
input (especially object control) or to gather and generate informational output
(typically object status or other sensory data).

This means computers will be permeating everything around us —


ubiquitous embedded computing devices, uniquely identifiable,
interconnected across the Internet. Because of low-cost, networkable
microcontroller modules, the Internet of things is really starting to take off.

WEB SERVER
Espresso's ESP32 delivers highly integrated Wi-Fi SoC solution to meet users’
continuous demands for efficient power usage, compact design and reliable
performance in the Internet of Things industry. With the complete and self-
contained Wi-Fi networking capabilities, ESP32 can perform either as a
standalone application or as the slave to a host MCU. When ESP32 hosts the
application, it promptly boots up from the flash. The integrated high speed cache
helps to increase the system performance and optimize the system memory. Also,
ESP32 can be applied to any microcontroller design as a Wi-Fi adaptor through
SPI / SDIO or I2C / UART interfaces. ESP32 integrates antenna switches, RF
balun, power amplifier, low noise receive amplifier, filters and power
management modules. The compact design minimizes the PCB size and requires
minimal external circuitries. Besides the Wi-Fi functionalities, ESP32 also
integrates an enhanced version of Tensilica’s L106 Diamond series 32-bit
processor and on-chip SRAM. It can be interfaced with external sensors and
other devices through the GPIOs. Software Development Kit (SDK) provides
sample codes for various applications.

Espressif Systems’ Smart Connectivity Platform (ESCP) enables sophisticated


features including fast switch between sleep and wakeup mode for energy-
efficient purpose, adaptive radio biasing for low-power operation, advance signal
processing, spur cancellation and radio co-existence mechanisms for common
cellular, Bluetooth, DDR, LVDS, LCD interference mitigation.

Channel Frequencies:
• The RF transceiver supports the following channels according to
IEEE802.11b/g/n standards

GHz Receiver:

• The 2.4 GHz receiver down-converts the RF signals to quadrature


baseband signals and converts them to the digital domain with 2 high
resolution high speed ADCs. To adapt to varying signal channel conditions,
RF filters, automatic gain control (AGC), DC offset cancelation circuits
and baseband filters are integrated within ESP32.

GHz Transmitter:

• The 2.4 GHz transmitter up-converts the quadrature baseband signals to


2.4 GHz, and drives the antenna with a high-power CMOS power
amplifier. The function of digital calibration further improves the linearity
of the power amplifier, enabling a state of art performance of delivering
+19.5 dBm average power for 802.11b transmission and +16 dBm for
802.11n transmission.

• Additional calibrations are integrated to offset any imperfections of the


radio, such as:

• Carrier leakage

• I/Q phase matching

• Baseband nonlinearities
• These built-in calibration functions reduce the product test time and make
the test equipment unnecessary

WEB SERVER : Controlling Section

FEATURES

• Power Supply: DC +12v 1Amp.

• Auto data updating: 30sec

• Digital Output port Pins: +5V DC

• Message Format: *message or Data # (Start with * and End with #)

• Provided with 3 links


• Data updating to a specific web site

• Device controlling web site

• Data updating to a social network

APPLICATIONS

• Online Traffic monitoring

• Online Health monitoring

• Real time Transport and Logistics monitoring

• Daily life and domestics

16×2 LCD

GENERAL DESCRIPTION

LCD stands for liquid crystal display. They come in many sizes 8x1 , 8x2 ,
10x2 , 16x1 , 16x2 , 16x4 , 20x2 , 20x4 ,24x2 , 30x2 , 32x2 , 40x2 etc . Many
multinational companies like Philips Hitachi Panasonic make their own special
kind of LCD'S to be used in their products. All the LCD'S performs the same
functions (display characters numbers special characters ASCII characters
etc).Their programming is also same and they all have same 14 pins (0-13) or 16
pins (0 to 15). Alphanumeric displays are used in a wide range of applications,
including palmtop computers, word processors, photocopiers, point of sale
terminals, medical instruments, cellular phones, etc.
PRODUCT DESCRIPTION

This is an LCD Display designed for E-blocks. It is a 16 character, 2-line


alphanumeric LCD display connected to a single 9-way D-type connector. This
allows the device to be connected to most E-Block I/O ports. The LCD display
requires data in a serial format, which is detailed in the user guide below. The
display also requires a 5V power supply. Please take care not to exceed 5V, as
this will cause damage to the device. The 5V is best generated from the E-blocks
Multi programmer or a 5V fixed regulated power supply. The 16 x 2 intelligent
alphanumeric dot matrix displays is capable of displaying 224 different
characters and symbols. A full list of the characters and symbols is printed on
pages 7/8 (note these symbols can vary between brand of LCD used). This
booklet provides all the technical specifications for connecting the unit, which
requires a single power supply (+5V).

FEATURES

 Input voltage: 5v
 E-blocks compatible
 Low cost
 Compatible with most I/O ports in the E-Block range
 Ease to develop programming code using Flow code icons

APPLICATIONS

 Monitoring

GAS SENSOR

GENERAL DESCRIPTION

In current technology scenario, monitoring of gases produced is very important.


From home appliances such as air conditioners to electric chimneys and safety
systems at industries monitoring of gases is very crucial. Gas sensors
spontaneously react to the gas present, thus keeping the system updated about
any alterations that occur in the concentration of molecules at gaseous state. The
gas sensor module consists of a steel exoskeleton under which a sensing element
is housed.

This sensing element is subjected to current through connecting leads. This


current is known as heating current through it, the gases coming close to the
sensing element get ionized and are absorbed by the sensing element. This
changes the resistance of the sensing element which alters the value of the
current going out of it. The connecting leads of the sensor are thick so that sensor
can be connected firmly to the circuit and sufficient amount of heat gets
conducted to the inside part. They are casted from copper and have tin plating
over them.

PRODUCT DESCRIPTION

MQ-8 gas sensor composed by micro AL2O3 ceramic tube, Tin Dioxide (SnO2)
sensitive layer, measuring electrode and heater are fixed into a crust made by
plastic and stainless steel net. MQ-8 gas sensor has high sensitivity to hydrogen
gas and has anti-interference to gases. The enveloped MQ-8 have 6 pin, 4 of
them are used to fetch signals, and other 2 are used for providing heating current.
The MQ-8 gas module is mounted on a pcb board which has an operating voltage
of 5VDC. The sensor output values can be get by means of both analog and
digital.

FEATURES

 Operating voltage: 5VDC


 Operating current: 100-150mA
 Both analog and digital output
 Simple drive circuit

APPLICATIONS

 Hydrogen gas leakage detection


 Portable gas detector
 Fire safety detection system

IR SENSOR

GENERAL DESCRIPTION

IR LED emits infrared radiation. This radiation illuminates the surface in front of

LED. Depending on reflectivity of the surface, amount of light reflected varies.

This reflected light is made incident on reverse biased IR sensor. The amount of

electron-hole pairs generated depends on intensity of incident IR radiation. Thus

as intensity of incident ray varies, voltage across resistor will vary accordingly.

PRODUCT DESCRIPTION

An infrared sensor is an electronic device, that emits in order to sense some

aspects of the surroundings. An IR sensor can measure the heat of an object as


well as detects the motion. Usually in the infrared spectrum, all the objects

radiate some form of thermal radiations. These types of radiations are invisible to

our eyes, that can be detected by an infrared sensor. The emitter is simply an IR

LED (Light Emitting Diode) and the detector is simply an IR photodiode which

is sensitive to IR light of the same wavelength as that emitted by the IR LED.

When IR light falls on the photodiode, The resistances and these output voltages,

change in proportion to the magnitude of the IR light received.

FEATURES

 Operating voltage:5VDC

 Output voltage: 0 or 5VDC

 Easy to assemble and use


 Onboard detection indication

 Effective distance range of 2cm

APPLICATIONS

 Augmentative communication devices

 Car locking systems

 Computers

 Signage

 Telephones

UART COMMUNICATION
UART stands for Universal Asynchronous Receiver/Transmitter.
It’s not a communication protocol like SPI and I2C, but a physical
circuit in a microcontroller, or a stand- alone IC. A UART’s main
purpose is to transmit and receive serial data.
INTRODUCTION TO UART COMMUNICATION

In UART communication, two UARTs communicate directly with


each other. The transmitting UART converts parallel data from a
controlling device like a CPU into serial form, transmits it in serial to the
receiving UART, which then converts the serial data back into parallel
data for the receiving device. Only two wires are needed to transmit data
between two UARTs. Data flows from the Tx pin of the transmitting
UART to the Rx pin of the receiving UART.
UARTs transmit data asynchronously, which means there is no clock
signal to synchronize the output of bits from the transmitting UART to the
sampling of bits by the receiving UART. Instead of a clock signal, the
transmitting UART adds start and stop bits to the data packet being
transferred. These bits define the beginning and end of the data packet so
the receiving UART knows when to start reading the bits. When the
receiving UART detects a start bit, it starts to read the incoming bits at a
specific frequency known as the baud rate. Baud rate is a measure of the
speed of data transfer, expressed in bits per second (bps). Both UARTs
must operate at about the same baud rate. The baud rate between the
transmitting and receiving UARTs can only differ by about 10% before the
timing of bits gets too far off .Both UARTs must also must be configured
to transmit and receive the same data packet structure.

HOW UART WORKS

The UART that is going to transmit data receives the data from a
data bus. The data bus is used to send data to the UART by another
device like a CPU, memory, or microcontroller. Data is transferred from
the data bus to the transmitting UART in parallel form. After the
transmitting UART gets the parallel data from the data bus, it adds a
start bit, a parity bit, and a stop bit, creating the data packet. Next, the
data packet is output serially, bit by bit at the Tx pin. The receiving
UART reads the data packet bit by bit at its Rx pin. The receiving
UART then converts the data back into parallel form and removes the
start bit, parity bit, and stop bits. Finally, the receiving UART transfers
the data packet in parallel to the data bus on the receiving end: UART
transmitted data is organized into packets. Each packet contains 1 start
bit, 5 to 9 data bits (depending on the UART), an optional parity bit, and
1 or 2stop bits.

START BIT

The UART data transmission line is normally held at a high


voltage level when it’s not transmitting data. To start the transfer of data,
the transmitting UART pulls the transmission line from high to low for
one clock cycle. When the receiving UART detects the high to low
voltage transition, it begins reading the bits in the data frame at the
frequency of the baud rate.

DATA FRAME
The data frame contains the actual data being transferred. It can be
5 bits upto 8 bits long if a parity bit is used. If no parity bit is used, the
data frame can be 9 bits long. In most cases, the data is sent with the
least significant bit first .Parity Parity describes the evenness or oddness
of a number. The parity bit is a way for the receiving UART to tell if any
data has changed during transmission. Bits can be changed by
electromagnetic radiation, mismatched baud rates, or long distance data
transfers. After the receiving UART reads the data frame, it counts the
number of bits with a value of 1 and checks if the total is an even or odd
number. If the parity bit is a 0 (even parity), the 1 bits in the data frame
should total to an even number. If the parity bit is a 1 (odd parity), the 1
bits in the data frame should total to an odd number. When the parity bit
matches the data, the UART knows that the transmission was free of
errors. But if the parity bit is a 0, and the total is odd; or the parity bit is
a 1, and the total is even, the UART knows that bits in the data frame
have changed.

STOP BITS

To signal the end of the data packet, the sending UART drives the
data transmission line from a low voltage to a high voltage for at least
two bit durations.
STEPS OF UART TRANSMISSION

1. The transmitting UART receives data in parallel from the data bus:

2. The transmitting UART adds the start bit, parity bit, and the stop bit(s) to the
data frame:

3. The entire packet is sent serially from the transmitting UART to the
receiving UART. The receiving UART samples the data line at the pre-
configured baud rate:

4. The receiving UART discards the start bit, parity bit, and stop bit from the
data frame:

5. The receiving UART converts the serial data back into parallel and
transfers it to the data bus on the receiving end:

ADVANTAGES AND DISADVANTAGES OF UARTS

No communication protocol is perfect, but UARTs are pretty good


at what they do. Here are some pros and cons to help you decide whether
or not they fit the needs of your project:

ADVANTAGES

 Only uses two wires


 No clock signal is necessary
 Has a parity bit to allow for error checking
 The structure of the data packet can be changed as long as both sides
are setup for it Well documented and widely used meth

WSN

ZIGBEE

GENERAL DESCRIPTION

ZigBee is an IEEE 802.15.4-based specification for a suite of high-level


communication protocols used for wireless networking. It is a wireless
technology developed as an open global standard to address the unique needs of
low-cost, low-power wireless M2M networks. ZigBee (CC2500) is a low cost
true single chip 2.4 GHz transceiver designed for very low power wireless
applications. The RF transceiver is integrated with a highly configurable
baseband modem.

PRODUCT DESCRIPTION

ZigBee devices are required to conform to the IEEE 802.15.4-2003 LowRate


Wireless Personal Area Network (LR-WPAN) standard. The standard specifies
the lower protocol layers are the physical layer (PHY), and the Media Access
Control portion of the data link layer (DLL). The technology defined by the
ZigBee specification is intended to be simpler and less expensive than other
wireless personal area networks (WPANs), such as Bluetooth or Wi-Fi. Its low
power consumption limits transmission distances to 10–100 meters line-ofsight,
depending on power output and environmental characteristics. ZigBee devices
can transmit data over long distances by passing data through a mesh network of
intermediate devices to reach more distant ones. ZigBee is typically used in low
data rate applications that require long battery life and secure networking.
ZigBee has a defined rate of 250 kbit/s, best suited for intermittent data
transmissions from a sensor or input device.

FEATURES

 Supply voltage: 5v DC
 Detection range: (10-30) m
 RS232 Output
 TTL uart also provided
 Frequency: 2.4GHz
 Tx and Rx Status LEDs
 Low power
APPLICATIONS

 Lighting controls
 Switching
 Wireless keyboard and mouse
 Consumer electronics
SOFTWARE DESCRIPTION:

ARDUINO SOFTWARE (IDE)

Get the latest version from the download page. You can choose
between the Installer (.exe) and the Zip packages. We suggest you use
the first one that installs directly everything you need to use the Arduino
Software (IDE), including the drivers. With the Zip package you need to
install the drivers manually. The Zip file is also useful if you want to
create a portable installation.

When the download finishes, proceed with the installation and please
allow the driver installation process when you get a warning from the
operating system.
Choose the components to install

Choose the installation directory (we suggest to keep the default one)

The process will extract and install all the required files to execute
properly the Arduino Software (IDE)
Arduino Boot loader Issue

The current boot loader burned onto the Arduino UNO is not
compatible with ROBOTC. In its current form, you will be able to
download the ROBOTC Firmware to the ArduinoUNO, but you will not
able to download any user programs.

The reason for this is because there is a bug in the Arduino UNO
firmware that does not allow flash write commands to start at anywhere
but the beginning of flash memory (0x000000). See the bottom of this
page for more technical details.

Because ROBOTC is not able to burn a new bootloader as of


today, you will need to use the Arduino's Open Source language with a
modified bootloader file to re-burn your bootloader on your Arduino
UNO boards. The enhanced bootloader is backwards compatible with
the original one. That means you'll still be able to program it through the
Arduino programming environment as before, in addition to ROBOTC
for Arduino.

Hardware Needed

To burn a new version of the Arduino boot loader to your UNO,


you'll need an AVR ISP Compatible downloader.
Using an AVR ISP (In System Programmer)

 Your Arduino UNO (to program)


 An AVR Programmer such as the AVR Pocket Programmer
 An AVR Programming Cable (the pocket programmer comes with
one)

If you have extra Arduino boards, but no ISP programmer,


SparkFun.com has a cool tutorial on how to flash a bootloader using an
Arduino as an ISP.

Using another Arduino as an ISP

 Your Arduino UNO (to program)


 A Working Arduino (doesn't matter what kind)
 Some Male-to-Male Jumper Cables

For instructions on this method, take a look at the SparkFun.com


website: http://www.sparkfun.com/tutorials/247

Software Needed

ROBOTC is not currently able to burn a bootloader onto an Arduino


board, so you'll need to download a copy of the latest version of the
Arduino Open-Source programming language.

 Arduino Official Programming Language - Download Page


In addition, you'll need the ROBOTC modified bootloader. You can
download that here:

 ROBOTC Modified UNO Bootloader - Modified Bootloader

Bootload Download Instructions

 Download the Arduino Open Source Software and a copy of the


Modified Bootloader File
 Copy the Modified Bootloader File into the
/Arduino-1.0/hardware/arduino/bootloaders/stk500v2/ and
overwrite the existing bootloader.

 Power up your Arduino UNO (either via USB or external power)


 Plug in your AVR ISP Programmer to your computer (make sure
you have any required drivers installed)
 Connect your AVR ISP Programmer into your Arduino UNO
Board via the ISP Header (the 2x3 header pins right above the
Arduino Logo)
 Launch the Arduino Open Source Software

 Change your settings in the Arduino Software to look for an


Arduino UNO

 Change your settings in the Arduino Software to select your ISP


Programmer Type (Check your programmer's documentation for
the exact model)
 Select the "Burn Bootloader" option under the "Tools" menu. The
modified bootloader will now be sent to your Arduino. This
typically take a minute or so.

 You should be all set to download ROBOTC firmware and start


using your Arduino UNO with ROBOTC.
Technical Details

The Arduino Boot loader sets the "erase Address" to zero every time the
boot loader is called. ROBOTC called the "Load Address" command to
set the address in which we want to write/verify when downloading
program.

When writing a page of memory to the arduino, the Arduino boot loader
will erase the existing page and write a whole new page.

In the scenario of downloading firmware, everything is great because the


Erase Address and the Loaded Address both start at zero.

In the scenario of writing a user program, we start writing at memory


location 0x7000, but the Boot loader erases information starting at
location zero because the "Load Address" command doesn't update
where to erase.

Our modification is to set both the Load Address and the Erase Address
so the activity of writing a user program doesn't cause the firmware to be
accidentally erased.

Summary
Microcontroller Arduino UNO
Operating Voltage 5V Input Voltage (recommended)
Input Voltage (limits) 6-20V

Digital I/O Pins 54 (of which 14 provide PWM output)

Analog Input Pins 16

DC Current per I/O Pin 40mA

DC Current for3.3VPin 50mA

Flash Memory 256 KB of which 8 KB used by


bootloader

SRAM 8KB

EEPROM 4KB

Lock Speed 16MHz

The Arduino UNO can be powered via the USB connection or with
an external power supply. The power source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter
(wall-wart) or battery. The adapter can be connected by plugging a
2.1mm center-positive plug into the board's power jack. Leads from a
battery can be inserted in the Gnd and Vin pin headers of the POWER
connector.
The board can operate on an external supply of 6 to 20 volts. If
supplied with less than 7V, however, the 5V pin may supply less than
five volts and the board may be unstable. If using more than 12V, the
voltage regulator may overheat and damage the board. The
recommended range is 7 to 12 volts.

They differs from all preceding boards in that it does not use the FTDI
USB-to-serial driver chip. Instead, it features the programmed as a
USB-to-serial converter.

The power pins are as follows:

 VIN. The input voltage to the Arduino board when it's using an
external power source (as opposed to 5 volts from the USB
connection or other regulated power source). You can supply
voltage through this pin, or, if supplying voltage via the power
jack, access it through this pin.
 5V. The regulated power supply used to power the
microcontroller and other components on the board. This can
come either from VIN via a non-board regulator, or be supplied
by USB or another regulated 5V supply.
 3V3.A3.3voltsupplygeneratedbytheon-
boardregulator.Maximumcurrentdrawis50mA.
 GND. Ground pins.

The ATMEGA has 256 KB of flash memory for storing code (of
which 8 KB is used for the bootloader), 8 KB of SRAM and 4 KB of
EEPROM (which can be read and written with the EEPROM library).
Each of the 54 digital pins on the Mega can be used as an input or
output, using pinMode(), digitalWrite(), and digitalRead() functions.
They operate at 5 volts. Each pin can provide or receive a maximum of
40 mA and has an internal pull-up resistor (disconnected by default) of
20-50k Ohms. In addition, some pins have specialized functions:

 Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX);


Serial 2: 17 (RX) and 16 (TX); Serial 3: 15 (RX) and 14 (TX).
Used to receive (RX) and transmit (TX) TTL serial data. Pins 0
and 1 are also connected to the corresponding pins of the
ATMEGA USB-to-TTL Serial chip.

 External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18


(interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21
(interrupt 2). These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a changing
value. See the attach Interrupt() function for details.
 PWM: 0to13. Provide 8-bit PWM output with the analogWrite()
function.

 SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins


support SPI communication, which, although provided by the
underlying hardware, is not currently included in the Arduino
language. The SPI pins are also broken out on the ICSP header,
which is physically compatible with the Duemilanove and
Diecimila.

 LED: 13. There is a built-in LED connected to digital pin 13.


When the pin is HIGH value, the LED is on, when the pin is
LOW, it's off.

 I2C: 20 (SDA) and 21 (SCL). Support I2C (TWI)


communication using the Wire library (documentation on the
Wiring website). Note that these pins are not in the same location

as the I2C pins on the Duemilanove.

The Arduino UNO has 16 analog inputs, each of which provide 10 bits
of resolution (i.e. 1024 different values). By default they measure from
ground to 5 volts, though is it possible to change the upper end of their
range using the AREF pin and analog Reference() function.

There are a couple of other pins on the board:

 AREF. Reference voltage for the analog inputs. Used with analog
Reference().
 eset. Bring this line LOW to reset the microcontroller. Typically
used to add a reset button to shields which block the one on the
board.
Communication
The Arduino UNO has a number of facilities for communicating
with a computer, another Arduino, or other microcontrollers. The
Arduino UNO provides four hardware UARTs for TTL (5V) serial
communication.

An ATMEGA on the board channels one of these over USB and


provides a virtual comport to software on the computer (Windows
machines will need a .inf file, but OSX and Linux machines will
recognize the board as a COM port automatically. The Arduino software
includes a serial monitor which allows simple textual data to be sent to
and from the board. The RX and TX LEDs on the board will flash when
data is being transmitted via the ATmega8U2 chip and USB connection
to the computer (but not for serial communication on pins 0 and1).

A SoftwareSerial library allows for serial communication on any


of the digital pins.
The Arduino UNO also supports I2C (TWI) and SPI
communication. The Arduino software includes a Wire library to
simplify use of the I2C bus; see the documentation on the Wiring
website for details. To use the SPI communication, please see the
Arduino UNO datasheet.
Programming
The Arduino UNO can be programmed with the Arduino software
(download). For details, see the reference and tutorials.
The Arduino UNO on the Arduino UNO comes preburned with a
bootloader that allows you to upload new code to it without the use of an
external hardware programmer. It communicates using the original
STK500 protocol (reference, C header files).

You can also bypass the bootloader and program the


microcontroller through the ICSP (In-Circuit Serial Programming)
header; see these instructions for details.

Automatic (Software) Reset


Rather than requiring a physical press of the reset button before an
upload, the Arduino UNO is designed in a way that allows it to be reset
by software running on a connected computer. One of the hardware flow
control lines (DTR) of the ATmega8U2 is connected to the reset line of
the Arduino UNO via a 100 nanofarad capacitor. When this line is
asserted (taken low), the reset line drops long enough to reset the chip.
The Arduino software uses this capability to allow you to upload code
by simply pressing the upload button in the Arduino environment. This
means that the bootloader can have a shorter timeout, as the lowering of
DTR can be well-coordinated with the start of the upload.

This setup has other implications. When the Arduino UNO is


connected to either a computer running Mac OS X or Linux, it resets
each time a connection is made to it from software (via USB). For the
following half-second or so, the bootloader is running on the UNO.
While it is programmed to ignore malformed data (i.e. anything besides
an upload of new code), it will intercept the first few bytes of data sent
to the board after a connection is opened. If a sketch running on the
board receives one-time configuration or other data when it first starts,
make sure that the software with which it communicates waits a second
after opening the connection and before sending this data.

The Mega contains a trace that can be cut to disable the auto-reset.
The pads on either side of the trace can be soldered together to re-enable
it. It's labeled "RESET-EN". You may also be able to disable the auto-
reset by connecting a 110 ohm resistor from 5V to the reset line; see this
forum thread for details.

USB Over current Protection

Physical Characteristics and Shield Compatibility

The Arduino UNO has a resettable poly fuse that protects your
computer's USB ports from shorts and over current. Although most
computers provide their own internal protection, the fuse provides an
extra layer ofprotection.Ifmorethan500mAisappliedtotheUSBport, the
fuse will automatically break the connection until the short or overload
is removed.
The maximum length and width of the UNO PCB are 4 and 2.1
inches respectively, with the USB connector and power jack extending
beyond the former dimension. Three screw holes allow the board to be
attached to a surface or case. Note that the distance between digital pins
7 and 8 is 160 mil (0.16"), not an even multiple of the 100 mil spacing of
the other pins.

The UNO is designed to be compatible with most shields designed


for the Diecimila or Duemilanove. Digital pins 0 to 13 (and the adjacent
AREF and GND pins), analog inputs 0 to 5, the power header, and ICSP
header are all in equivalent locations. Further the main UART (serial
port) is located on the same pins (0 and 1), as are external interrupts 0
and 1 (pins 2 and 3 respectively). SPI is available through the ICSP
header on both the Mega and Duemilanove / Diecimila.

Please note that I2C is not located on the same pins on the Mega
(20and21) as the Duemilanove / Diecimila (analog inputs 4 and 5).

How to use Arduino


Arduino can sense the environment by receiving input from a
variety of sensors and can affect its surroundings by controlling lights,
motors, and other actuators. The microcontroller on the board is
programmed using the Arduino programming language (based on
Wiring) and the Arduino development environment (based on
Processing). Arduino projects can be stand-alone or they can
communicate with software on running on a computer (e.g. Flash,
Processing, MaxMSP).

Arduino is a cross-platoform program. You’ll have to follow different


instructions for your personal OS. Check on the Arduino site for the
latest instructions. http://arduino.cc/en/Guide/HomePage
Once you have downloaded/unzipped the arduino IDE, you can plug the
Arduino to your PC via USB cable.

EMBEDDED C

ABOUT EMBEDDED C

High-level language programming has long been in use for


embedded-systems development. However, assembly programming still
prevails, particularly for digital-signal processor (DSP) based systems.
DSPs are often programmed in assembly language by programmers who
know the processor architecture inside out. The key motivation for this
practice is performance, despite the disadvantages of assembly
programming when compared to high-level language programming.

If the video decoding takes 80 percent of the CPU-cycle budget


instead of 90 percent, for instance, there are twice as many cycles
available for audio processing. This coupling of performance to end-user
features is characteristic of many of the real-time applications in which
DSP processors are applied. DSPs have a highly specialized architecture
to achieve the performance requirements for signal processing
applications within the limits of cost and power consumption set for
consumer applications. Unlike a conventional Load-Store (RISC)
architecture, DSPs have a data path with memory-access units that
directly feed into the arithmetic units. Address registers are taken out of
the general-purpose register file and placed next to the memory units in
a separate register file.

A further specialization of the data path is the coupling of


multiplication and addition to form a single cycle Multiply-accumulate
unit (MAC). It is combined with special-purpose accumulator registers,
which are separate from the general-purpose registers. Data memory is
segmented and placed close to the MAC to achieve the high bandwidths
required to keep up with the streamlined data path. Limits are often
placed on the extent of memory-addressing operations. The localization
of resources in the data path saves many data movements that typically
take place in a Load-Store architecture.

The most important, common arithmetic extension to DSP


architectures is the handling of saturated fixed-point operations by the
arithmetic unit. Fixed-point arithmetic can be implemented with little
additional cost over integer arithmetic. Automatic saturation (or
clipping) significantly reduces the number of control-flow instructions
needed for checking overflow explicitly in the program.Changes in
technological and economic requirements make it more expensive to
continue programming DSPs in assembly. Staying with the mobile
phone as an example, the signal-processing algorithms required become
increasingly complex. Features such as stronger error correction and
encryption must be added. Communication protocols become more
sophisticated and require much more code to implement. In certain
markets, multiple protocol stacks are implemented to be compatible with
multiple service providers. In addition, backward compatibility with
older protocols is needed to stay synchronized with provider networks
that are in a slow process of upgrading.

Today, most embedded processors are offered with C compilers.


Despite this, programming DSPs is still done in assembly for the signal
processing parts or, at best, by using assembly-written libraries supplied
by manufacturers. The key reason for this is that although the
architecture is well matched to the requirements of the signal-processing
application, there is no way to express the algorithms efficiently and in a
natural way in Standard C. Saturated arithmetic.

For example, is required in many algorithms and is supplied as a


primitive in many DSPs. However, there is no such primitive in
Standard C. To express saturated arithmetic in C requires comparisons,
conditional statements, and correcting assignments. Instead of using a
primitive, the operation is spread over a number of statements that are
difficult to recognize as a single primitive by a compiler.

DESCRIPTION

Embedded C is designed to bridge the performance mismatch


between Standard C and the embedded hardware and application
architecture. It extends the C language with the primitives that are
needed by signal-processing applications and that are commonly
provided by DSP processors. The design of the support for fixed-point
data types and named address spaces in Embedded C is based on DSP-C.
DSP-C [1] is an industry-designed extension of C with which experience
was gained since 1998 by various DSP manufacturers in their compilers.
For the development of DSP-C by ACE (the company three of us work
for), cooperation was sought with embedded-application designers and
DSP manufacturers.

The Embedded C specification extends the C language to


support freestanding embedded processors in exploiting the multiple
address space functionality, user-defined named address spaces, and
direct access to processor and I/O registers. These features are common
for the small, embedded processors used in most consumer products.
The features introduced by Embedded C are fixed-point and saturated
arithmetic, segmented memory spaces, and hardware I/O addressing.
The description we present here addresses the extensions from a
language-design perspective, as opposed to the programmer or processor
architecture perspective.

MULTIPLE ADDRESS SPACES

Embedded C supports the multiple address spaces found in


most embedded systems. It provides a formal mechanism for C
applications to directly access (or map onto) those individual processor
instructions that are designed for optimal memory access. Named
address spaces use a single, simple approach to grouping memory
locations into functional groups to support MAC buffers in DSP
applications, physical separate memory spaces, direct access to
processor registers, and user-defined address spaces.

The Embedded C extension supports defining both the natural


multiple address space built into a processor's architecture and the
application-specific address space that can help define the solution to a
problem.

Embedded C uses address space qualifiers to identify specific


memory spaces in variable declarations. There are no predefined
keywords for this, as the actual memory segmentation is left to the
implementation. As an example, assume that X and Y are memory
qualifiers. The definition:

X int a[25] ;
Means that a is an array of 25 integers, which is located in the X
memory. Similarly (but less common):

X int * Y p ;

Means that the pointer p is stored in the Y memory. This pointer


points to integer data that is located in the X memory. If no memory
qualifiers are used, the data is stored into unqualified memory.

For proper integration with the C language, a memory structure is


specified, where the unqualified memory encompasses all other
memories. All unqualified pointers are pointers into this unqualified
memory. The unqualified memory abstraction is needed to keep the
compatibility of the void * type, the NULL pointer, and to avoid
duplication of all library code that accesses memory through pointers
that are passed as parameters.

NAMED REGISTERS

Embedded C allows direct access to processor registers that are not


addressable in any of the machine's address spaces. The processor
registers are defined by the compiler-specific, named-register, storage
class for each supported processor. The processor registers are declared
and used like conventional C variables (in many cases volatile
variables). Developers using Embedded C can now develop their
applications, including direct access to the condition code register and
other processor-specific status flags, in a high-level language, instead of
inline assembly code.

Named address spaces and full processor access reduces


application dependency on assembly code and shifts the responsibility
for computing data types, array and structure offsets, and all those things
that C compilers routinely and easily do from developers to compilers.

I/O HARDWARE ADDRESSING

The motivation to include primitives for I/O hardware addressing


in Embedded C is to improve the portability of device-driver code. In
principle, a hardware device driver should only be concerned with the
device itself. The driver operates on the device through device registers,
which are device specific. However, the method to access these registers
can be very different on different systems, even though it is the same
device that is connected. The I/O hardware access primitives aim to
create a layer that abstracts the system-specific access method from the
device that is accessed. The ultimate goal is to allow source-code
portability of device drivers between different systems. In the design of
the I/O hardware-addressing interface, three requirements needed to be
fulfilled:

1. The device-drive source code must be portable.


2. The interface must not prevent implementations from producing
machine code that is as efficient as other methods.
3. The design should permit encapsulation of the system-dependent
access method.

The design is based on a small collection of functions that are


specified in the <iohw.h> include file. These interfaces are divided into
two groups; one group provides access to the device, and the second
group maintains the access method abstraction itself.

To access the device, the following functions are defined by Embedded


C:

unsigned int iord( ioreg_designator );


void iowr( ioreg_designator, unsigned int value );
void ioor( ioreg_designator, unsigned int value );
void ioand( ioreg_designator, unsigned int value );
void ioxor( ioreg_designator, unsigned int value );

These interfaces provide read/write access to device registers, as well as


typical methods for setting/resetting individual bits. Variants of these
functions are defined (with buf appended to the names) to access arrays
of registers. Variants are also defined (with l appended) to operate with
long values.

All of these interfaces take an I/O register designator


ioreg_designator as one of the arguments. These register designators
are an abstraction of the real registers provided by the system
implementation and hide the access method from the driver source code.
Three functions are defined for managing the I/O register designators.
Although these are abstract entities for the device driver, the driver does
have the obligation to initialize and release the access methods. These
functions do not access or initialize the device itself because that is the
task of the driver. They allow, for example, the operating system to
provide a memory mapping of the device in the user address space.

void iogroup_acquire( iogrp_designator );


void iogroup_release( iogrp_designator );
void iogroup_map( iogrp_designator, iogrp_designator );

The iogrp_designator specifies a logical group of I/O register


designators; typically this will be all the registers of one device. Like the
I/O register designator, the I/O group designator is an identifier or macro
that is provided by the system implementation.The map variant allows
cloning of an access method when one device driver is to be used to
access multiple identical devices.

EMBEDDED C PORTABILITY

By design, a number of properties in Embedded C are left


implementation defined. This implies that the portability of Embedded C
programs is not always guaranteed. Embedded C provides access to the
performance features of DSPs. As not all processors are equal, not all
Embedded C implementations can be equal For example, suppose an
application requires 24-bit fixed-point arithmetic and an Embedded C
implementation provides only 16 bits because that is the native size of
the processor. When the algorithm is expressed in Embedded C, it will
not produce outputs of the right precision.

In such a case, there is a mismatch between the requirements of the


application and the capabilities of the processor. Under no
circumstances, including the use of assembly, will the algorithm run
efficiently on such a processor. Embedded C cannot overcome such
discrepancies. Yet, Embedded C provides a great improvement in the
portability and software engineering of embedded applications. Despite
many differences between performance-specific processors, there is a
remarkable similarity in the special-purpose features that they provide to
speed up applications.
Writing C code with the low-level processor-specific support may
at first appear to have many of the portability problems usually
associated with assembly code. In the limited experience with porting
applications that use Embedded C extensions, an automotive engine
controller application (about 8000 lines of source) was ported from the
eTPU, a 24-bit special-purpose processor, to a general-purpose 8-bit
Freescale 68S08 with about a screen full of definitions put into a single
header file. The porting process was much easier than expected. For
example, variables that had been implemented on the processor registers
were ported to unqualified memory in the general-purpose
microprocessor by changing the definitions in the header definition and
without any actual code modifications. The exercise was to identify the
porting issues and it is clear that the performance of the special-purpose
processor is significantly higher than the general-purpose target.

PYTHON

Python is a widely used high-level programming language for general-


purpose programming, created by Guido van Rossum and first released
in 1991. An interpreted language, Python has a design philosophy that
emphasizes code readability (notably using whitespace indentation to
delimit code blocks rather than curly brackets or keywords), and a
syntax that allows programmers to express concepts in fewer lines of
code than might be used in languages such as C++ or Java. The language
provides constructs intended to enable writing clear programs on both a
small and large scale.

Python features a dynamic type system and automatic memory


management and supports multiple programming paradigms,
including object-oriented, imperative, functional programming,
and procedural styles. It has a large and comprehensive standard library.

Python interpreters are available for many operating systems, allowing


Python code to run on a wide variety of systems. C Python, the reference
implementation of Python, is open source software and has a
community-based development model, as do nearly all of its variant
implementations. C Python is managed by the non-profit Python
Software Foundation.

FEATURES

• Beautiful is better than ugly

• Explicit is better than implicit

• Simple is better than complex

• Complex is better than complicated

• Readability counts
CONCLUSION:

These systems providing useful solution while making the Vehicle


safety and alert system by using IOT. The cost of the system is less and
it gives the reliable output as compared to another system which useful
for society. To have safe and It is mainly implemented on a long scale
for the better results and problem free solutions in the future.

REFERENCES:

[1] Highlights of 2009 Motor Vehicle crashes, Tramc Safety Facts,


Research Notes, NHTSA (National Highway traffic Safety
Administration) [Online], Accessed on 16 October 2011.

[2] N. Virtanen, A Schirokoff and 1. Luom, "Impacts of an automatic

emergency call system on accident consequences," 18th ICTCT,

Workshop Transport telemetric and safety, 2005.

[3] S. M. Tang and H. 1. Gao, "Tramc-incident detection-algorithm


based on nonparametric regression," IEEE Transactions on Intelligent

Transportation Systems, 2005.


[4] G. Rose, "Mobile Phones as Traffic Probes: Practices, Prospects and

Issues," Transport Reviews, 2006.

[5]P.Mohan,Y.N.Padmanabhan,and R.Ramjee, "Nericel1:richmonitoring


of road and traffic conditions using mobile smartphones," in Proceedings
of the 6th ACM conference on Embedded network sensor systems,

2008.

[6] D. A Whitney and 1. 1. Pisano T ASC, Inc., Reading, Massachusetts,

"Auto Alert: Automated Acoustic Detection of Incidents," IDEA

project, 15 October 201 1.

[7] C. Thompson, 1. White, B. Dougherty, A Albright and D.C.


Schmidt, "Using Smartphones to Detect Car Accidents and Provide
Situational Awareness to Emergency Responders," in Proceedings of 3'd
Mobile Wireless Middleware, Operating Systems, and Applications
Conference,

[8] J. Yoon, B. Noble and M. Liu, "Surface street traffic estimation," in

Proceedings of 5th International Conference on Mobile Systems,

Applications,and Services, 2007.

[9] Md. Syedul Amin, Jubayer Jalil, M. B. I. Reaz, "Accident Detection


and Reporting System using GPS, GPRS and GSM Technology," in
Proceedings of International Conference on Informatics, Electronics &

Vision, 2012.

[10] Chalermpol Saiprasert and Wasan Pattara-Atikom, "Smartphone

Enabled Dangerous Driving Report System," in Proceedings of 46th

Hawaii International Conference on System Sciences, 2013.

[II] In Jung Lee, "An Accident Detection System on Highway Using


Vehicle Tracking Trace," ICT Convergence, 2011.

You might also like