SMART HELMET USING ARDUINO B.Tech Project Report

52
SMART HELMET USING ARDUINO B.Tech Project Report V.Krishna Chaitanya K.Praveen Kumar DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING AND TECHNOLOGY (Affiliated to Jawaharlal Nehru Technological University) HYDERABAD 500 090

description

smart helmet

Transcript of SMART HELMET USING ARDUINO B.Tech Project Report

Page 1: SMART HELMET USING ARDUINO B.Tech Project Report

SMART HELMET USING ARDUINO

B.Tech Project Report

V.Krishna Chaitanya

K.Praveen Kumar

DEPARTMENT OF ELECTRONICS AND

COMMUNICATION ENGINEERING

GOKARAJU RANGARAJU INSTITUTE OF

ENGINEERING AND TECHNOLOGY

(Affiliated to Jawaharlal Nehru Technological University)

HYDERABAD 500 090

Page 2: SMART HELMET USING ARDUINO B.Tech Project Report

SMART HELMET USING ARDUINO

Project Report Submitted in Partial Fulfillment of

The Requirements for the Degree of

Bachelor of Technology

In

Electronics and Communication Engineering

By

V.Krishna Chaitanya (Roll no: 09241A0478)

K.Praveen Kumar (Roll no: 09241A0489)

DEPARTMENT OF ELECTRONICS AND

COMMUNICATION ENGINEERING

GOKARAJU RANGARAJU INSTITUTE OF

ENGINEERING AND TECHNOLOGY

(Affiliated to Jawaharlal Nehru Technological University)

HYDERABAD 500 090

2013

Page 3: SMART HELMET USING ARDUINO B.Tech Project Report

Department of Electronics and Communication Engineering

Gokaraju Rangaraju Institute of Engineering and Technology

(Affiliated to Jawaharlal Nehru Technological University)

Hyderabad 500 090

2013

This is to certify that this project report entitled smart helmet using Arduino by V.Krishna

Chaitanya (Roll no: 09241A0478), K.Praveen Kumar (09241A0489), submitted in partial

fulfillment of the requirements for the degree of Bachelor of Technology in Electronics and

Communication Engineering of the Jawaharlal Nehru Technological University, Hyderabad,

during the academic year 2009-10, is a bonafide record of work carried out under our guidance

and supervision.

The results embodied in this report have not been submitted to any other University or Institution

for the award of any degree or diploma

(Guide) (External examiner) (Head of department)

Md.Javeed Mehdi Ravi Billa

Assistant professor

Page 4: SMART HELMET USING ARDUINO B.Tech Project Report

i

ACKNOWLEDGMENT

We have immense pleasure in expressing our thanks and deep sense of gratitude to our guide Mr.Md.Javeed Mehdi, Assistant Professor, Department of Electronics and Communication

Engineering, GRIET for his guidance throughout this project. We would also like to express our deepest appreciation to our project coordinators Mr.

Anantha Radhanand, Mr.V.H.Raju, and Mr.Balaji, Associate Professors, Department of

Electronics and Communication Engineering, GRIET for their technical support in our project. We also express our sincere thanks to Prof. Ravi Billa, Head of the Department, GRIET for extending his help. We wish to express our profound sense of gratitude to Prof. P. S. Raju, Director, GRIET for his encouragement, and for all facilities to complete this project. Finally we express our sincere gratitude to all the members of faculty and my friends who

contributed their valuable advice and helped to complete the project successfully.

V.Krishna Chaitanya _________________

K.Praveen Kumar _________________

Page 5: SMART HELMET USING ARDUINO B.Tech Project Report

ii

Abstract

Description:

A smart helmet is a special idea which makes motorcycle driving safer than before. This is implemented using Arduino. The working of this smart helmet using Arduino is very simple, we place vibration sensors in different places of helmet where the probability of hitting is more which are connected to Arduino board. So when the rider crashes and the helmet hits the ground, the sensors sense and the Arduino extract GPS data using the GPS module that is interfaced with Arduino. When the data exceeds minimum stress limit then GSM module automatically sends message to ambulance or police or family members.

Block diagram:

Platforms to be used:

Hardware: Arduino board, Bluetooth module, vibration sensors, mobile phone

with Bluetooth.

Software: Arduino IDE

Page 6: SMART HELMET USING ARDUINO B.Tech Project Report

CONTENTS

AKNOWLEDGMENT……………………………………………….. (i)

ABSTRACT………………………………………………………….. (ii)

1. INTRODUCTION

1.1 Background……………………………………………….…………..1

1.2 Aim of the project…………………………………………................1

1.3 Methodology………………………………………………................2

1.4 Significance of this work…………………………………………….3

1.5 Outline of this report………………………………………...............3

1.6 Conclusion……………………………………………………………4

2. ARDUINO

2.1 Overview………………………………………………......................5

2.2 Schematic and reference design……………………………………..6

2.3 Summary……………………………………………………………...7

2.4 Power………………………………………………………………....7

2.5 Memory……………………………………………………................8

2.6 Input and Output……………………………………………………..8

2.7 Communication……………………………………………...............9

2.8 Programming………………………………………………................9

2.9 Automatic reset……………………………………………………...10

2.10 USB Overcurrent protection………………………………………..11

2.11 Physical Characteristics……………………………………………..11

3. PIEZO VIBRATION SENSOR

3.1 Overview…………………………………………………................12

3.2 Applications…………………………………………………………12

3.3 Dimensions……………………………………………….................13

