Fall Detection
Fall Detection
By
© Copyright 2021
a
Department of Electrical Engineering
RCC INSTITUTE OF INFORMATION TECHNOLOGY
CANAL SOUTH ROAD, BELIAGHATA, KOLKATA 700015, WB
PHONE: 033-2323-2463-154, FAX: 033-2323-4668
Website: http://www.rcciit.org/academic/ee.aspx
CERTIFICATE
This is to certify that the project work entitled “Smart Fall Detection System for Elderly People with
IOT and Sensor” is the bonafide work carried out by DISHARI SENGUPTA (11701617061),
SUBHADIP ROY (11701617028), PROGATI BISWAS (11701617050), SUBHAM RAJAK
(11701617027), the students of B.Tech in the Department of Electrical Engineering, RCC Institute of
Information Technology (RCCIIT), Canal South Road, Beliaghata, Kolkata-700015, affiliated to Maulana
Abul Kalam Azad University of Technology (MAKAUT), West Bengal, India, during the academic year
2020-21, in partial fulfilment of the requirements for the degree of Bachelor of Technology in Electrical
Engineering and that this project has not submitted previously for the award of any other degree , diploma
and fellowship.
Countersigned by
b
ACKNOWLEDGEMENT
It is our great fortune that we have got opportunity to carry out this project work under the supervision of
Dr. Debasish Mondal in the Department of Electrical Engineering, RCCInstitute of Information
Technology (RCCIIT), Canal South Road, Beliaghata, Kolkata-700015, affiliated to Maulana Abul Kalam
Azad University of Technology (MAKAUT), West Bengal, India. We express my sincere thanks and
deepest sense of gratitude to my guide for his constant support, unparalleled guidance and limitless
encouragement.
We wish to convey my gratitude to Dr. Debasish Mondal, HOD, Department of Electrical Engineering,
and RCCIIT and to the authority of RCCIIT for providing all kinds of infrastructural facility towards the
research work.
We would also like to convey our gratitude to all the faculty members and staffs of the Department of
Electrical Engineering, RCCIIT for their whole hearted cooperation to make this work turn into reality.
Place:Kolkata
Date: 04.07.2021
c
Contents
Topic Page No
List of Figures i
Abstract ii
Chapter 1 : Introduction
1.1 Literature Review 1
1.2 Overview & Benefit 2
Chapter 2 : Theoretical Concept
2.1 Basic of Internet of Things 4
2.2 Fall Risk Factor 9
2.3 Fall Detection Algorithm 9
2.4 Plan of project 11
2.5 Circuit Diagram 12
Chapter 3 : Hardware Modelling
3.1 Components Used 13
3.2 Main features of the prototype 13
3.3 Photographs of the components 14
3.4 Operation of prototype 15
3.5 Hardware Interfacing 16
Chapter 4 : Implementation of Logic & Operation
4.1 Basics 17
4.2 Flow Chart 17
4.3 Principle of operations 18
4.4 Photographs of prototypes 20
Chapter 5 : Conclusion & Future Scope
5.1 Conclusion 24
5.2 Results 24
5.3 Advantages of prototype 26
5.4 Disadvantages of prototype 26
5.5 Cost Estimation of the project 27
5.6 Future works 27
References 28
d
FIGURES
i
ABSTRACT
Falling down is among the most common causes of medical attention required by the elderly people.
Elderly people often injure themselves from falling down more especially when they are living alone.
After a fall occurs, medical attention needs to be provided promptly in order to reduce the risk of victim.
Several technologies have been developed which utilize webcams to monitor the activities of elderly
people. However, the cost of operation and installation is expensive and only applicable for indoors...
Current commercialized device required user to wear wireless emergency transmitter in form of
wristwatch. This method will restrict the user movement and produce high false alarm due to frequent
swinging and movement of the device.
This project proposed a fall detection system which is cost effective and reliable to detect fall and alert
relatives for help and support. For fall detection, accelerometer and gyroscope was used to detect
acceleration and body tilt angle of the faller respectively. By coupling accelerometer with gyroscope, the
accuracy of the system was improved due to reducing in false positives and true negatives... Alert system
in form of Short Message Service (SMS) was transmitted to the concerned authorities. Moreover, this
wearable device requires less implementation cost and provides a quick response. As a result, this fall
detection and alert system has the sensitivity and specificity of 95% and 90% respectively. However, the
limitation of this device is unable to detect a user falling against a wall and falling end in sitting position.
Recommendation for future work is to develop an interactive display which enables users to input
relative’s phone number.
i
Chapter 1
Introduction
1.1 Literature Review
Fall is the most significant causes of injury for elderly. These falls are because many disabling fractures
that could eventually go in front to death due to complications. Most elderly (over 75 years old) have
fallen at least once a year, and 24 % of them have severe injuries [1]. This is a serious public health
problem with a substantial impact on health and healthcare costs [2]. The cost and burden of caring for
older adults is steadily increasing [3].Among people affected by Alzheimer’s disease, the probability of a
fall increases by three times. Elderly care can be improved by using sensors that monitor the vital signs
and activities of patients, and remotely communicate this information toothier doctors and caregivers. The
consequences of a fall can vary from scrapes to fractures and in some cases lead to death. Even if there
are no immediate consequences, the long-wait on the floor for help increases the probability of death from
the accident. For this reason, fall detections an active area of research. In the recent years, passive
monitoring solutions have penetrated into health monitoring systems in homes, assisted living
environments, and nursing homes. They provide timely interventions in case of emergency [4, 5].Most of
the research on falls in which accelerometers issued focus on determining the change in magnitude of
acceleration. When the acceleration value exceeds a critical threshold, the fall is detected [6, 7]. The use
of wearable and active sensors provides better monitoring ability [8].A contribution is made towards such
standardization by collecting the most relevant parameters, data filtering techniques and testing
approaches from the studies done so far. State-of-the-art fall detection techniques were surveyed,
highlighting the differences in their effectiveness at fall detection. A standard database structure was
created for fall study that emphasizes the most important elements of a fall detection system that must be
considered for designing a robust system [9], as well as addressing the constraints and challenges. In
addition, fall activity patterns are particularly difficult to obtain for training systems. These systems
successfully detect falls with sensitivities. However, focusing only on large acceleration can result in
many false positives from fall-like activities such assisting down quickly and running. Furthermore,
previous studies used complex algorithms like support vector machine (SVM) [10] and Markov model
[11] to detect the fall.
1
However, accuracy of these systems has not been proven to be highly effective. They also use excessive
amounts of computational resources and cannot respond in real time. In this paper we propose a new
device based on microcontroller (Adriano-UNO) and the sensor is MPU6050 Accelerometer and Gyro
Chip.
PROJECT PERSPECTIVE
In order to reduce the risk of elderly people getting harm from fall, medical attention needs to be
provided immediately. Therefore, a reliable fall detection system can help to detect fall in elderly people
and contact the nearest healthcare service for help and support.
The fall detection system need to be user friendly which means it is easier to be used by the elderly
people. The system also must not interfere and disturb activities of daily living of elderly people. The
system needs to be cost-effective and durable.
The MPU6050 sensor module has built-in a gyroscope and an accelerometer sensor. The gyroscope is
used to determine the orientation and the accelerometer provides information about the angular
parameter such as the X, Y, and Z-axis data. We interface this sensor with arguing microcontroller and
keep different acceleration thresholds to check whether any false triggering is happening or the user has
really fallen. If values exceed thresholds then we via Blink app we get notification in our android
device.
To develop an intelligent and effective fall detection and alert system using Smartphone and wireless
sensor node
To develop a reliable and cost efficient fall detection and alert system
To develop a fall detection system that is user friendly and without causing disturbance to activities of
daily living of elderly people
2
Our
Inspiration
to help
3
Chapter-2
Theoretical Concept
2.1 Basics of Internet of Things (IoT)
IoT (Internet of Things) is an advanced automation and analytics system which exploits networking,
sensing, big data, and artificial intelligence technology to deliver complete systems for a product or
service. These systems allow greater transparency, control, and performance when applied to any industry
or system.
IoT systems have applications across industries through their unique flexibility and ability to be suitable
in any environment. They enhance data collection, automation, operations, and much more through smart
devices and powerful enabling technology.
IoT systems allow users to achieve deeper automation, analysis, and integration within a system. They
improve the reach of these areas and their accuracy. IoT utilizes existing and emerging technology for
sensing, networking, and robotics. IoT exploits recent advances in software, falling hardware prices, and
modern attitudes towards technology. Its new and advanced elements bring major changes in the delivery
of products, goods, and services; and the social, economic, and political impact of those changes.
4
Sensors – IoT loses its distinction without sensors. They act as defining instruments which
transform IoT from a standard passive network of devices into an active system capable of real-world
integration.
Active Engagement – Much of today's interaction with connected technology happens through
passive engagement. IoT introduces a new paradigm for active content, product, or service engagement.
Small Devices – Devices, as predicted, have become smaller, cheaper, and more powerful over
time. IoT exploits purpose-built small devices to deliver its precision, scalability, and versatility.
IoT– Advantages
The advantages of IoT span across every area of lifestyle and business. Here is a list of some of
the advantages that IoT has to offer:
Improved Customer Engagement – Current analytics suffer from blind-spots and significant
flaws in accuracy; and as noted, engagement remains passive. IoT completely transforms this to achieve
richer and more effective engagement with audiences.
Technology Optimization – The same technologies and data which improve the customer
experience also improve device use, and aid in more potent improvements to technology. IoT unlocks a
world of critical functional and field data.
Reduced Waste – IoT makes areas of improvement clear. Current analytics give us superficial
insight, but IoT provides real-world information leading to more effective management of resources.
Enhanced Data Collection – Modern data collection suffers from its limitations and its design for
passive use. IoT breaks it out of those spaces, and places it exactly where humans really want to go to
analyse our world. It allows an accurate picture of everything.
IoT– Disadvantages
Though IoT delivers an impressive set of benefits, it also presents a significant set of challenges.
Here is a list of some its major issues:
Security – IoT creates an ecosystem of constantly connected devices communicating over
networks. The system offers little control despite any security measures. This leaves users exposed to
various kinds of attackers. 7
5
Privacy – The sophistication of IoT provides substantial personal data in extreme detail without
the user's active participation.
Complexity – Some find IoT systems complicated in terms of design, deployment, and
maintenance given their use of multiple technologies and a large set of new enabling technologies.
Flexibility – Many are concerned about the flexibility of an IoT system to integrate easily with
another. They worry about finding themselves with several conflicting or locked systems.
Compliance – IoT, like any other technology in the realm of business, must comply with
regulations. Its complexity makes the issue of compliance seem incredibly challenging when many
consider standard software compliance a battle.
IoT software addresses its key areas of networking and action through platforms, embedded systems,
partner systems, and middleware. These individual and master applications are responsible for data
collection, device integration, real-time analytics, and application and process extension within the IoT
network. They exploit integration with critical business systems (e.g., ordering systems, robotics,
scheduling, and more) in the execution of related tasks.
Data Collection
This software manages sensing, measurements, light data filtering, light data security, and
aggregation of data. It uses certain protocols to aid sensors in connecting with real-time, machine-to-
machine networks. Then it collects data from multiple devices and distributes it in accordance with
settings. It also works in reverse by distributing data over devices. The system eventually transmits all
collected data to a central server.
Device Integration
Software supporting integration binds (dependent relationships) all system devices to create the
body of the IoT system. It ensures the necessary cooperation and stable networking between devices.
These applications are the defining software technology of the IoT network because without them, it is
not an IoT system. They manage the various applications, protocols, and limitations of each device to
allow communication.
6
Real-Time Analytics
These applications take data or input from various devices and convert it into viable actions or
clear patterns for human analysis. They analyse information based on various settings and designs in
order to perform automation-related tasks or provide the data required by industry.
These applications extend the reach of existing systems and software to allow a wider, more
effective system. They integrate predefined devices for specific purposes such as allowing certain mobile
devices or engineering instruments access. It supports improved productivity and more accurate data
collection.
IoT primarily exploits standard protocols and networking technologies. However, the major enabling
technologies and protocols of IoT are RFID, NFC, low-energy Bluetooth, low-energy wireless, low-
energy radio protocols, LTE-A, and WiFi-Direct. These technologies support the specific networking
functionality needed in an IoT system in contrast to a standard uniform network of common systems.
RFID (radio-frequency identification) and NFC (near-field communication) provide simple, low
energy, and versatile options for identity and access tokens, connection bootstrapping, and
payments.
RFID technology employs 2-way radio transmitter-receivers to identify and track tags associated
with objects.
NFC consists of communication protocols for electronic devices, typically a mobile device and a
standard device.
Low-Energy Bluetooth
This technology supports the low-power, long-use need of IoT function while exploiting a
standard technology with native support across systems.
7
Low-Energy Wireless
This technology replaces the most power hungry aspect of an IoT system. Though sensors and
other elements can power down over long periods, communication links (i.e., wireless) must remain in
listening mode. Low-energy wireless not only reduces consumption, but also extends the life of the device
through less use.
Radio Protocols
ZigBee, Z-Wave, and Thread are radio protocols for creating low-rate private area networks. These
technologies are low-power, but offer high throughput unlike many similar options. This increases the
power of small local device networks without the typical costs.
LTE-A
LTE-A, or LTE Advanced, delivers an important upgrade to LTE technology by increasing not only its
coverage, but also reducing its latency and raising its throughput. It gives IoT a tremendous power
through expanding its range, with its most significant applications being vehicle, UAV, and similar
communication.
WiFi-Direct
WiFi-Direct eliminates the need for an access point. It allows P2P (peer-to-peer) connections
with the speed of WiFi, but with lower latency. WiFi-Direct eliminate an element of a network that often
bogs it down, and it does not compromise on speed or throughput.
8
2.2 Fall Risk Factors
A person can be more or less prone to fall, depending on a number of risk factors and hence a
classification based on only age as a parameter is not enough. In fact, medical studies have determined a
set of so called risk factors:
• Intrinsic:
1. Age (over 75)
2. Chronic disease
3. Previous falls
4. Poor balance
5. Low mobility and bone fragility
6. Sight problems
7. Cognitive and dementia problems
8. Parkinson disease
9. Use of drugs that affect the mind
10. Incorrect lifestyle (inactivity, use of alcohol, obesity)
• Internal Environment:
1. Need to reach high objects
2. Slipping floors
3. Stairs
4. Incorrect use of shoes and clothes
• External Environment:
1. Damaged roads
2. Dangerous steps
3. Poor lighting
4. Crowded places.
The total sum acceleration vector Acc, contain both dynamic and static acceleration
Components, is calculated from sampled data as indicated in Eq. (1)11
9
Acc=√(𝐴𝑥)2 + (𝐴𝑦)2 + (𝐴𝑧)2....................(1)
Where Ax, Ay, Az are the acceleration in the x, y, z axes, respectively.
Similarly to the acceleration, the angular velocity is calculated from sampled data as indicated in Eq. (2)
The negative peaks for the resultant of each recorded activity are referred to as the signal lower peak
values (LPVs). The LFT for the acceleration signals are set at the level of the smallest magnitude lower
fall peak (LFP) recorded.
The positive peaks for the recorded signals for each recorded activity are referred to as the signal upper
peak values (UPVs). The UFTfor each of the acceleration and the angular velocity signals were set
at the level of the smallest magnitude UPV recorded. The UFT is related to the peak impact force
experienced by the body segment during the impact phase of the fall.
Fall detection algorithms using thresholds are normally divided into two groups, one is based on the LFT
comparison and the other is based on UFT comparison of acceleration data. Although past research has
achieved some significant results, the accuracy is still
Below desired levels. In this study adjust the UFT and LFT and found the performance to be 83.33 % and
67.08 %, respectively
1
2.4 Plan of the Project
This project overview basically gives us a bird’s eye view over the entire system that comprises of 5
steps-PLANNING, DESIGNING, IMPLEMENTATION, TESTING & EVALUATION.
Analysing the severe consequences of elder persons falling and current market options available to
counter the problem, we came up with the plan of introducing arduino based kinematic method.
Hereby we use an accelerometer and a gyroscope to analyse the body movements of the user and predict
whether any sharp change in acceleration has occurred or not which will give an indication of a probable
fall.
The MPU6050 sensor module is a complete 6-axis (3-axis Accelerometer and 3-axis Gyroscope) Module.
It is Micro-Electro-Mechanical Systems (MEMS) that is used to measure acceleration, velocity,
orientation, displacement, and many other motion-related parameters. Apart from this, it also has an
additional built-in Temperature sensor.
The MPU6050 module is small in size with lower power consumption. Apart from this, it has high
repetition, high shock tolerance, and low user price points. Basically, the MPU6050 comes with an I2C
and Auxiliary I2C interface. So it can easily interfere with other sensors such as magnetometers and
microcontrollers.
KINEMATIC
BASED 2
Sum Vector Magnitude of Acceleration = √𝑥 + 𝑦2 + 𝑧2
Where x,Tri-axial
y and z isAccelerometer
the magnitude of acceleration in itsGyroscope
respective direction.
When the magnitude of the acceleration is higher than the threshold, the microcontroller will check for
orientation of the user by using gyroscope that came together with MPU6050 Accelerometer. There are
1
two possible outcomes from the gyroscope which is either upright or lying down. If the user is standing
upright, the device will continue to monitor the acceleration. However, when a fall occurred and the user
is found to be lying down on the ground, notification is sent via BLYNK Application on the care takers
mobile.
1
Chapter-3
Hardware Modelling
Sl Components Quantity
No
.
1 Arduino Uno 1
2 MPU6050 1
3 Battery 1
4 Jumper Wire(Male - Female) 5
(Male - Male) 2
5 Device (with installed Blynk As per required
Application)
Light weight
Automatic control
5V operation
Low cost
1
3.3 Photographs of the Components
Figure 4: MPU6050
1
3.4 Operation of prototype
1
3.5 Hardware Interfacing
1
Chapter-4
Implementation Logic & Operation
4.1 Basics
After assembling the system, what remains is to observe its operation and efficiency of the system. The
total system is divided in several sub systems, like
MPU6050 section
Arduino section
Application System
1
4.3 Principle & Operation
This project was divided into 5 stages namely planning, design, implementation, testing and evaluation.
By splitting into 5 different stages, the flow of the project was more organized and systematic.
The first stage of this project is planning. In order to complete the project on time with limited budget, a
proper planning is required. During this stage, information such as acceleration and orientation of a
person falling was directly referred to previous research paper.
Designing stage involves brainstorming ideas and solution to overcome the problem statement by this
project. After conducting research during planning stage, multiple ideas are generated and become
alternatives which each can be used to overcome the problem. By taking consideration of factors and
limitation such as budget, time, and components availability, the best design was selected. In order to
understand the process of the fall detection and alert system, a flow chart and pseudo code was designed
and prepared. Components are selected based on their cost, availability, quality and compatibility.
Positioning of the fall detection device on a person body is determined based on previous research paper
and experimentation.
After finalizing the design and components selection, the next stage was the implementation stage.
Components was purchased and arrived in expected time to avoid delay in the project. In this stage, fall
detection and alert system was fabricated into a prototype. Besides that, programming code or algorithm
is designed to be programmed into the microcontroller which in this case is ArduinoUNO. It is important
for the algorithm to be simple and easy to understand because it is easier to troubleshoot when errors
occurred. Besides that, programming code or algorithm is designed to be programmed into the
microcontroller which in this case is ArduinoUNO. It is important for the algorithm to be simple and easy
to understand because it is easier to troubleshoot when errors occurred.
Testing stage involves performing multiple of different test with the prototype. In order to ensure the
prototypes working as per design, several numbers of tests are performed includes front fall, back fall and
side fall. During testing phase, acceleration and orientation data are acquired and to be compared with the
acceleration value from previous research paper. Necessary modification and adjustment was done during
this stage to achieve the best result.
1
Finally, the evaluation stage ensures the functionality of the fall detection and alert system. It is important
to evaluate the performance of the prototype in term of reliability and accuracy. In this stage, the
prototype need to reliable in detecting a person fall and accurately differentiate it from activities of daily
living (ADL).
1
4.4 Photographs of Prototype
2
Figure 14: Full picture of Set-up (1)
2
Figure 16: Figureof Output (1)
2
Figure 18: Figure of Schematic Circuit
2
Chapter-5
Conclusion & Future Scope
5.1 Conclusion
The several fall-feature parameters of the 6-axes acceleration were introduced and applied according the
algorithm. Possible falls were chosen through the simple threshold and then applied to the MPU to solve
the problems such as deviation of interpersonal falling behavioural patterns and similar fall actions. The
test of the proposed device studied along a different 350 case studies. The parameters of upper and lower
of acceleration and velocity have adjusted to give best fall detection with sensitivity, specificity, and
accuracy which were over than 95 %. These results demonstrate the reduction of the computing effort and
resources, compared to those of using all the events applied. Then the proposed algorithms were very
simple because it dependson a simple sensor (measure the angle) and the program calculates the angular
velocity and acceleration. They can be implemented into an embedded system such as an 8051-based
microcontroller with 128 Kbyte ROM. In the future, if the proposed algorithms are implemented to the
embedded system, its performance will be tested in a real time.
5.2 Results
Some existing acceleration-based fall detection systems are only used to distinguish falls from ADL.
However, some activities like sitting down fast also feature large vertical acceleration. Figure 20shows the
acceleration and rotational rate of the trunk where the cases as follows: (a) run on a damaged road, (b)
walking fast (c) step up a Stair. In Fig. 20along three cases there is no fall then there is no alarm. Figure
21shows the acceleration and rotational rate of the trunk and thigh for sitting fast. Where the cases as
follows: (a) is a dangers fall detected, (b) is a fall posture. In Fig. 21(a) the fall detectedvery fast and give
alarm in the first moment and continued along 30 s while in Fig. 21 (b) give alarm after 10 s because there
is no fall.
2
30
Figure 20: Result: (a) Run on a Damaged Road (b) Walking Fast (c) Step up a stair
2
Figure 20:
Figure 21: Result Analysis: (a) Danger fall detected (b) Fall posture
2
5.5Cost Estimation of the Project
5.6Future Works
In the future, if the proposed algorithms are implemented to the embedded system, its performance will be
tested in a real time. Also we will try to include a GPS tracker in it.
2
References
1. Hwang, J.Y., Kang, J.M., Jang, Y.W., Kim, H.C.: Development of novel algorithm and real time
monitoring ambulatory system using Bluetooth module for fall detection in the elderly. In: Engineering
in Medicine and Biology Society, IEMBS 2004, 26th Annual International Conference of the IEEE,
vol. 1, pp. 2204–2207, September 2004
2. B. Najafi, K. Aminian, F. Loew, Y. Blanc and P. A. Robert, "Measurement of stand-sit and sit-and
transitions using a miniature gyroscope and its application in fall risk evaluation in the elderly", IEEE
Trans. Biomed. Eng., vol. 49, no. 8, pp. 843-851, 2002.
3. National Institute ofNursing Research, Informal Caregiving Research for Chronic Conditions RFA,
(2001).
5. M. Alwan, D. Mack, S. Dalal, S. Kell, B. Turner, and R. Felder, “Impact of passive in-home health
status monitoring technology in home health: Outcome pilot,” in Distributed Diagnosis and Home
Healthcare, 2006.D2H2. 1st Transdisciplinary Conference on, 2006, pp. 79 –82.
6. Lindemann, U., Hock, A., Stuber, M., Keck, W., Becker, C.: Evaluation of a fall detector based on
accelerometers: a pilot study. Med. Biol. Eng. Comput. 43(5), 548–551 (2005)
8. Kangas, M., Konttila, A., Lindgren, P., Winblad, I., Jämsä, T.: Comparison of low-complexity fall
detection algorithms for body attached accelerometers. Gait Posture 28(2), 285–291 (2008)
9. Abbate, S., Avvenuti, M., Corsini, P., Light, J., Vecchio, A.: Monitoring of human movements for fall
detection and activities recognition in elderly care using wireless sensor network: asurvey, pp. 1–20.
InTech (2010)
10. Zhang, T., Wang, J., Xu, L., Liu, P.: Fall detection by wearable sensor and one-class SVM algorithm.
In: Huang, D.-S., Li, K., Irwin, G.W. (eds.) ICIC 2006. LNCIS, vol. 345, pp. 858–863. Springer,
Heidelberg (2006)
11. Ganti, R.K., Jayachandran, P., Abdelzaher, T.F., Stankovic, J.A.: Satire: a software architecture for
smart attire. In: Proceedings of the 4th International Conference on Mobile Systems, Applications and
Services, pp. 110–123. ACM, June 2006
2
Appendix: A
Software Coding
PROGRAM CODE:
#include <Wire.h>
#include <MPU6050.h>
MPU6050 mpu;
void setup()
{
Serial.begin(115200);
// Initialize MPU6050
Serial.println(“Initialize
MPU6050”);
while(!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))
{
Serial.println(“Could not find a valid MPU6050 sensor, check wiring!”);
delay(500);
}
// Check settings
checkSettings();
2
}
voidcheckSettings()
{
Serial.println();
Serial.println();
}
void loop()
3
{
Vector rawGyro = mpu.readRawGyro();
Vector normGyro =
mpu.readNormalizeGyro();
Serial.print(“Xraw = “);
Serial.print(rawGyro.Xaxis);
Serial.print(“Yraw = “);
Serial.print(rawGyro.Yaxis);
Serial.print(“Zraw = “);
Serial.println(rawGyro.Zaxis);
Serial.print(“Xnorm = “);
Serial.print(normGyro.Xaxis);
Serial.print(“Ynorm = “);
Serial.print(normGyro.Yaxis);
Serial.print(“Znorm = “);
Serial.println(normGyro.Zaxis);
delay(10);
}
3
Appendix:B
Details of Hardware
Arduino Uno:
The Arduino Uno is an open-source microcontroller board based on the Microchip ATmega328P
microcontroller and developed by Arduino.cc. The board is equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The
board has 14 digital digital I/O pins and is programmable with the Arduino IDE via a type B USB cable.
It can be powered by the USB cable or by an external 9-volt battery, though it accepts voltages between 7
and 20 volts.
Technical Specifications:
o Microcontroller : Microchip ATmega328P
o Operating Voltage : 5 Volts
o Input Voltage : 7 to 20 Volts
o Digital I/O Pins : 14(of which 6 can provide PWM output)
o UART : 1
o SPPI : 1
o Analog Input Pins : 6
o DC Current per I/O Pin : 20 mA
o DC Current for 3.3V Pin : 50 mA
o Flash Memory : 32 KB of which 0.5 KB used by bootloader
o SRAM : 2 KB
o EEPROM : 1 KB
o Clock Speed : 15 MHz
o Length : 68.6 mm
o Width : 53.4 mm
o Weight : 25 g
3
General pin functions
LED: There is a built-in LED driven by digital pin 13. When the pin is high value, the LED is on, when
the pin is low, it is off.
VIN: The input voltage to the Arduino/Genuino board when it is 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: 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 - 20V), the USB connector (5V), or the VIN pin of the board (7-
20V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage the board.
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/Genuino 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 to work with the 5V or 3.3V.
Reset: Typically used to add a reset button to shields that block the one on the
board. Special pin functions
Each of the 14 digital pins and 6 analog pins on the Uno can be used as an input or output, under
software control (using pinMode (), digital Write (), and digital Read () functions). They operate at 5
volts. Each pin can provide or receive 20 mA as the recommended operating condition and has an
internal pull-up resistor (disconnected by default) of 20-50K ohm. A maximum of 40mA must not be
exceeded on any I/O pin to avoid permanent damage to the microcontroller. The Uno has 6 analog
inputs, labeled A0 through A5; each provides 10 bits of resolution (i.e. 1024 different values). By
default, they measure from ground to 5 volts, though it is possible to change the upper end of the range
using the AREF pin and the analogReference () function.
Serial / UART: pins 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.
3
External interrupts: pins 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.
PWM (pulse-width modulation): pins 3, 5, 6, 9, 10, and 11. Can provide 8-bit PWM output with the
analogWrite () function.
SPI (Serial Peripheral Interface): pins 10 (SS), 11 (MOSI), 12 (MISO), and 13 (SCK). These pins support
SPI communication using the SPI library.
TWI (two-wire interface) /𝐼2𝐶 : pin SDA (A4) and pin SCL (A5). Support TWI communication using the
Wire library.
AREF (analog reference): Reference voltage for the analog inputs.
Communication
The Arduino/Genuino Uno has a number of facilities for communicating with a computer, another
Arduino/Genuino board, 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. Arduino Software (IDE) 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 USB-to-serial chip and USB connection to the computer (but not
for serial communication on pins 0 and 1). A SoftwareSerial library allows serial communication on any
of the Uno's digital pins.
This setup has other implications. When the Uno is connected to 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.
3
Figure 22: Arduino Uno
MPU6050:
MPU6050 is a Micro Electro-Mechanical Systems (MEMS) which consists of a 3-axis Accelerometer and 3-
axis Gyroscope inside it. This helps us to measure acceleration, velocity, orientation, displacement and many
other motion related parameter of a system or object. This module also has a (DMP) Digital Motion
Processor inside it which is powerful enough to perform complex calculation and thus free up the work for
Microcontroller.
The module also have two auxiliary pins which can be used to interface external IIC modules like a
magnetometer, however it is optional. Since the IIC address of the module is configurable more than
one MPU6050 sensor can be interfaced to a Microcontroller using the AD0 pin. This module also has well
documented and revised libraries available hence it’s very easy to use with famous platforms like Arduino.
3
2 Ground Connected to Ground of system
3 Serial Clock Used for providing clock pulse for I2C
(SCL) Communication
4 Serial Data Used for transferring Data through I2C
(SDA) communication
5 Auxiliary Serial Can be used to interface other I2C modules
Data (XDA) with MPU6050. It is optional
6 Auxiliary Serial Can be used to interface other I2C modules
Clock (XCL) with MPU6050. It is optional
7 AD0 If more than one MPU6050 is used a single
MCU, then this pin can be used to vary the
address
8 Interrupt (INT) Interrupt pin to indicate that data is available
for MCU to read.
Features
MEMS 3-aixs accelerometer and 3-axis gyroscope values combined
Power Supply: 3-5V
Communication : I2C protocol
Built-in 16-bit ADC provides high accuracy
Built-in DMP provides high computational power
Can be used to interface with other IIC devices like magnetometer
Configurable IIC Address
In-built Temperature sensor
Figure 23:MPU6050
Battery:
3
A battery is a power source consisting of one or more electrochemical cells with external connections for
powering electrical devices such as flashlights, mobile phones, and electric cars. When a battery is
supplying electric power, its positive terminal is the cathode and its negative terminal is the anode. The
terminal marked negative is the source of electrons that will flow through an external electric circuit to the
positive terminal. When a battery is connected to an external electric load, a redox reaction converts high-
energy reactants to lower-energy products, and the free-energy difference is delivered to the external
circuit as electrical energy.
Jumper Wire:
A jump wire (also known as jumper, jumper wire, jumper cable, DuPont wire or cable) is an electrical
wire, or group of them in a cable, with a connector or pin at each end (or sometimes without them –
simply "tinned"), which is normally used to interconnect the components of a breadboard or other
prototype or test circuit, internally or with other equipment or components, without soldering.Individual
jump wires are fitted by inserting their "end connectors" into the slots provided in a breadboard,
the header connector of a circuit board, or a piece of test equipment.There are different types of jumper
wires. Some have the same type of electrical connector at both ends, while others have different
connectors. Some common connectors are mentioned in the figure
3
BLYNK Application:
Blynk was designed for the Internet of Things. It can control hardware remotely, it can display sensor
data, it can store data, vizualize it and do many other cool things.
Blynk App - allows to you create amazing interfaces for your projects using various widgets we provide.
Blynk Server - responsible for all the communications between the Smartphone and hardware.
Blynk Libraries - for all the popular hardware platforms - enable communication with the server and
process all the incoming and out coming commands.
Features
Similar API & UI for all supported hardware & devices
Connection to the cloud using:
WiFi
Bluetooth and BLE
Ethernet
USB (Serial)
GSM
Set of easy-to-use Widgets
Direct pin manipulation with no code writing
Easy to integrate and add new functionality using virtual pins
History data monitoring via SuperChart widget
Device-to-Device communication using Bridge Widget
Sending emails, tweets, push notifications, etc.