3.4 Features……………………………………………………………...13

3.5 Performance specifications………………………………................14

3.6 Functional description……………………………………………….15

4. GPS MODULE

4.1 Overview…………………………………………………................18

4.2 Highlights and features……………………………………………..18

Page 7: SMART HELMET USING ARDUINO B.Tech Project Report

4.3 System block diagram……………………………………................19

4.4 Pin configuration………………………………………….................24

4.5 Specifications lists………………………………………………......27

4.6 NMEA output sentences………………………………….................29

5. GSM Module

5.1 Overview………………………………………………….................31

5.2 Features……………………………………………………………...31

5.3 Specifications………………………………………………………..32

5.4 Operating conditions………………………………………………..34

5.5 Pin configuration…………………………………………...............34

6. BLOCK DIAGRAM

6.1 Block diagram…………………………………….…………………37

6.2 Flow chart…………………………………………………………...38

6.3 Program……………………………………………………………...39

BIBILOGRAPHY……………………………………………………...45

Page 8: SMART HELMET USING ARDUINO B.Tech Project Report

1

Chapter 1

INTRODUCTION

1.1 Background

The thought of developing this project comes from social responsibility towards the

society. As we can see many accidents occurring around us, there is a lot of loss of life.

According to a survey of India there are around 698 accidents occurring due to bike crashes

per year. The reasons for the accidents may be many such as no proper driving knowledge,

no fitness of the bike, rash driving, drink and drive etc. In some cases the person injured the

accident may not be directly responsible for the accident, it may be fault of some other rider,

but end of the day it’s both the drivers involved in the accidents who is going to suffer.

If accidents are one issue, lack of treatment in proper time is another reason for deaths.

According to the same survey if 698 accidents occur per year, nearly half the injured people

die due to lack of treatment in proper time. The reasons for this may again be many such as

late arrival of ambulance, no person at place of accident to give information to the

ambulance.

This is what is running situation in our day to day life, a thought of finding some

solution to this problem come up with this idea of giving the information about accident as

soon as possible and in TIME….!!!!Because after all time matters a lot, if everything is

done in time, at least we can save half the lives that are lost due to bike accidents.

So, a thought from taking responsibility of society came our project “SMART

HELMET USING ARDUINO”.

1.2 Aim of the project

The aim of our project is to give information to the ambulance and family members about

the accident as soon as possible so that they can take certain measures to save the life of the

person who met with an accident.

Page 9: SMART HELMET USING ARDUINO B.Tech Project Report

2

1.3 Methodology

The idea of this project is to give information about the accident to the ambulance and

family members, so we have chose GSM technology to give the information by sending

SMS. We are using GSM module which has SIM card slot to place the SIM and send SMS.

Sending SMS alone can’t help the driver, if we send and an SMS saying that accident

had occurred where the ambulance will come without knowing the location of the accident.

So we include GPS location in the SMS which we are sending so that the ambulance will

have perfect information about where and when the accident has occurred. For this we use

GPS module to extract the location of the accident, the GPS data will contain the latitude

and longitude values using which we can find the accurate position of the accident place.

To run the GPS and GSM module we use Arduino UNO board which has ATmega328

microcontroller. The Arduino is a very user friendly device which can be easily interfaced

with any sensors or modules and is very compact in size.

Now we are clear that the Arduino will send the SMS using the GSM module by

keeping the GPS location in the SMS which is obtained from the GPS module. But when

should all this be done? When accident occurs, how will the Arduino detect the accident?

We use a vibration sensor which is placed in the helmet.

The vibration sensor is placed in the helmet such that it detects vibrations of the

helmet. When the rider crashes, the helmet hits the ground and the vibration sensor detects

the vibrations that are created when the helmet hits the ground and then the Arduino will

send an SMS containing information about the accident and location of accident.

This is the methodology used in the project, let me once again give a brief description

about the working of project,

When the rider crashes, the helmet hits the ground, the vibration sensor

senses the vibrations and asks the Arduino to send SMS, the Arduino will send SMS through

GSM module containing information that accident has occurred and the GPS location

obtained from GPS module.

Page 10: SMART HELMET USING ARDUINO B.Tech Project Report

3

1.4 Significance of this work

This project is very useful in day to day life and adds extra safety while driving. It’s like a

virtual person at the place of accident which sends the information to the ambulance.

This is not only useful in bike accidents only but also in car accidents, it can be

implemented in car accidents by placing this device in the car and changing some threshold

values of the vibration sensor.

Use of this project makes your life secure at crucial times, especially when the accident

occurs at a no man place, where there is no person to notice the accident. It helps in the

situation where u can’t even move your body and in critical position. It automatically sends

the information.

1.5 Outline of this report

This report contains a detailed information about all the components used in this project. The

components used are:

� Arduino UNO

� Vibration sensor

� GPS module

� GSM module

A detailed report about each and every component is described in separate chapter wise.

Chapter 2 contains information about Arduino UNO.

Chapter 3 contains information about vibration sensor.

Chapter 4 contains information about GPS module.

Chapter 5 contains information about GSM module.

Chapter 6 contains block diagram, flow chart, and program for the project.

At last ending with bibliography and appendix.

Page 11: SMART HELMET USING ARDUINO B.Tech Project Report

4

1.6 Conclusion

As the concluding part of this project, I would like to say that--

"Without proper action at proper time, danger awaits us with a bigger face."

We must act on time when a person is injured. We must take care of person the way it is

meant. otherwise, a valuable life might be lost .We need to understand how precious lives of

people are and what importance first-aid carries in saving these precious lives.

If this project imparts this idea in even one person, I would think that the project will be

successful.

Page 12: SMART HELMET USING ARDUINO B.Tech Project Report

5

Chapter 2

ARDUINO

2.1Overview

The Arduino Uno is a microcontroller board based on the ATmega328 . It has 14 digital

input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic

resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains

everything needed to support the microcontroller; simply connect it to a computer with a USB

cable or power it with a AC-to-DC adapter or battery to get started.

The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver

chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-

to-serial converter.

Revision3 of the board has the following new features:

� 1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new

pins placed near to the RESET pin, the IOREF that allow the shields to adapt to the

voltage provided from the board. In future, shields will be compatible both with the board

that use the AVR, which operate with 5V and with the Arduino Due that operate with

3.3V. The second one is a not connected pin, that is reserved for future purposes.

� Atmega 16U2 replace the 8U2.

� "Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0.

The Uno and version 1.0 will be the reference versions of Arduino, moving forward. The

Uno is the latest in a series of USB Arduino boards, and the reference model for the

Arduino platform; for a comparison with previous version

Page 13: SMART HELMET USING ARDUINO B.Tech Project Report

6

2.2Schematic & Reference Design

The Arduino reference design can use an Atmega8, 168, or 328, Current models use

an ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration is

identical on all three processors.

Page 14: SMART HELMET USING ARDUINO B.Tech Project Report

7

2.3 Summary

Microcontroller ATmega328

Operating Voltage 5V

Input Voltage

(recommended) 7-12V

Input Voltage (limits) 6-20V

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

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader

SRAM 2 KB (ATmega328)

EEPROM 1 KB (ATmega328)

Clock Speed 16 MHz

2.4 Power

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.

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.

Page 15: SMART HELMET USING ARDUINO B.Tech Project Report

8

� 5V.This pin outputs a regulated 5V from the regulator on the board. The board can be

supplied with power either from the DC power jack (7 - 12V), the USB connector (5V),

or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses

the regulator, and can damage your board. We don't advise it.

� 3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50

mA.

� GND. Ground pins.

� IOREF. This pin on the Arduino board provides the voltage reference with which the

microcontroller operates. A properly configured shield can read the IOREF pin voltage

and select the appropriate power source or enable voltage translators on the outputs for

working with the 5V or 3.3V.

2.5 Memory

The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM

and 1 KB of EEPROM (which can be read and written with the EEPROMlibrary).

2.6 Input and Output

Each of the 14 digital pins on the Uno 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-50 kOhms. In addition, some pins have specialized functions:

� Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These

pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

� External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a

low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for

details.

� PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

� SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication

using the SPI library.

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

� The Uno has 6 analog inputs, labeled A0 through A5, 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

the analogReference() function. Additionally, some pins have specialized functionality:

Page 16: SMART HELMET USING ARDUINO B.Tech Project Report

9

� TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire

library.

� There are a couple of other pins on the board:

� AREF. Reference voltage for the analog inputs. Used with analogReference().

� Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button

to shields which block the one on the board.

2.7 Communication

The Arduino Uno has a number of facilities for communicating with a computer, another

Arduino, or other microcontrollers. The ATmega328 provides UART TTL (5V) serial

communication, which is available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the

board channels this serial communication over USB and appears as a virtual com port to

software on the computer. The '16U2 firmware uses the standard USB COM drivers, and no

external driver is needed. However, on Windows, a .inf file is required. The Arduino software

includes a serial monitor which allows simple textual data to be sent to and from the Arduino

board. The RX and TX LEDs on the board will flash when data is being transmitted via the

USB-to-serial chip and USB connection to the computer (but not for serial communication on

pins 0 and 1).

A Software Serial library allows for serial communication on any of the Uno's digital pins.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software

includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI

communication, use the SPI library.

2.8 Programming

The Arduino Uno can be programmed with the Arduino software.

The ATmega328 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 headerfiles).

You can also bypass the bootloader and program the microcontroller through the ICSP (In-

Circuit Serial Programming) header; see these instructions for details.

The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available .

The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:

� On Rev1 boards: connecting the solder jumper on the back of the board (near the map of

Italy) and then resetting the 8U2.

Page 17: SMART HELMET USING ARDUINO B.Tech Project Report

10

� On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to

ground, making it easier to put into DFU mode.

� You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X

and Linux) to load a new firmware. Or you can use the ISP header with an external

programmer (overwriting the DFU bootloader). See this user-contributed tutorial for

more information.

2.9 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 theATmega8U2/16U2 is connected to the reset line of

the ATmega328 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 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 Uno 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.

Page 18: SMART HELMET USING ARDUINO B.Tech Project Report

11

2.10 USB Overcurrent Protection

The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from shorts

and overcurrent. Although most computers provide their own internal protection, the fuse

provides an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse

will automatically break the connection until the short or overload is removed.

2.11 Physical Characteristics

The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the

USB connector and power jack extending beyond the former dimension. Four 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.

Page 19: SMART HELMET USING ARDUINO B.Tech Project Report

12

Chapter 3

PIEZO VIBRATION SENSOR

3.1 Overview The Minisense 100is a low-cost cantilever-type vibration sensor loaded by a mass to offer high

sensitivity at low frequencies. The pins are designed for easy installation and are

solderable.Horizontal and vertical mounting optionsare offered as well as a reduced

heightversion. The active sensor area is shieldedfor improved RFI/EMI rejection.

Rugged,flexible PVDF sensing element withstands high shock overload. Sensor has excellent

linearity and dynamic range, and may beused for detecting either continuous vibration or

impacts.

3.2 APPLICATIONS � Washing Machine Load Imbalance

� Vehicle Motion Sensor

� Anti-Theft Devices

� Vital Signs Monitoring

� Tamper Detection

� Impact Sensing

Page 20: SMART HELMET USING ARDUINO B.Tech Project Report

13

3.3 Dimensions(in mm)

3.4 FEATURES � High Voltage Sensitivity (1 V/g)

� Over 5 V/g at Resonance

� Horizontal or Vertical Mounting

� Shielded Construction

� Solderable Pins, PCB Mounting

� Low Cost

� < 1% Linearity

� Up to 40 Hz (2,400 rpm) OperationBelow Resonance

� High Sensitivity

� Good Frequency Response

� Excellent Linearity

� Shielded Construction

� Analog Output

� Withstands High Shock

Page 21: SMART HELMET USING ARDUINO B.Tech Project Report

14

3.4 Performance specifications

Page 22: SMART HELMET USING ARDUINO B.Tech Project Report

15

Typical properties (at 25°C)

Parameter Value Units

Voltage Sensitivity (open-circuit, baseline) 1.1 V/g

Charge Sensitivity (baseline) 260 pC/g

Resonance Frequency 75 Hz

Voltage Sensitivity (open-circuit, at resonance) 6 V/g

Upper Limiting Frequency (+3 dB) 42 Hz

Linearity +/-1 %

Capacitance 244 pF

Dissipation Factor 0.018 (none)

Inertial Mass 0.3 gram

3.5 Functional description

The MiniSense 100acts as a cantilever-beam accelerometer. When the beam is mounted

horizontally, acceleration in the vertical plane creates bending in the beam, due to the inertia of

the mass at the tip of the beam. Strain in the beam creates a piezoelectric response, which may be

detected as a charge or voltage output across the electrodes of the sensor.

The sensor may be used to detect either continuous or impulsive vibration or impacts. For

excitation frequencies below the resonant frequency of the sensor, the device produces a linear

output governed by the “baseline” sensitivity quoted above. The sensitivity at resonance is

significantly higher. Impacts containing high-frequency components will excite the resonance

frequency, as shown in the plot above (response of the MiniSense 100 to a single half-sine

impulse at 100 Hz, of amplitude 0.9 g). The ability of the sensor to detect low frequency motion

is strongly influenced by the external electrical circuit, as described below (see “Electrical

Description”).

Electrical description

The MiniSense 100behaves electrically as an “active” capacitor: it may be modelled as a perfect

voltage source (voltage proportional to applied acceleration) in series with the quoted device

capacitance. Any external input or load resistance will form a high-pass filter, with a roll-off

frequency as tabulated above, or calculated from the formula f(c) = 1/(2_RC). The impedance of

the sensor is approximately 650 M ohm at 1 Hz. The active sensor element is electrically

shielded, although care should be taken in the PCB design to keep unshielded traces as short as

possible.

Page 23: SMART HELMET USING ARDUINO B.Tech Project Report

16

Page 24: SMART HELMET USING ARDUINO B.Tech Project Report

17

Off-Axis Sensitivity

The sensitivity of the Minisense 100 follows a cosine law, when rotated horizontally around its

axis,or vertically around its mid-point. At 90 degrees rotation in either plane, both baseline

sensitivity andsensitivity at resonance are at a minimum. In theory, sensitivity should be zero in

this condition. It is likely that some sensitivity around the resonance frequency will still be

observed – but this may be unpredictable and is likely to be at least -16 dB with reference to the

on-axis response. Note that the sensitivity at 30 degrees rotation is -1.25 dB (87% of on-axis

response), at 60 degrees, it falls to -6 dB (50%).

The plots below show the change in sensitivity observed for either:

1) Rotation about major axis of sensing element

2) Rotation about mid-point of sensing element

Page 25: SMART HELMET USING ARDUINO B.Tech Project Report

18

Chapter 4

GPS MODULE

4.1 Overview

The FGPMMOPA6B is an ultra-compact POT (Patch On Top) GPS Module. This POT GPS

receiverprovides a solution that is high in position and speed accuracy performances, with high

sensitivityand tracking capabilities in urban conditions. The GPS chipset inside the module is

powered byMediaTek Inc., the world's leading digital media solution provider and the largest

fab-less ICcompany in Taiwan. The module can support up to 66 channels, and is designed for

small-formfactordevice. It is suitable for every GPS-related application, such as:

� Fleet Management/Asset Tracking

� LBS (location base service) and AVL system

� Security system

� Hand-held device for personal positioning and travel navigation

4.2 Highlights & Features

� MediaTek MT3329 Single Chip

� L1 Frequency, C/A code, 66 channels

� Support up 210 PRN channels

� Jammer detection and reduction

� Multi-path detection and compensation

� Dimension: 16mm x 16mm x 6mm

� Patch Antenna Size: 15mm x 15mm x 4mm

� High Sensitivity: Up to -165 dBm tracking, superior urban performances1

� Position Accuracy:

o Without aid: 3m 2D-RMS

o DGPS (SBAS(WAAS,EGNOS,MSAS)):2.5m 2D-RMS2

� Low Power Consumption: 48mA @ acquisition, 37mA @ tracking

� Low Shut-Down Power Consumption: 15uA, typical

� DGPS(WAAS/EGNOS/MSAS/GAGAN) support (Default: Enable)

� Max. Update Rate: up to 10Hz (Configurable by firmware)

� USB Interface support without extra bridge IC

� FCC E911 compliance and AGPS support (Offline mode : EPO valid up to 14 days )

� RoHS Compliant

Page 26: SMART HELMET USING ARDUINO B.Tech Project Report

19

4.3 System Block Diagram

Page 27: SMART HELMET USING ARDUINO B.Tech Project Report

20

Mechanical dimension Dimension: (Unit: mm, Tolerance: +/- 0.1mm)

Page 28: SMART HELMET USING ARDUINO B.Tech Project Report

21

Page 29: SMART HELMET USING ARDUINO B.Tech Project Report

22

Recommended PCB pad Layout (Unit: mm, Tolerance: 0.1mm)

Page 30: SMART HELMET USING ARDUINO B.Tech Project Report

23

Page 31: SMART HELMET USING ARDUINO B.Tech Project Report

24

4.4 Pin Configuration

Pin Assignment

Pin Name I/O Description

1 VCC PI Main DC power input

2 ENABLE I High active, or keep floating for normal working

3 GND P Ground

4 VBACKUP PI Backup power input

5 3D-FIX O 3D-fix indicator

6 DPLUS I/O USB port D+

7 DMINUS I/O USB port D-

8 GND P Ground

9 TX O Serial data output of NMEA

10 RX I Serial data input for firmware update

Page 32: SMART HELMET USING ARDUINO B.Tech Project Report

25

Description of I/O Pin

VCC (Pin1)

The main DC power supply of the module, the voltage should be kept between from 3.2V to

5.0V.

The Vcc ripple must be controlled under 50mVpp (Typical: 3.3V)

ENABLE (Pin2)

Keep open or pull high to Power ON. Pull low to shutdown the module.

Enable (High): 1.8V<= Venable<=VCC

Disable (Low): 0V<= Venable<=0.25V

GND (Pin3)

Ground

VBACKUP (Pin4)

This is the power for GPS chipset to keep RTC running when main power is removed. The

voltageshould be kept between 2.0V~4.3V. (Typical: 3.0V)

3D-FIX (Pin5)

The 3D-FIX is assigned as a fix flag output. The timing behavior of this pin can be configured

bycustom firmware for different applications (Example: waking up host MCU). If not used,

keepfloating.

Before 2D Fix

The pin should continuously output one-second high-level with one-second low-level signal.

After 2D or 3D Fix

The pin should continuously output low-level signal.

DPLUS (Pin6)

Page 33: SMART HELMET USING ARDUINO B.Tech Project Report

26

USB Port DPLUS Signal

DMINUS (Pin7)

USB Port DMINUS Signal

GND (Pin8)

Ground

TX (Pin9)

This is the UART transmitter of the module. It outputs the GPS information for application.

RX (Pin10)

This is the UART receiver of the module. It is used to receive software commands and

firmwareupdate.

Interfacing GPS with Arduino

Page 34: SMART HELMET USING ARDUINO B.Tech Project Report

27

4.5 Specifications Lists

General Chipset MTK MT3329

Frequency L1, 1575.42MHz

C/A Code 1.023 MHz

Channels 66 channels

SBAS WAAS, EGNOS,MSAS ,GAGAN Supported(Default: Enable)

Datum WGS84(Default), Tokyo-M, Tokyo-A, User Define

CPU ARM7EJ-S

Performance Characteristics Position Accuracy

Without aid: 3m 2D-RMS

DGPS(SBAS(WAAS,EGNOS,MSAS)):2.5m 2D-RMS

Velocity Accuracy

Without aid:0.1 m/s

DGPS (SBAS ):0.05m/s

Acceleration Accuracy Without aid:0.1 m/s²

DGPS (SBAS ):0.05m/s²

Timing Accuracy 100 ns RMS

Sensitivity

Acquisition:-148dBm (Cold Start)

Reacquisition:-160dBm

Tracking:-165dBm

Update Rate 1Hz (Default)

Acquisition (Open sky, stationary)

Reacquisition Time Less than 1 second

Hot start 1.0s (Typical)

Warm start 34s (Typical)

Cold start 35s (Typical)

Page 35: SMART HELMET USING ARDUINO B.Tech Project Report

28

Dynamic

Altitude Maximum 18,000m

Velocity Maximum 515m/s

Acceleration Maximum 4G

Input/Output

Signal Output 8 data bits, no parity, 1 stop bit

Available Baud Rates Default:9600bps

(4800/9600/38400/57600/115200 bps by customization)

Protocols

NMEA 0183 v3.01 (Default: GGA,GSA,GSV,RMC,VTG)

MTK NMEA Command

Environment

Operating Temperature -40 °C to 85 °C

Storage Temperature -50 °C to 90 °C

Operating Humidity 5% to 95% (no condensing)

Mounting SMD Type ,10 Pin

Page 36: SMART HELMET USING ARDUINO B.Tech Project Report

29

DC Characteristics

Parameter Condition Min. Typ. Max. Unit

Operation supply Voltage - 3.2 3.3 5.0 V

Operation supply Ripple Voltage - - - 50 mVpp

Backup Battery Voltage - 2.0 3.0 4.3 V

RX TTL H Level VCC=3.2~5.0V 2.1 - 2.8 V

RX TTL L Level VCC=3.2~5.0V 0 - 0.9 V

TX TTL H Level VCC=3.2~5.0V 2.1 - 2.8 V

TX TTL L Level VCC=3.2~5.0V 0 - 0.8 V

USB

Differential ‘’ 1 ‘’

VCC=3.2~5.0V

(D+)-(D) >200

mV

Differential ‘’ 0 ‘’

VCC=3.2~5.0V

(D-)(D+) >200

mV

Power Consumption @ 3.3V,

1Hz Update Rate

Acquisition Tracking

43 32

48 37

53 42

mA mA

Backup Power Consumption@ 3.0V 25°C - 10 - uA

Shut-down Power Consumption

(via enable pin)

25°C - 15 - uA

4.6 NMEA Output Sentences

A list of each of the NMEA output sentences specifically developed and defined by MTK foruse within MTK products.

Option Description

GGA Time, position and fix type data. GSA

GPS receiver operating mode, active satellites used in the

Position solution and DOP values. GSV

The number of GPS satellites in view satellite ID numbers,

elevation, azimuth, and SNR values.

RMC

Time, date, position, course and speed data. Recommended Minimum Navigation Information.

VTG Course and speed information relative to the ground.

Page 37: SMART HELMET USING ARDUINO B.Tech Project Report

30

In this project we use RMC—Recommended Minimum Navigation Information type data for

extracting the values required.

The following table contains the values for the following example:

$GPRMC,064951.000,A,2307.1256,N,12016.4438,E,0.03,165.48,260406, 3.05,W,A*55

Name Example Units Description

Message ID $GPRMC RMC protocol header

UTC Time 064951.000 hhmmss.sss

Status A A=data valid or V=data not valid

Latitude 2307.1256 ddmm.mmmm

N/S Indicator N N=north or S=south

Longitude 12016.4438 dddmm.mmmm

E/W Indicator E E=east or W=west

Speed overGround 0.03 knots

CourseoverGround 165.48 degrees True

Date 260406 Ddmmyy

MagneticVariation 3.05,W degrees E=east or W=west

Mode

A

A= Autonomous mode

D= Differential mode

E= Estimated mode

Checksum *55

<CR><LF> End of message termination

Page 38: SMART HELMET USING ARDUINO B.Tech Project Report

31

Chapter 5 SIM 900 -TTL UART

GSM Modem

5.1 Overview

GSM/GPRS TTL –Modem is built with SIMCOM Make SIM900 Quad-bandGSM/GPRS

engine, works on frequencies 850 MHz, 900 MHz, 1800 MHz and 1900 MHz. It is verycompact

in size and easy to use as plug in GSM Modem. The Modem is designed with 3V3/5V

TTLinterfacing circuitry, which allows you to directly interface to 5V microcontrollers(

PIC,Arduino,AVR ect)as well as 3V3 Microcontrollers ( ARM,ARM Cortex XX, ect) .The baud

rate can be configurable from9600-115200 through AT command. Initially Modem is in

Autobaud mode. This GSM/GPRS TTL Modem ishaving internal TCP/IP stack to enable you to

connect with internet via GPRS. It is suitable for SMS aswell as DATA transfer application in

M2M interface.

The modem needed only two wires (Tx,Rx) except Power supply to interface

withmicrocontroller/Host. The built in Low Dropout Linear voltage regulator allows you to

connect wide range ofunregulated power supply (4.2V -13V). Yes, 5 V is in between !! .Using

this modem, you will be able to send& Read SMS, connect to internet via GPRS through simple

AT commands.

5.2 Features

� High Quality Product (Not hobby grade)

� Quad-Band GSM/GPRS 850/ 900/ 1800/ 1900 MHz

� 3V3 or 5V interface for direct communication with MCU kit

� Configurable baud rate

� SMA connector with GSM L Type Antenna.

� Built in SIM Card holder.

� Built in Network Status LED

� Inbuilt Powerful TCP/IP protocol stack for internet data transfer over GPRS.

� Audio interface Connector

� Most Status & Controlling Pins are available at Connector

� Normal operation temperature: -20 °C to+55 °C

� Input Voltage: 5V-12V DC

Page 39: SMART HELMET USING ARDUINO B.Tech Project Report

32

5.3 Specifications � Quad-Band 850/ 900/ 1800/ 1900 MHz

� GPRS multi-slot class 10/8

� GPRS mobile station class B

� Compliant to GSM phase 2/2+

o Class 4 (2 W @850/ 900 MHz)

o Class 1 (1 W @ 1800/1900MHz)

� Dimensions: 24*24*3mm

� Weight: 3.4g

� Control via AT commands (GSM 07.0707.05 and SIMCOM enhanced ATCommands)

� Low power consumption: 1.0mA(sleep mode)

� Operation temperature: -40°C to +85 °C\

Specifications for Data

� GPRS class 10: max. 85.6 kbps (downlink)

� PBCCH support

� Coding schemes CS 1, 2, 3, 4

� CSD up to 14.4 kbps

� USSD

� Non transparent mode

� PPP-stack

Specifications for SMS via GSM/GPRS

� Point to point MO and MT

� SMS cell broadcast

� Text and PDU mode

Software features

� 0710 MUX protocol

� embedded TCP/UDP protocol

� FTP/HTTP

Special firmware

� FOTA

� MMS

� Java (cooperate with Iasolution)

� _ Embedded AT

Page 40: SMART HELMET USING ARDUINO B.Tech Project Report

33

Specifications for Voice

� Tricodec

• Half rate (HR)

• Full rate (FR)

• Enhanced Full rate (EFR)

� Hands-free operation

� (Echo suppression)

� AMR

• Half rate (HR)

• Full rate (FR)

Interfaces

� Analog audio interface

� Serial interface

� SMA Antenna Connector

� Seriel Port Pins (RXD,TXD) at 2mm PitchRMC

� Seriel Port Status and Controlling Pins at2mm Pitch RMC

� DC Power pins at 2mm Pitch RMC

Dimensions

Page 41: SMART HELMET USING ARDUINO B.Tech Project Report

34

5.4 Operating Conditions Parameter IN/OUT Minimum Maximum Unit

Supply Voltage –VIN Input 4.2 13 V

CurrentConsumption --- 40 590 mA

V_Interface Input 2.5 6 V

5.5 Pin Descriptions

PIN PIN NAME DIR DETAILS

VIN Power Supply PWR Power Supply Input (4.2-13V DC,1A)

GND Ground PWR Ground Level of Power Supply

V_Interface InterfacingVoltage PWR Interfacing Voltage Input for on board

voltage level conversion (3V3 or 5V).

If the modem has to be interfaced with a 5V

microcontroller, the input to this pin

should be 5V DC and if the modem has to be

interfaced with a 3V3 microcontroller,

the input to this pin should be 3.3V DC.

TXD

Transmit

OUT

Outputs data bytes at voltage Level same as

the V_Interface Pin

– Usually connected to the Rx pin of the

microcontroller

RXD

Receive

IN

Receives data bytes at voltage Level same as

the V_Interface Pin

– Usually connected to the TX pin of the

microcontroller

GND Ground PWR Ground Level of Interfacing Signals

Page 42: SMART HELMET USING ARDUINO B.Tech Project Report

35

Interfacing Arduino With GSM Modem

Getting Started

1) Insert SIM card

Open the SIM cardholder by sliding it as per the arrow mark and lift up. Insert the SIM card , so

as to alignthe chamfered corner suits in card holder .After inserting the SIM card, lock the holder

by sliding it to theopposite direction of arrow mark.

2) Connect The Antenna

Fix the Supplied RF antenna to the SMA Antennae connector and tighten it by Rotating the Nut

(Never rotate the antennae for tightening ).

3) Connect the Pins

Connect the GSM modem as per the circuit diagram provided

4) Power the Modem

Power the modem from suitable power supply, which is having enough current capacity (>1A).

5) Check the Status of the LEDs

PWR LED - Red LED will lit immediately

STS LED - Green LED will lit after 1-2 seconds

NET LED -Blue LED will starts to blink in fast for few seconds(Searching For Network)

andbecomes slow blinking once the Modem registers with the Network.

Page 43: SMART HELMET USING ARDUINO B.Tech Project Report

36

6) Network LED The Network LED indicates the various status of GSM module eg. Power on, Network

registration &GPRS connectivity. When the modem is powered up, the status LED will blink

every second. After theModem registers in the network (takes between 10-60 seconds), LED will

blink in step of 3 seconds. Atthis stage you can start using Modem for your application.

7) Baud rate

The Baud rate supported by the modem is between 9600 and 115200. Make sure the host system

is setto the supported baud rate.

� The modem automatically sets to the baud rate of the first command sent by the host

system afterit is powered up. User must first send “A” to synchronize the baud rate. It is

recommended to wait 2 to 3seconds before sending “AT” character. After receiving the

“OK” response, Your Device and GSM Modemare correctly synchronized. So there is no

need for setting the baud rate using commands.

� Before You Start using the modem, please make sure that the SIM card you inserted

support theneeded features and there is enough balance in SIM.!!!

Page 44: SMART HELMET USING ARDUINO B.Tech Project Report

37

Chapter 6 6.1 Block Diagram Connecting the hardware

The vibration sensor is connected to the A0 pin of the Arduino. The output of vibration sensor is

analog signal so it is connected to the analog inputs of the Arduino.

The GPS module is connected to the Rx and Tx pins of Arduino. Here we only take values from

GPS module so there is no need of connecting Tx pin.

The GSM module is connected to 4 and 5 pins of Arduino which are assigned as Rx and Tx

using sofwareserial. Here we are only transmitting to gsm module so there is no need of

connecting Rx pin.

Power to all these components will be taken from arduino 5v power supply.

Vibration sensor

ARDUINO GPS module

GSM module

Page 45: SMART HELMET USING ARDUINO B.Tech Project Report

38

6.2 Flow Chart

start

Read GPS data

Read vibration

sensor

If

threshold

>50

Add GPS location

to SMS

Send SMS

If SMS

sent

END

Page 46: SMART HELMET USING ARDUINO B.Tech Project Report

39

6.3 PROGRAM

#include <SoftwareSerial.h>

#include <TinyGPS.h>

#include "SIM900.h"

#include "sms.h"

SMSGSM sms;

boolean started= false;

// GPS parser for 406a

#define BUFFSIZ 45 // plenty big

int ledpin = 13;

int knockSensor = A0; // the piezo is connected to analog pin 0

int threshold = 30; // threshold value to decide when the detected sound is a knock or not

int sensorReading = 0;

char buffer[BUFFSIZ];

char *parseptr;

char buffidx;

uint8_t hour, minute, second, year, month, date;

int latitude, longitude;

uint8_t groundspeed, trackangle;

char latdir, longdir;

char status;

void setup()

{

if (ledpin)

{

pinMode(ledpin, OUTPUT);

}

pinMode(13, OUTPUT);

Serial.begin(9600); // prints title with ending line break

Serial.println("GPS parser");

digitalWrite(ledpin, LOW); // pull low to turn on!

}

void loop()

{

int tmp;

sensorReading = analogRead(knockSensor);

Page 47: SMART HELMET USING ARDUINO B.Tech Project Report

40

if (sensorReading >= threshold)

{

Serial.print("\n\rread: ");

readline(); // check if $GPRMC (global positioning fixed data)

if (strncmp(buffer, "$GPRMC",6) == 0)

{

// hhmmss time data

parseptr = buffer+7;

tmp = parsedecimal(parseptr);

hour = tmp / 10000;

minute = (tmp / 100) % 100;

second = tmp % 100;

parseptr = strchr(parseptr, ',') + 1;

status = parseptr[0];

parseptr += 2;

// grab latitude & long data

// latitude

latitude = parsedecimal(parseptr);

if (latitude != 0)

{

latitude *= 10000;

parseptr = strchr(parseptr, '.')+1;

latitude += parsedecimal(parseptr);

}

parseptr = strchr(parseptr, ',') + 1;

// read latitude N/S data

if (parseptr[0] != ',')

{

latdir = parseptr[0];

}

Serial.print(latdir);

// longitude

parseptr = strchr(parseptr, ',')+1;

longitude = parsedecimal(parseptr);

if (longitude != 0)

{

longitude *= 10000;

Page 48: SMART HELMET USING ARDUINO B.Tech Project Report

41

parseptr = strchr(parseptr, '.')+1;

longitude += parsedecimal(parseptr);

}

parseptr = strchr(parseptr, ',')+1;

// read longitude E/W data

if (parseptr[0] != ',')

{

longdir = parseptr[0];

}

Serial.print(longdir);

// groundspeed

parseptr = strchr(parseptr, ',')+1;

groundspeed = parsedecimal(parseptr);

// track angle

parseptr = strchr(parseptr, ',')+1;

trackangle = parsedecimal(parseptr);

// date

parseptr = strchr(parseptr, ',')+1;

tmp = parsedecimal(parseptr);

date = tmp / 10000;

month = (tmp / 100) % 100;

year = tmp % 100;

Serial.print("\nTime: ");

Serial.print(hour, DEC); Serial.print(':');

Serial.print(minute, DEC); Serial.print(':');

Serial.println(second, DEC);

Serial.print("Date: ");

Serial.print(month, DEC); Serial.print('/');

Serial.print(date, DEC); Serial.print('/');

Serial.println(year, DEC);

Serial.print("Lat: ");

if (latdir == 'N')

Serial.print('+');

Page 49: SMART HELMET USING ARDUINO B.Tech Project Report

42

else

if (latdir == 'S')

Serial.print('-');

Serial.print(latitude/1000000, DEC); Serial.print('\°'); Serial.print(' ');

Serial.print((latitude/10000)%100, DEC); Serial.print('\''); Serial.print(' ');

Serial.print((latitude%10000)*6/1000, DEC); Serial.print('.');

Serial.print(((latitude%10000)*6/10)%100, DEC); Serial.println('"');

Serial.print("Long: ");

if (longdir == 'E')

Serial.print('+');

else

if (longdir == 'W')

Serial.print('-');

Serial.print(longitude/1000000, DEC); Serial.print('\°'); Serial.print(' ');

Serial.print((longitude/10000)%100, DEC); Serial.print('\''); Serial.print(' ');

Serial.print((longitude%10000)*6/1000, DEC); Serial.print('.');

Serial.print(((longitude%10000)*6/10)%100, DEC); Serial.println('"');

Serial.print(latitude);

Serial.print(longitude);

latitude=lati[10];

longitude=longi[10];

Serial.print(lati);

Serial.print(longi);

Serial.println(buffer);

delay(1000);

Serial.println("GSM Testing to send SMS");

if (gsm.begin(9600))

{

Serial.println("\nstatus=READY");

started=true;

}

else

{

Serial.println("\nstatus=IDLE");

}

Page 50: SMART HELMET USING ARDUINO B.Tech Project Report

43

if(started)

{

if (sms.SendSMS("+919052378836", "accident has occured at"))

if (sms.SendSMS("+919052378836", buffer))

Serial.println("\nSMS sent OK");

}

}

}

}

uint32_t parsedecimal(char *str)

{

uint32_t d = 0;

while (str[0] != 0)

{

if ((str[0] > '9') || (str[0] < '0'))

return d;

d *= 10;

d += str[0] - '0';

str++;

}

return d;

}

void readline(void)

{

char c;

buffidx = 0; // start at begninning

while (1)

{

c=Serial.read();

if (c == -1)

continue;

Serial.print(c);

if (c == '\n')

continue;

if ((buffidx == BUFFSIZ-1) || (c == '\r'))

{

buffer[buffidx] = 0;

return;

Page 51: SMART HELMET USING ARDUINO B.Tech Project Report

44

}

buffer[buffidx++]= c;

}

}

Page 52: SMART HELMET USING ARDUINO B.Tech Project Report

45

BIBLIOGRAPHY i. Intro to Embedded systems, By Shibu, 2009.

ii. GRIET Arduino manual

iii. Data sheet for GPS module from Rhydolabz

iv. Data sheet for GSM module from Simplelabz