You are on page 1of 101

E - HEALTH YOGA MAT USING RASPBERRY PI

NAGALINGESWARAN ARMUGAM

A project report submitted in partial


fulfillment of the requirement for the award of the
Degree of Electronic Engineering with Honours

Faculty of Electrical and Electronic Engineering


Universiti Tun Hussein Onn Malaysia

JUNE 2022
ii

I hereby declare that the work in this thesis is my own except for quotations and
summaries which have been duly acknowledged

Student : ..............................................................
NAGALINGESWARAN ARMUGAM
Date : ..............................................................

Supervisor : ..............................................................
Dr. JONG SIAT LING
iii

ACKNOWLEDGEMENT

Foremost, I would like to acknowledge the Almighty God for His benevolence and
for granting me wisdom and perseverance not only in the time of research and
writing of this thesis, but indeed, throughout my life. I express, with heartfelt
appreciation, my gratitude to my supervisor, Dr Jong Siat Ling for her sincere and
invaluable intellectual guidance extended to me throughout the years of my
postgraduate studies. My sincere appreciation goes to the Ministry of Education
Malaysia and Universiti Tun Hussein Onn Malaysia for providing me with financial
support. I extend my appreciation to all my friends for their unwavering support and
who have stood by me through so many tough times. Last but not least, special
thanks to my beloved parents for their blessings and unflinching insistence, who have
always encouraged me to never stop achieving my goals in life.
iv

ABSTRACT

Yoga is a beneficial form of exercise that focuses on physical, mental, and spiritual
connections. Yoga, on the other hand, can lead to health issues such as muscle
sprains and soreness if done incorrectly. In this aim, I have proposed an E-Health
Yoga Mat Using Raspberry Pi. This project uses Raspberry Pi as a micro controller
and has 5 Force Sensitive Resistor sensors on the yoga mat which interface with the
Raspberry Pi. Using the sensors on the mat, the user will be able to detect the weight
of the body as well. When the user performs the wrong posture on the mat, there will
be a buzzer to alert the user. The data and information collected will be stored in
the Blynk Application for reference purposes and able to access the Raspberry Pi
from our hand phone using this Application. The study presented a yoga posture
guiding system on the mat, based on the GUI interfaced with the Phyton coding in
Raspberry Pi. Yoga posture performed by the user will be in real-time, according to
the yoga posture guidance, and can teach them to avoid wrong postures as well.
v

ABSTRAK

Yoga adalah bentuk latihan yang bermanfaat yang memfokuskan pada hubungan
fizikal, mental, dan rohani. Yoga, sebaliknya, boleh menyebabkan masalah kesihatan
seperti keseleo otot dan sakit jika dilakukan dengan tidak betul. Untuk tujuan ini,
saya telah mencadangkan E-Health Yoga Mat dengan menggunakan Raspberry Pi.
Projek ini menggunakan Raspberry Pi sebagai pengawal mikro dan mempunyai lima
penderia perintang sensitif daya pada tikar yoga yang bersambung dengan Raspberry
Pi. Dengan menggunakan sensor pada tikar, pengguna juga dapat mengesan berat
badan. Apabila pengguna melakukan postur yang salah di atas tikar, pembunyi
isyarat akan diaktifkan untuk memberi amaran kepada pengguna. Data dan maklumat
yang dikumpulkan akan disimpan di Aplikasi untuk tujuan rujukan dan dapat
mengakses Raspberry Pi dari telefon bimbit kami menggunakan Aplikasi ini. Kajian
ini mengkaji sistem panduan postur yoga di tikar, berdasarkan GUI yang
dihubungkan dengan pengekodan Phyton di Raspberry Pi. Postur yoga yang
dilakukan oleh pengguna akan berada dalam waktu nyata, sesuai dengan panduan
postur yoga, dan dapat mengajar mereka untuk menghindari postur yang salah juga.
vi

CONTENTS

TITLE i

DECLARATION ii

ACKNOWLEDGEMENT iii

ABSTRACT iv

ABSTRAK v

CONTENTS vi

LIST OF TABLES x

LIST OF FIGURES xi

LIST OF SYMBOLS AND ABBREVIATIONS xiii

LIST OF APPENDICES xiv

CHAPTER 1 INTRODUCTION 1

1.1 Project Background 1


1.2 Problem statement 2
1.3 Hypothesis 3
1.4 Aim 4
1.5 Objective 4
1.6 Scope of Study 4
1.7 Research Contribution 5
1.8 Outline of the Project 6

CHAPTER 2 LITERATURE REVIEW 8


vii

2.1 Review of related project 8


2.1.1 Case Study 1: Smart-Mat-Recognizing And 8
Counting Gym Exercises With Low-Cost
Resistive Pressure Sensing Matrix
2.1.2 Case Study 2: Interactive Exercise Mat 11
2.1.3 Case Study 3: Development Of a Yoga Posture 13
Coaching System Using An Interactive Display
Based On Transfer Learning
2.1.4 Case Study 4: Prediction Of Body Weight Of A 14
Person Lying On A Smart Mat In Non-restraint
And Unconsciousness Conditions
2.1.5 Case Study 5: Fitness Mat Dev Kit 16
2.1.6 Case Study 6: A Research Paper On New 16
Generation GymMat
2.1.7 Case Study 7: Social Yoga Mats: Designing For 17
Exercising Or Socializing Synergy
2.1.8 Case Study 8: Real-Time Yoga Activity With 18
Assistance Of Embedded Based Smart Yoga
Mat
2.1.9 Case Study 9:Balance Sensory And Motor 19
Feedback Mat

2.1.10 Case Study 10: Hiit Pi Makes Raspberry Pi 20


Your Home Workout Buddy
2.2 Hardware Research 21
2.2.1 Microcontroller 22
2.2.2 Force Sensitive Resistor 26
2.2.3 Analog to Digital Converter 29
2.2.4 3.5 Inch TFT Display Pin 34
2.2.5 Buzzer 36
2.2.6 Arduino Pro Mini 38
2.3 Software Research 40
2.3.1 Application 40
2.3.2 Phyton Language 42

CHAPTER 3 RESEARCH METHODOLOGY 43

3.1 Introduction 43
3.2 Working Plan 44
3.3 Project Flow 44
3.4 Block Diagram 47
viii

3.5 Process Flow 48


3.6 Hardware Development 51
3.6.1 Force Sensitive Sensor 51
3.6.2 Arduino Pro Mini 52
3.6.3 Raspberry Pi 4 Model B 53
3.6.4 3.5 Inch Touch Screen 54
3.6.5 Buzzer 55
3.6.6 Yoga Mat 56
3.6.7 Schematic Diagram 57
3.7 Software Development 57
3.7.1 Phyton 57
3.7.2 Application 62

CHAPTER 4 RESULTS AND DISCUSSION 63

4.1 Overview 63
4.2 Hardware and Software Findings 63
4.2.1 Sensor Connection 64
4.2.2 Design and Assembly 65
4.2.3 Multiple Sensor Connection Testing 66
4.2.4 Display 68
4.2.5 Application 68
4.3 Result 71

CHAPTER 5 CONCLUSION 76

5.1 Overview 76
5.2 Conclusion 76
5.3 Recommendation for future work 77

REFERENCES 78

APPENDIX 79
ix

LIST OF TABLES

2.1 List of Components 21


2.2 Comparison between Raspberry Pi 3B+ and Raspberry 22
Pi 4 Model B
2.3 Advantages and Disadvantages of using Raspberry Pi 26
4
2.4 Basic Stat of Force Sensitive Resistor Sensor 28
2.5 List of Pin and description on 3.5 inch TFT touch 35
screen
2.6 Instruction 41
2.7 Clone the wiring Pi Git repository 41
2.8 Switch to the wiring Pi 41
2.9 Command to compile the library 42
x

LIST OF FIGURES

2.1 Frame before and after pre processing 9


2.2 Figure 2.2: Exercises performed in the experiment: I. 10
push-up, II. quadruped, III. abdominal crunch, IV.
chest press with dumbbell, V. bridge. The pictures on
the right are typical frames corresponding to the
exercise
2.3 Figure 2.3: Detection rate of exercise counting for each 11
subject and activity using different templates
2.4 Application display on the Raspberry Pi 12
2.5 Circuit Connection Flow Chart 12
2.6 Transfer learning process from pre-trained on 13
ImageNet dataset to learn new target datasets
2.7 Snapshots of the yoga self-coaching system 14
2.8 Illustrates the block diagram of various components 17
used in Automatic Gym mat
2.9 Real time Yoga activity with assistance 19
2.10 Balance Sensory and motor feedback mat 20
2.11 Physical Specification of Raspberry Pi 4 23
2.12 Raspberry Pi 4 Model B 24
2.13 Force Sensitive Resistor 26
2.14 Layers of the Force Sensitive Resistor 27
2.15 Graph of Resistance by Force 28
2.16 Analog to Digital Converter designed for Raspberry Pi 29
2.17 Block diagram of Analog to Digital Converter 30
2.18 Process of Analog to Digital conversion 33
2.19 Sampling Rate of Analog to Digital Converter 34
2.20 Buzzer 36
xi

2.21 Arduino Pro mini Pin out 39


3.1 Project Flow 47
3.2 Block Diagram of the project 48
3.3 Project Process Flow 50
3.4 Application Flow 51
3.5 The sensor connection accordingly on the yoga mat 52
3.6 Arduino Pro Mini used in the project 54
3.7 3.5 inch touch screen used in thi project 55
3.8 Buzzer used in this project 56
3.9 Measurement of the yoga mat used for this project 57
3.10 Schematic Diagram 58
3.11 Coding to interface TFT touch screen with Raspberry 59
PI.
3.12 Coding for the Buzzer in the project 61
3.13 The Force Sensitive Resistor sensor connected 61
accordingly on the yoga mat
3.14 Coding for Sensor 62
3.15 The icon of the Application 63
4.1 Sensor Connection 64
4.2 Overall Circuit connection 66
4.3 Direct connection of Arduino Pro Mini to Raspberry Pi 67
4.4 Sensor connected on the yoga mat 67
4.5 A. Testing Sensor 2, B. Testing Sensor 1, C. Testing 68
Sensor 3, D. Testing Sensor 4, E. Testing Sensor 5,
and F. Testing Multiple Sensor 1,2,4 and 5.
4.6 TFT touch screen connected with Raspberry Pi 69
4.7 Homepage for the application 70
4.8 Login Page 70
4.9 Sign Up Page 71
4.10 Type of Asana 71
4.11 Read Sensor 72
4.12 Result 73
xii

LIST OF SYMBOLS AND ABBREVIATIONS

FSR Force Sensitive Resistor


ADC Analog Digital Converter
xiii

LIST OF APPENDICES

APPENDIX TITLE PAGE

A Programming for Arduino Pro Mini 79


B PHYTON Coding 82
C Circuit Connections in Proteus 87
CHAPTER 1

INTRODUCTION

1.1 Project Background

A day with 24 hours is not enough for many of us because of the workload and
busy schedule we are having in our daily life. As we commit ourselves to work and
the deadline we have on the work keeps us busy all day. The time that we spent on
ourselves is getting lesser and lesser day by day. Most importantly, to keep us going
with our busy schedule on daily basis is our health, mentally and physically. As some
of us are busy with work and other things, we focus less on our health. It is still
possible to focus on our goals and achievements while maintaining good health.
There are many ways to maintain our body health, both physically and mentally. As
an example schedule our timetable with daily work, consuming healthy food, self-
discipline, and many more. Nonetheless, to maintain good body health we need to
keep up on our exercise and stretching for a better performance to reach our goal and
keep up good energy in our body and mental as well.

The easiest and more efficient way to keep good mental health and body health
is by performing yoga which was advised by our ancients. Yoga is body and mind
practice, with various styles such as breathing techniques, physical posture, and
meditation. To perform yoga, more practice and many disciplines within the practice
are needed. The benefit of yoga is endurance, calmness, strength, flexibility,
concentration, and well-being. By performing the right yoga, able to build muscle
together with strength, enhance our body flexibility, promote better breathing to keep
up the mind always awake, supports the health of the heart, help in the treatment of
addictions, improve the quality of sleeping time, reduce stress and reduce chronic
2

pains as well. To gain all these benefits, should perform the right yoga. As in our
busy schedules, not every one of us can make time to attend classes and hit the gym.

This project is designed to maintain our body and mental health on good terms
with the right guidance. The project is implemented in Raspberry Pi and attached
with a yoga mat to guide the correct yoga postures. This project guides the user on
yoga and also keeps track of the body health on daily basis on the mobile phone.

1.2 Problem Statement

In the modern era,the interaction between humans and physical devices in the
real world is gaining more attention and requires a natural and intuitive methodology
to employ. According to this idea, living well has been a growing demand. Moreover,
spending time on ourselves is getting less day by day as the daily workload with
deadlines is occupied in our daily routine. In this busy period, keeping some time to
spend on our body's health is very important, and not most of us can attend classes to
maintain body health, go to the gym, or do other activities. In this recent pandemic
period, we have not been able to spend time outside either. Sometimes it’s not easy
when we learn without a proper guide, and there will be many obstacles we have to
overcome during that learning period. Some of us refer to YouTube videos and ask
for help from others. Nonetheless, these traditional ways sometimes do not provide
the right benefit or it’s hard to understand when trying to figure it out on your own.
Moreover, not every one of us knows the right way of getting the correct exercises,
and sometimes advice or misguided will lead to some other problems. Therefore, an
E-Health Yoga Mat is proposed to safe more time of the user by performing yoga on
the mat to keep mind, breathing and mental health in good terms. This E-Health
Yoga Mat can guide the user to perform yoga postures on the mat itself using an
application which is android access also.

In addition, the yoga mat have sensors that is more efficient to detect the users
pressure and send signal to Arduino Pro mini to convert signal to digital and finally
send data to display and buzzer. Having a home assistance device that is able to
3

guide you to keep up good health, both mentally and physically, will be very
beneficial and efficient. As such, the device will save time and help you learn on
your own with the proper guide. The E-Health Yoga Mat has features to guide the
correct yoga postures on the yoga mat. Then, it is also able to detect any wrong
movements and send an alert to the user to re-correct the posture. The data will be
collected in our phone application to keep track of our exercises. It also has the
feature of reading the user’s body weight and keeping data as well. This device
makes our time more efficient and guides us to a healthy lifestyle both physically and
mentally to achieve our goals and achievements.

1.3 Hypothesis

As we are more busy in this modern world with our work and goals, we tend to
forget or not enough time to take care on our body. If planned to go for gym, outdoor
activities and classes to maintain body health, we need separate time for it. When
there is not much time for us to focus on our health, having a guide at home will be
more way easier and saves up more time. In this research, an E-health Yoga Mat
using Raspberry Pi is developed that help to guide us at home to keep fit and keep
track on our body health. E-Health Yoga Mat using Raspberry Pi is the perfect home
guide system to maintain our body health and mental health as well. If there is a
home guide system, there is no need to keep separate time to go for outdoor activities
or gym. Moreover, having this home guide system, saves more time and help us to
keep fit physically and mentally at the same time. The outcome of this project will be
maintaining the user’s good health, alert the user when they perform the wrong
posture, keep track of our body health with phone application as well.

1.4 Aim

To investigate the development of E-Health Yoga Mat using Raspberry Pi.


4

1.5 Objective

The objectives of this project are:


i) To develop an E-Health Yoga Mat using Raspberry Pi 4
ii) To integrate a project with yoga mat which assist and guide the user on
the yoga postures using Force Sensitive Resistor sensors.
iii) To evaluate the performance of yoga mat in terms of yoga posture.

1.6 Scope of the Study

This project can be divided into 3 phases which are:

Phase 1: Hardware Development

In this project, Raspberry Pi 4 Model B will be used to create a yoga posture


guiding system. E-Health Yoga Mat using Raspberry Pi application is developed
using Raspberry Pi 4 microcontroller. Force Sensitive Resistor sensor is the main
input from the physical pressure and weight given by the user on the yoga mat. Force
Sensitive Resistor sensor will be used to detect the pressure given by the user’s body
to receive analog data and will process to Raspberry Pi with the help of Analog
Digital Converter, to send data to Raspberry Pi in digital form. Analog to Digital
converter is used to convert analog data from Force Sensitive Resistor sensor to the
Raspberry pi microcontroller. The Raspberry PI will be connected with a 3.5 inch
TFT touch screen to display the GUI of the yoga posture. A buzzer is connected with
Raspberry Pi 4, to alert the user if there is any wrong posture detected on the mat.
5

Phase 2: Software Development using Arduino

Computational algorithms are written in Phyton for Raspberry Pi programming.


Force Sensitive Resistor sensors will be interfaced with the Phyton to develop the
project. The coding applied works together with Analog Digital Converter to change
the analog form of input from the Force Sensitive Resistor to digital form data in
Raspberry Pi 4. While the digital data will be shown on the Raspberry touch screen
and produce an output with a buzzer as well. The coding is applied when the right
posture on the mat by user will continue with the performance while a wrong posture
will give alert from buzzer with the help from the sensors on the mat. Application is
developed to receive data and store data from Raspberry Pi. From this application it
is able for the user to access the Raspberry Pi from the phone. Then, this application
able to store data of the yoga postures or other exercises performed for future
purpose and also will track on the weight of the user for reference purpose.

Phase 3: Evaluation of Developed System

Selected yoga postures will be uploaded in the Raspberry Pi interface with the
Phyton. The Force Sensitive Resistors will be attached on the yoga mat at five main
points. Few user’s will be tested on the yoga mat, to perform the yoga posture to
prove the outcome. Moreover, the user will be also tested with wrong moves on the
yoga mat, to check the alert system added in the project as a result the buzzer will
“beep” for the wrong posture on the yoga mat. As a result, The user is able to learn
the yoga posture while following the guidance shown on the TFT touch screen and
able to access the raspberry directly with touch and indirectly from the application
developed to access the microcontroller and also to store data.

1.7 Research Contribution

The research on the E-Health Yoga Mat using Raspberry Pi, enable to provide a
guiding system for the user, In addition to that, it provides an alert system to the user
6

to make right the yoga posture as a learning process cause any wrong moves or
postures will give physical health issue. It also saves the data from the user of the
learning processes and also keep track on body fitness with the help of application in
the phone.

1.8 Outline of the Project

Chapter 1 gives the overview of the project for the microcontroller, Raspberry
Pi 4 Model B. Besides that, problem statement, objective of this project, scope of this
project and project outline will be presented in this chapter. From this chapter, the
scope target of build this device is become clearer. With the aim of this project, it
become a reason of this project should be developed.

Chapter 2 gives a literature review for this project. The literature review gives
guidelines in order to complete this project. With the various idea and method from
each source, the project becomes glorified. It also became a case study for this
project to overcome with the new idea and different design compared to the previous
project.

Chapter 3 describes the methodology of this project. First the block diagram of
overview circuit will discuss clarify and correct connection between inputs and
outputs. The process of operation and flow of source code will be shown in a
different flowchart. Other than that, each function and characteristics of electronic
such as Raspberry Pi 4 microcontroller, Force Sensitive Resistor sensor, TFT touch
screen, and Analog to Digital Converter.

Chapter 4 shows the results produced from this project. The result from the real
time will be considered as the desired output of this project. The result includes
successful operation of the Force Sensitive Resistor send data with the pressure given
7

by the user to the microcontroller Raspberry Pi, alert the user when there is wrong
pressure point with a buzzer and store data in application.

Chapter 5 which is the last chapter describes about the conclusion of this
project. The summarized results obtained will be concluded.
8

CHAPTER 2

LITERATURE REVIEW

2.1 REVIEW OF RELATED PROJECT

In this chapter. I have gathered the summarized information of relevant


research to develop the E-Health Yoga Mat using Raspberry Pi. It is one of the
inferred sources taken from the original experimental work such as journal, article,
conference paper, or thesis that is related to this project. Such sources will help to
identify problems in this project as well as provide suggestions for research and
decision making. So, the project and thesis that related to this project will be
discussed in this chapter.

2.1.1 Case Study 1: Smart-Mat: Recognizing And Counting Gym Exercises


With Low-Cost Resistive Pressure Sensing Matrix.

A common and well-researched application of iot technology is motivating


individuals to exercise and assisting them in tracking their personal progress. The
bulk of systems produced to date (including many commercial products) are
designed to track aerobic training such as running and cycling. The majority of such
activities are defined by speed, distance, and topography, all of which may be
9

accurately tracked with a single discreet on-body motion sensor and a GPS receiver,
such as one found in a smart phone.

Figure 2.1: Frame before and after preprocessing [1]

In the domain of strength and muscular endurance training, there is much less
development, particularly in terms of widely useable unobtrusive devices.This type
of training improves bone strength and muscle fitness while also lowering the chance
of injury . There are two sorts of strength-training exercises. The first is based on
specialised fitness equipment commonly found in gyms. The second consists of
workouts that may be done anywhere, such as push-ups, crunches, and free weight
lifting. We will concentrate on the latter in this study. Because the exercises are
generally defined by complicated motion patterns involving several body parts, more
elaborate sensor systems are required than a single body-mounted motion sensor.
10

Figure 2.2: Exercises performed in the experiment: I. push-up, II. quadruped, III.
abdominal crunch, IV. chest press with dumbbell, V. bridge. The pictures on the
right are typical frames corresponding to the exercise.

The observation that many strength-related workouts entail contact between


distinct body parts and the ground inspired this paper. A distinct spatiotemporal
contact and pressure pattern can be recognized for each workout. To track workouts
like push-ups, stomach crunches, and squats, propose using a resistive, textile
pressure sensor matrix. This type of matrix can be simply integrated into
conventional gym mats that are commonly utilized in this situation. This means that
11

the monitoring may be done without the use of any additional sensors by just
switching from a regular gym mat to a smart gym mat[1].

Figure 2.3: Detection rate of exercise counting for each subject and activity using
different templates [1].

2.1.2 Case Study 2: Interactive Exercise Mat

A summary of this information is provided below to provide a basic grasp of


some features. This summary is not intended to highlight crucial or critical elements
or to specify any embodiment or claim restrictions. Furthermore, this Summary may
provide a simplified overview of some components of this disclosure that are
addressed in greater detail in other sections. The devices, systems, and techniques of
usage for interactive exercise mats are exhibited and described. An workout mat may
comprise electrical hardware, sensors, and a wired or wireless connection in one
embodiment. Exercise mechanics and training routines are optimized using a
software tool.The mat could be a pressure detecting yoga mat that connects to a
Smartphone, tablet, computer, or other device via Bluetooth or another wired or
wireless communication protocol. As it applies pressure to the yoga mat, the mat
may aid a user in practising yoga and other exercises by providing real-time data on
weight distribution and body position. This information might be analyzed and
compared to an optimum posture for each yoga pose, with the user receiving
feedback to rectify or affirm proper weight distribution and position.
12

Figure 2.4: Application display on the Raspberry Pi [2]

A processor that reads and analyses data about the user's weight distribution
and posture may be operationally connected to the yoga mat. This information could
be transferred to a second processor that has more information about the user. The
second processor can then compare the user's ideal weight and position data and
provide them feedback.
13

Figure 2.5: Circuit Connection Flow Chart [2]

The mat could eliminate the need for a private instructor by providing
dynamic real-time training tailored to a user's body type and practise via powerful in-
mat sensors that connect to an app on a computer, such as a smartphone or tablet.
The mobile component may provide real-time feedback and modifications to users,
allowing them to practise and achieve a more optimal stance. Users can utilise the
mat and mobile component to track and measure progress, as well as communicate
with top yoga instructors at home on their own time[2].

2.1.3 Case Study 3: Development Of A Yoga Posture Coaching System Using


An Interactive Display Based On Transfer Learning.

The yoga self-coaching system has been totally created in Python, with a
Python interface based on the Tkinter library, according to this review paper. The Tk
graphical user interface (GUI) toolkit's standard Python interface is Tkinter. Based
on the TL-MobileNet-DA model integrated in the Jetson Nano kit, the user interface
of the yoga self-coaching system captures the user's posture from a USB camera at
the top of the mirror panel and then recognises the yoga stance. To follow the yoga
practise, a user can select one of the 14 various yoga postures studied in this
study.The guidance yoga graphic appears on the system interface after a user
confirms their chosen pose for evaluation. To achieve posture recognition, the user
can then verify for the correct posture by watching the guiding image, which is
displayed in real-time.
14

Figure 2.6: Transfer learning process from pre-trained on ImageNet dataset to learn
new target datasets [2]

When the user achieves the correct stance, the resulting recognised posture
will pop up with a success message of "Correct:)" and a fail message of "Incorrect:("
when the user does not accomplish the correct posture. The identified yoga label
from our system appears underneath the performance checking results.

Figure 2.7: Snapshots of the yoga self-coaching system [2]


15

Furthermore, based on the angle of each joint, determined from keypoints


collected when a user executes the erroneous yoga posture, the system would deliver
instructional feedback to a user, enabling them to perform the posture correctly[3].

2.1.4 Case Study 4: Prediction Of Body Weight Of A Person Lying On A


Smart Mat In Nonrestraint And Unconsciousness Conditions.

In this study, present a prototype system that uses non-restraint and


unconsciousness to estimate the body weight of a person lying on a smart mat. It has
a total of 128 FSR-406 sensors in a 16 x 8 grid configuration. The basic model for
predicting the body weight of a person resting on it was initially constructed as a
single feature utilizing the cumulative total of pressures sensed by them.Presented
three additional approaches to increase the performance of this basic strategy. The
five body components determined by the body discrimination algorithm are used as
features in the segmentation procedure. The average cumulative sum approach
reduces the inherent inaccuracy of a single sample by using the mean cumulative
sum of three samples. Each of the 128 sensors is treated as a separate feature in the
serialisation process. Four different machine-learning models were used to
accomplish all four recommended techniques, including the basic method.

They compared the performance of all 16 implementation models using MAE


and RMSE as performance measures. They have chose the serialisation approach
with the DNN model as the best model based on the experimental findings. Due to
the huge horizontal and vertical separation between neighbour sensors in the smart
mat, there were many dead zones where pressure was not being detected, resulting in
more than 75% of all sensors having a sensing value of zero. This is due to the
serialisation method's benefit over employing the cumulative total as a single feature,
which employs valid sensing values as distinct features. Another reason is that more
than 96 of the 128 sensors, or 75%, have a sensing value of zero, indicating the
possibility of a dropout effect. However, due to the tiny number of sensors having a
non-zero sensing value, a recognition mistake occurred, causing two samples with
differing body weights to be categorised as the same. As a result, there was one
outlier case, which raised the estimated error. Because the sub array of FSR sensors
responsible for sensing lower-body pressures has no substantial effect on weight
16

prediction, it may be reasonable to examine how to forecast weight using only the
upper-body sub array.

Complete sensor arrays, on the other hand, are required. This is due to the fact
that the FSR sensors must be arranged in a grid in order to measure weight regardless
of lying direction. To establish the patient's lying posture, it is important to assess the
location of the hands and feet. The MAE rose by discarding the measured values of
the lowest 1/3 of the FSR sensors while forecasting body weight, according to the
results of the temporal experiment. Even though 1/3 of the FSR sensors do not
accurately measure the values, it is tough to dismiss them totally.The proposed
method is marginally less accurate than the RGB-D sensor-based method in terms of
prediction accuracy. This is due to the fact that RGB-D sensors have the added
benefit of capturing image skeletal and depth information. Nonetheless, the method
suggested in this research has the advantage of being able to estimate human weight
without having any negative effects on the environment. If the sensors are tightly
packed to reduce dead spaces or the dataset size is raised, it is expected that better
prediction results would be obtained[4].

2.1.5 Case Study 5: Fitness Mat Dev Kit

In this review paper, the platform was built from the ground up using Sensing
Tex's patented pressure pattern measurement technology. It enables the user to
quantify pressure from a variety of perspectives, including Movement Analysis and
Postural Detection. The product can be used for a wide range of applications. It can
be used in a variety of sports and wellness applications. Our goal is to deliver real-
time data to the customer so that the exercises in each application can be improved.
The Fitness Mat works with any smart device, including smartphones and tablets. On
your preferred device, you should be able to see your workout in real time. You can
tell when you're doing something correctly or incorrectly by keeping track of your
behaviours. The Mat can determine which exercise is the best for the correlation of
the position based on the recorded data in the event that the exercise is not in use[5].
17

2.1.6 Case Study 6: A Research Paper On New Generation Gym Mat


As previously stated, gym mats are constructed mats that are used to keep
hands and feet from becoming slippery during asana practise. Gym mats can be used
as gym mats as well. Unlike other gym mats on the market that do not have a speech
recognition system and must be folded manually, the folding and unfolding of this
gym mat is controlled by the user's voice, and the user does not need to perform any
manual operations for unfolding and folding. It is this Gym mat's key benefit over
other Gym mats. These mats are used because they provide a number of benefits to
users, including reducing muscle fatigue and soreness, enhancing ligament and joint
health, and alleviating general mental sickness. Researchers built an automated Gym
mat with temperature, weight, pressure, and movement sensors, as well as a roller
with a DC motor, vibrator, voice system, AI camera, display screen, and AI-based
controller.

Figure 2.8: Illustrates the block diagram of various components used in Automatic
Gym mat [6]

All of the components work together to make this mat automatic. This mat
also recommends exercises based on the age of the user. This mat may be adjusted to
the user's size and height thanks to the iris mechanism. Because it can save users
time and be further modified utilising new technologies and procedures, this mat has
a bright future[6].
18

2.1.7 Case Study 7: Social Yoga Mats: Designing For Exercising Or Socializing
Synergy

In this paper, introduced Social Yoga Mat design, which opens up a world of
possibilities for technology aimed at strengthening and extending the exercising or
socializing synergy. Through a discussion of design insights gathered during the
journey, gave an early articulation of this design space. Other interaction-design
researchers working in contexts where the exercising or socializing synergy is at
work including designs that incorporate other sorts of exercise and designs meant for
non-seniors might find the insights and example offered here useful. The viewpoint
of embodied interaction proved to be quite useful, leading to a design that gives a
tactile interface that allows users to interact and generate social meaning through
their physical activities. The current findings are based on user engagement sessions
that lasted only a few minutes. Moreover, to investigate the effects of long-term daily
interaction with prototypes in the future. They also like to try out more accurate
activity monitors, which would allow for better feedback and evaluation of yoga
workouts while also allowing for new forms of social interaction. Within the design
area we've been investigating, Social Yoga Mats are only one possible option. They
intend to develop more examples in the future to further define and grow this
space[7].

2.1.8 Case Study 8: Real-Time Yoga Activity With Assistance Of Embedded


Based Smart Yoga Mat

In this paper, there is a proposed embedded based smart yoga mat and
experimental setup as well. The proposed smart yoga mat is integrated with hardware
and software design approach represented in figure below.As shown on the circuit
diagram, FSR sensor is driven to control unit and the control unit is integrated with
sensor module, pattern generation, database module and comparator module. A voice
module is connected to the control unit as an output for this device. FSR sensor is
used to evaluate pressure of the user on the mat. An array of pressure is connected to
integrate the ESYM and sensor information data is stored in pressure sensor data
modules. In this project, embedded device myRIO is used as a control unit to
perform the ESYM and the method is developed by using virtual instrumentation. In
19

this ESYM, physical pressure modes are transferred into pattern generation wit FSR
sensory data. The ESYM algorithm is executed on myRIO using LabVIEW, the
FPGA technology intervention consume less power and computation time. This also
provides more area for executing more posture function in the mat[8].

Figure 2.9: Real time Yoga activity with assistance [8]

2.1.9 Case Study 9: Balance Sensory And Motor Feedback Mat

In this system, have combined sensory input to enhance the patients balance
and stepping. This system includes with a mat that able to detect multiple target of
step on it. This mat is contacted by the patients and the output will be from the
audible signal. This system helps to analyze the gait and balance by the healthcare
professionals or patients. This invention is generally an exercise equipment which
provides sensory and motor feedback to improve balancing and stepping[9].
20

Figure 2.10: Balance Sensory and motor feedback mat [9]

2.1.10 Case Study 10: Hiit Pi Makes Raspberry Pi Your Home Workout
Buddy

In this task, they use HII Pi which is a web application that utilizations AI on
Raspberry Pi which help to follow the exercise progressively. When utilizing the
application, clients can interface with the application through any internet browser
running on same neighbourhood network as Raspberry Pi, be that on PC or
differentgadgets. The primary capacity of this HIIT Pi is utilizes PC vision to
consequently catch and track recognized stances and development and scores them as
indicated by a bunch of rules and guidelines. Thus, this application functions as an
advanced exercise coach in the room checking the developments and help to
accomplish wellness objectives. This gadget work as the Raspberry Pi camera
module streams crude picture information from the sensor generally at 30 edges each
second. There will be a custom recording stream overseer that works off this posture
assessment model and takes outlines from video transfer, letting out present certainty
scored utilizing adjustment central issue position facilitates[10].
21

Summary

From the literature review, could understand that there are many option of
control unit, sensors, display and other components. Moreover, its very important to
choose the right components so that can reach the aim and objective of the project.
As for a comparison, Raspberry Pi function is more compare to Arduino, as for
Arduino need node mcu for internet connection but Raspberry Pi does not require
any additional device for connections. As for the sensors, Force Sensitive Resistor
are more capable for this project as it able to read the weight or pressure on the yoga
mat and provide analog signal towards Raspberry Pi. Comparing to load cell sensor,
Force Sensitive Resistor sensor gets direct contact to get input as well.

From the case study, there are many type circuits, components, ideas,
initiations, applications, and many more found from the review papers. As from there,
found that Raspberry Pi 4 is a very interesting processor which able to provide more
function from other control unit. Other than that, the idea on building the project is
based on the control unit, with yoga mat. As this will be an easy carry project and
able to use by most of the people.

2.2 HARDWARE RESEARCH

This part will describe the description and important of each component and
electronic device that need to be considering in building this project. The component
list for each device is listed down in the Table 2.1

Table 2.1: List of components

DEVICE COMPONENT
MICROCONTROLLER RASPBERRY PI 4
MODEL B
22

INPUT 1. FORCE SENSITIVE


RESISTOR
2. ANALOG DIGITAL
CONVERTER
OUTPUT 1. TFT TOUCH SCREEN
2. BUZZER
SERIAL APPLICATION
COMMUNICATION

2.2.1 MICROCONTROLLER

The microcontroller used in this project is Raspberry Pi 4. The latest version


of the low-cost Raspberry Pi computer is the Raspberry Pi 4 Model B. Raspberry Pi
4 is not a normal device as it’s just a credit card sized circuit board similar to those
found inside a PC or laptop, but much smaller. The Raspberry Pi 4 Model B is the
newest edition to the famous Raspberry Pi computer line, and it delivers a significant
boost in CPU speed, rich multimedia capabilities, memory, and connection over its
predecessor, the Raspberry Pi 3 Model B+. The Raspberry Pi 4 Model B features a
1.5GHz quad-core 64-bit processor, dual-display support at resolutions up to 4K at
60 frames per second, up to 8GB of RAM, dual-band 2.4/5.0 GHz wireless LAN,
Bluetooth 5.0/BLE, True Gigabit Ethernet, USB 3.0, and PoE functionality. The
difference between the latest version Raspberry Pi 4 Model B and the previous
version of Raspberry Pi 3 B+ is shown below in the Table 2.2

Table 2.2: Comparison between Raspberry Pi 3 B+ and Raspberry Pi 4

SPEC RASPBERRY PI 3 B+ RASPBERRY PI 4 B


CPU 1.4GHz, Quad-Core 1.5 GHz, Quad-Core
Broadcom BCM2837 Broadcom BCM2711
(Cortex A-53) (Cortex A-72)
GPU 400 MHz VideoCore IV 500 MHz VideoCore VI
RAM 1GB DDR2 Selectable 1-4GB DDR4
23

HDMI PORTS Single HDMI port Dual Micro HDMI ports


MAX RESOLUTION 2560 x 1600 4K 60 Hz + 1080p
or
2x 4K 30 Hz
WIRED 4x USB 2.0 Gigabit Ethernet
NETWORKING
USB PORTS 330 Mbps Ethernet 2x USB 3.0 / 2x USB 2.0
WIRELESS 802.11ac (2.4 / 5 GHz), 802.11 ac (2.4 / 5 GHz),
Bluetooth 4.1 Bluetooth 5.0
CHARGING PORT Micro USB USB Type-C
POWER 2.5A, 5V 3A, 5V
REQUIREMENT
DIMENSIONS (SIZE) 3.2 x 2.2 x 0.76 inches (82 3.5 x 2.3 x 0.76 inches (88
x 56 x 19.5mm) x 58 x 19.5mm)
WEIGHT 50 grams (0.11 pounds) 45 grams (0.1 pounds)

As previously mentioned, Raspberry Pi 4 is a small device as a sized of credit


card. Nonetheless, the function of the device is many. The physical specification of
the Raspberry Pi 4 is shown below in Figure 2.11

Figure 2.11: Physical Specification of Raspberry Pi 4


24

The model of Raspberry Pi 4 Model B is shown below in Figure 2.12

Figure 2.12: Raspberry Pi 4 Model B

Warnings not to do while handling Raspberry Pi 4

Raspberry Pi 4 should only be connected by a 5V/3A DC external power


supply at a minimum. Any external power supply used with the Raspberry Pi 4
Model B must meet all applicable requirements and standards in the country where it
will be used. It should be used in a well-ventilated area and should not be covered if
utilised inside a case. When in use, this product should be put on a sturdy, flat, non-
conductive surface away from conducting things. All peripherals used with this
product should comply with relevant standards for the country of use and be marked
accordingly to ensure that safety and performance requirements are met. Connecting
incompatible devices to the GPIO connection may affect compliance, cause damage
to the unit, and void the warranty. When used with the Raspberry Pi, these articles
include, but are not limited to, keyboards, displays, and mouse.

Safety Feature

Raspberry Pi 4 should not expose to water, damp, or place it on a conductive


surface while it is in operation to avoid malfunction or damage. Moreover, expose it
to any form of heat it is meant to operate reliably at typical room temperatures. Use
25

caution when handling the printed circuit board and connectors to avoid mechanical
or electrical damage. To reduce the danger of electrostatic discharge damage, avoid
handling the printed circuit board while it is powered and only handle it by the edges.

Advantages And Disadvantages

This microcomputer can be used by small businesses on a tight budget to use


their product or build new technology that is embedded in the product. Minor
company owners can utilise the Raspberry Pi to automate any tiny operation, such as
running a website or using it as a small database and video server. Because the
product is focused at teaching programming to the younger generation, it does not
require substantial programming experience. Python, the programming language that
Pi employs, is less complicated than other programming languages. It has a greater
readability of the code and allows the user to type concepts in less lines.

Python also has a memory management system built in.The product allows for
a lot of experimentation and transformation into something completely different. The
SD cards on the board can be readily swapped, allowing you to change the device's
capabilities without having to spend a lot of time reinstalling software. The
Raspberry Pi is ideal for adaptive technology since it can show visuals or play films
in high-definition resolution, which is ideal for prototyping embedded systems. This
tool allows you to create complicated and effective structures at a lower cost.The
product is effective, and it offers small businesses an ethical alternative. Unlike large
servers that require a lot of energy and extensive cooling systems, this little card-
sized product is easy to recycle and does not emit as much carbon dioxide into the
environment. It is not a computer replacement, and the processor is not as fast.
Downloading and installing software takes time, therefore you won't be able to do
any intricate multitasking. Other operating systems, such as Windows, are
incompatible.

This is for those who want a gadget that they can customise to their own
requirements and preferences, rather than for those who just want a job done quickly.
If the extra work is worth it, business owners should think about it. This product will
not be beneficial for larger businesses that already have large servers, which can
26

perform all of the tasks that the Raspberry Pi can. As a result, it would not be worth
it, and putting everything together would take time. The advantage and dis-advantage
of using Raspberry Pi 4 as a maincontroller is shown on the Table 2.3, below.

TABLE 2.3: Advantage and Disadvantage of using Raspberry Pi 4


ADVANTAGES DIS-ADVANTAGES
With all-around enhancements, you'll get Problems with Heat (Covered in the later
better overall performance. section)
Dual 4K monitors are now supported, as The USB-C port is only utilised for
well as speedier USB ports (USB 3.0) charging.
CPU with faster processing speed and Compatibility with earlier Raspberry Pi
additional onboard RAM options enclosures is limited.
Usage of USB Type-C for electricity is not be beneficial for larger businesses
simple and convenient. that already have large servers

2.2.2 FORCE SENSITIVE RESISTOR

Sensors that detect physical pressure, squeezing, and weight are known as
Force Sensitive Resistor. They are easy to use and inexpensive. An Force Sensitive
Resistor, namely the Interlink 402 variant, is shown in the Figure 2.13. The sensitive
bit is the 1/2" diameter round portion.

Figure 2.13: Force Sensitive Resistor


27

A spacer separates the two layers of the Force Sensitive Resistor. The more
one presses, the more of those Active Element dots come into contact with the
semiconductor, lowering the resistance. The Figure 2.14 shows the layers of the
sensor.

Figure 2.13: Layers of the Force Sensitive Resistor

Force Sensitive Resistor are essentially resistors that change their resistance
value (in ohms) based on how hard they are pressed. These sensors are inexpensive
and simple to use, but they are rarely precise. They also differ by about 10% from
one sensor to the next. So, when using Force Sensitive Resistor, you should only
anticipate to receive response ranges. While Force Sensitive Resistor can detect
weight, they're not the best option for determining how many pounds are on them.
The basic stat of the Force Sensitive Resistor sensor is shown below in Table 2.4
28

Table 2.14: Basic Stat of Force Sensitive Resistor sensor

SIZE 1/2" (12.5mm) diameter active area


by 0.02" thick
RESISTANCE RANGE Infinite/open circuit (no pressure),
100KΩ (light pressure) to 200Ω
(max. pressure)

FORCE RANGE 0 to 20 lb. (0 to 100 Newtons)


applied evenly over the 0.125 sq in
surface area

POWER SUPPLY Uses less than 1mA of current


(depends on any pullup/down
resistors used and supply voltage)

HOW TO MEASURE THE FORCE OR PRESSURE APPLIED ON FORCE


SENSITIVE RESISTOR

As greater pressure is applied, the Force Sensitive Resistor sensor's resistance


changes. The sensor seems to be an infinite resistor (open circuit) while there is no
pressure, but as the pressure builds, the resistance decreases. This graph depicts the
sensor's approximate resistance at various force measurements. The graph below
shows the range of resistance according to the pressure applied in Figure 2.5

Figure 2.15: Graph of Resistance by Force


29

As show in Figure 2.5 above, the more the pressure or force given, the lesser
the resistance in the Force Sensitive Resistor sensor. It's crucial to note that the graph
isn't truly linear and that it quickly moves from infinite to 100K at really low force
readings.

2.2.3 ANALOG TO DIGITAL CONVERTER

Almost all ambient observable parameters, such as temperature, sound,


pressure, and light, are analogue. Consider a temperature monitoring system in which
digital computers and processors are unable to acquire, analyse, and interpret
temperature data from sensors. As a result, in order to interface with digital
processors such as microcontrollers and microprocessors, this system requires an
intermediate device to transform analogue temperature data into digital data. The
Analog to Digital Converter (ADC) is an electrical integrated circuit that converts
analogue signals, such as voltages, to digital or binary form, which consists of 1s and
0s. Most Analog to Digital Converter accept voltage inputs ranging from 0 to 10
volts, -5 volts to +5 volts, and create digital output in the form of a binary integer.

Figure 2.6, below shows the Analog to Digital converter designed to work
with Raspberry Pi. Two Microchip MCP3424 A/D converters, each with four
analogue inputs, make up the ADC Pi. The MCP3424 is a low-noise differential
input delta-sigma A/D converter.

Figure 2.16: Analog to Digital Converter designed for Raspberry Pi


30

An Analog to Digital Converter, is a device that converts an analogue signal


to a digital signal. This converter is a type of integrated circuit (IC) that converts a
continuous signal into a discrete signal. A/D, ADC, and A to D are all terms that can
be used to describe this converter. The ADC is the inverse of the DAC function. The
symbol for an analogue to digital converter is displayed below.

There are various methods for converting an analogue signal to a digital signal.
The ADC08xx series is one of many varieties of ADC chips available on the market
from various vendors. As a result, discrete components can be used to create a simple
Analog to Digital Converter. The high data collection rate of an Analog to Digital
Converter, even with multiplexed inputs, is one of its main advantages. Data
acquisition from diverse sensors has grown more accurate and faster because to the
advent of a range of Analog to Digital Converter integrated circuits (ICs). Improved
measurement repeatability, low power consumption, precise throughput, high
linearity, and outstanding Signal-to-Noise Ratio (SNR) are among the dynamic
properties of high-performance Analog to Digital Converter.

Measurement and control systems, industrial instruments, communication


systems, and all other sensory-based systems are examples of Analog to Digital
Converter applications. Performance, bit rates, power, cost, and other variables are
used to classify Analog to Digital Converter. The sample rate and bit resolution are
the two most important characteristics of an ADC. The sample rate of an ADC refers
to how quickly it can convert an analogue signal to a digital signal. Bit resolution
refers to how well an analogue to digital converter can convert an analogue signal to
a digital signal. The Figure 2.7 shows the block diagram of Analog to Digital
Converter.

Figure 2.17: Block diagram of Analog to Digital Converter


31

The analogue signal is first applied to the first block, a sample, which can be
sampled at a precise sampling frequency. The sample's amplitude value, like an
analogue value, can be kept and held in the second block, called Hold. The third
block, quantize, can be used to convert the hold sample into a discrete value. Finally,
the encoder transforms the discrete amplitude into a binary number.

SAMPLE

The analogue signal can be sampled at a precise interval of time in the sample
block. Although the samples are employed in continuous amplitude and have a real
value, they are discrete in time. The sample frequency is very important while
converting the signal. As a result, it can be kept at a precise rate. The sample rate can
be set based on the system requirements.

HOLD

HOLD is the second block in an Analog to Digital Converter, and it serves no


purpose other than to hold the sample amplitude until the next sample is collected.
As a result, the hold value does not change until the following sample.

QUANTIZE

This is the third block of an Analog to Digital Converter, and it is primarily


used for quantization. The main purpose of this is to convert continuous (analogue)
amplitude to discrete amplitude. Within the hold block, the value of continuous
amplitude changes throughout the quantize block, becoming discrete in amplitude.
Because it comprises discrete amplitude as well as time, the signal will now be in
digital form.
32

ENCODER

An encoder transfers the signal from digital to binary form, which is the final
block in an Analog to Digital Converter. We know that binary signals are used in
digital devices. As a result, an encoder is necessary to convert the signal from digital
to binary. So that's how you use an Analog to Digital Converter to convert an analog
signal to a digital signal. The entire conversion can be completed in a fraction of a
second.

PROCESS OF CONVERSION

Converting analogue signals to digital signals can be done in a variety of ways.


These converters have a wider range of uses as an intermediate device for converting
analogue to digital signals and displaying output on an LCD via a microcontroller.
An A/D converter's goal is to find the output signal word that corresponds to an
analogue signal. We're now looking at an ADC of 0804. It's an 8-bit converter that
runs on a 5V source. Only one analogue signal can be fed into it.

The digital output ranges between 0 and 255. A clock is required for ADC to
function. The amount of time it takes to convert an analogue value to a digital value
is determined by the clock source. CLK IN pin no.4 can be used to connect an
external clock. To use the internal clock, a suitable RC circuit is connected between
the clock IN and clock R pins. Pin 2 is the input pin; after conversion, the data from
the internal register is sent to the output pins via a high-to-low pulse. Pin3 is the
external clock receives a low to high pulse. From MSB to LSB, pins 11 to 18 are data
pins.

On each falling or rising edge of the sample clock, the Analog to Digital
Converter samples the analogue signal. The ADC receives the analogue signal,
measures it, and transforms it to a digital value once each cycle. The Analog to
Digital Converter approximates the signal with defined precision to convert the
output data into a series of digital numbers.
33

The accuracy of the digital value that captures the original analogue signal in
Analog to Digital Converter is determined by two variables. Quantization level, also
known as bit rate, and sampling rate are two of them. The analogue to digital
conversion process is depicted in the diagram below. The resolution of digital output
is determined by the bit rate, as shown in the Figure 2.8 below, where a 3-bit ADC is
used to transform the analogue signal.

Figure 2.18: Process of Analog to Digital conversion

Assume that you need to convert a one-volt signal from digital to analogue
using a 3-bit ADC. As a result, there are a total of 23=8 divisions available for
generating 1V output. This result 1/8=0.125V is referred to as the lowest change or
quantization level, with 000 being 0V, 001 denoting 0.125, and 111 denoting 1V. We
can improve the signal precision by increasing the bit rates to 6, 8, 12, 14, 16, and so
on. As a result, bit rate or quantization produces the smallest change in the analogue
signal value as a result of a change in the digital representation.

If the input signal is sampled at a different frequency than the desired one,
there is a very good risk that it will be misrepresented on the output side. As a result,
the sampling rate is a significant factor for the ADC. As shown in the diagram, the
Nyquist theorem asserts that the acquired signal reconstruction introduces distortion
unless it is sampled at (minimum) twice the rate of the signal's greatest frequency
content. In practise, however, this rate is 5-10 times the signal's maximum frequency.
Figure 2.19: Sampling Rate of Analog to Digital Converter

2.2.4 3.5 INCH TFT TOUCH SCREEN

The 3.5-inch resistive touch screen display of this TFT LCD display is
compatible with any Raspberry Pi hardware. This 3.5" TFT display offers a
resolution of 480x320 pixels, a 16-bit colour depth, and a resistive touch option. It
fits on top of the Raspberry Pi Zero W board and is powered by the Vcc pin, the
display talks with the Pi using the SPI protocol. Additionally, the HDMI port on the
Pi can be used to connect it to another display. It's made for the Raspberry Pi Zero/Pi
2/Pi 3 Model B/B+, but it can also be used on other SPI-enabled hardware platforms.
The Figure 2.10 shows the 3.5 inch TFT touch screen display.

Figure 2.10: 3.5 inch TFT touch screen display


35

3.5 INCH TFT RPi DISPLAY PIN

The TFT RPi LCD display has 26 pins. It's used to connect the Raspberry Pi
to the LCD through SPI and to power the LCD using the Raspberry Pi's 5V and 3.3V
pins. The following Table 2.5 is a list of pin descriptions.

Table 2.5: List of Pin and description on 3.5 inch TFT touch screen

Description Pin NO. NO. Pin Description

Power input
5V 2 1 3.3V NC
(5V)

Power input
5V 4 3 SDA NC
(5V)

Power
GND 6 5 SCL NC
GND

NC TX 8 7 P7 NC

Power
NC RX 10 9 GND
GND

NC P1 12 11 P0 NC

Power
GND 14 13 P2 NC
GND

NC P4 16 15 P3 NC

NC P5 18 17 3.3V NC

TP SPI Bus
Power
GND 20 19 MI input
GND
(MOSI)

TP SPI Bus
TP Interrupt IRQ 22 21 MO output
(MISO)

TP SPI Bus
NC CE0 24 23 SCK Clock
(SCLK)
36

TP chip Power
TCS 26 25 GND
Select GND

2.2.5 BUZZER

A beeper or buzzer is an auditory signaling device that can be


electromechanical, piezoelectric, or mechanical. The main purpose of this is to
transform an audio signal to a sound signal. It is commonly used in timers, alarm
devices, printers, alarms, computers, and other equipment that are powered by DC
voltage. It may produce various sounds such as alert, music, bell, and siren according
on the varied designs.

The buzzer's pin arrangement is illustrated below. It has two pins, one positive
and one negative. The '+' symbol or a longer terminal is used to represent the positive
terminal of this. The positive terminal is represented by the '-'symbol or short
terminal and is connected to the GND terminal.

Figure 2.20: Buzzer

SPECIFICATIONS

The main specification of a buzzer are, the frequency range is 3300Hz.


Moreover, The operating temperature ranges from -20o C to 60oC. The operating
voltage ranges from 3 volt to 24 volt direct current. The sound pressure level is
85dBA or can be 10 centimetre. The power supply in the buzzer will be 15mA.
37

TYPE OF BUZZER

There are many different type of buzzer that able to use for projects and others.
The available buzzer’s are Piezoelectric, electromagnetic, mechanical,
electromechanical and magnetic. The sound frequency and some features differs in
between these buzzer’s. We have to choose the correct buzzer according to the
project.

WORKING PRINCIPLE

A buzzer's operation is based on the premise that when a voltage is applied


across a piezoelectric material, a pressure difference is created. Piezo crystals are
sandwiched between two conductors in a piezo type. Once these crystals have
established a potential discrepancy, they propel one conductor and drag the other
conductor through their internal property. As a result of this continual activity, a
sharp sound signal will be produced.

A buzzer is a useful component for incorporating sound characteristics into


our system or project. It is a very compact and solid two-pin gadget that may be used
on a breadboard or a PCB. As a result, this component is frequently used in most
applications.

Simple and premade buzzers are the most popular types of buzzers. When a
simple type is powered up, it will continuously emit a beep sound. A pre-made type
appears to be heavier and generates a Beep. Beep. Beep. The internal oscillating
circuit within it produces this sound.

A DC power supply ranging from 4V to 9V is used to power this buzzer. A


9V battery is used to power this, but a regulated +5V/+6V DC source is
recommended. In most cases, it is connected via a switching circuit to turn on/off the
buzzer at the appropriate time interval.
38

ADVANTAGE AND DISADVANTAGE

There are many advantages and also disadvantages of using buzzer. First, the
advantage of using buzzer is it’s simply compatible. Then, the buzzer’s frequency
response is good enough to provide alert system or sound for the projects. The size of
buzzer are small so that it can fit easily in mini projects as well. More importantly,
the energy consumption of the buzzer is very less and the range of voltage usage is
large. This makes the buzzer work efficiently for most of the projects. Finally, the
sound pressure is high and provides a good sound or alert in the project.

The disadvantage of buzzer is that it’s not easy to control as have to do it


through coding and the frequency applied through programming. Sometimes, it
generates the a sound that is not comfortable for the projects. It is also neccessary to
know the how to repair the condition without turning off the buzzer.

2.2.6 ARDUINO PRO MINI

The Arduino Pro Mini is a microcontroller board that uses the ATmega328
microprocessor. Six analogue inputs, 14 digital input or output pins such as reset
button, an internal 8Mhz resonator, and slots for mounting pin headers are all on the
board. To provide USB power and programme the board, a six-pin programming
header can be linked to an FTDI cable or a Spark fun breakout board. The pinout and
specifications for the Arduino Pro Mini based on the Atmega 328 are detailed in the
Figure 2.21
39

Figure 2.21: Arduino Pro mini Pin out

The ATmega328 microcontroller is an AVR 8-bit microcontroller with


excellent speed and low power consumption. It has 32 KB of flash memory for
programme code 0.5 KB for the bootloader, 2 KB of SRAM, and 1 KB of EEPROM.
This reset button sends a low-level signal to a pin on the microcontroller that is used
to reboot it. The unregulated input voltage to the regulator is referred to as RAW.
The voltage applied to this pin can range from 3.4 to 12 volts. It's the 3.3V regulated
voltage. Depending on the board's version, we can alter the voltage supplied to 5V.
On the Arduino Pro Mini board, there are three GND (Ground) pins. There are 14
digital I/O pins on the board. There are just two states that the Arduino digital pins
can read/output: when there is a voltage signal and when there is no voltage signal.
This type of input/output is commonly referred to as digital (or binary), and the states
are HIGH or 1 and LOW or 0. The pinMode (), digitalWrite (), and digitalRead ()
functions can be used to set these digital pins as inputs or outputs.
40

2.3 SOFTWARE RESEARCH

In this part, the software used to perform the application on Raspberry Pi and
others will be discussed. Computational algorithms are written in Phyton for
Raspberry Pi programming. Application is used to save data and to connect with
Raspberry Pi.

2.3.1 APPLICATION

Using an Android or iPad to operate and interact with a Raspberry Pi seems


like a fantastic concept until you realize how difficult it is to make it a reality.
Building a web application that runs on the Raspberry Pi and acts as a middleman
between the mobile device and the machine's hardware is one approach to do this.
Although frameworks like Bottle for Python make the process of creating web apps
easier, they do necessitate a basic understanding of Python. We need to spend time
building the software, as well as testing and debugging it, in addition to being fluent
in Python. In short, if Python abilities aren't up to par, or don't want to spend hours
developing and debugging code, building web apps from the ground up might not be
for you. This application is a simple platform that allows to create basic mobile
interfaces for communicating with Raspberry Pi without having to code.

It is made up of three parts which are an application, a server, and a library.


The library runs on the Raspberry Pi and does all of the hardware interaction behind
the scenes. The software is the foundation of the platform, and it provides a
framework for creating visual interfaces for RaspBlynkberry Pi control. The
programme includes a variety of widgets, including buttons, sliders, LEDs, value
displays, and more. It simply add the appropriate widgets to a project and configure
their parameters to create a graphical interface using the application.

The server component connects the application to the Raspberry Pi that runs
the library. By default, the platform makes use of the project's cloud service.
However, the server is available under an open source licence, so may easily install it
on own system. In reality, it may run both the server and the library on the same
41

Raspberry Pi, however a dedicated machine or a virtual private server would be


preferable.
To use application, first should install the necessary components. Begin by
downloading the Google Play Store or Apple App Store app on Android or iOS
device. The application library must then be installed on the Raspberry Pi. To update
the software repositories and install Git, should use the instruction as show below on
the Table 2.6

Table 2.6: Instruction

sudo apt-get update


sudo apt-get install got-core

The wiringPi library is required by the application library, so compile and


install it first. Clone the wiringPi Git repository to get started as shown on Table 2.7

Table 2.7: Clone the wiringPi Git repository

git clone git://git.dragon.net/wiringPi

Switch to the wiringPi directory that has resulted and run the build script as
shown on the Table 2.8

Table 2.8: Switch to the wiringPi

cd wiringPi
./build

Run the ‘gpio -v’ command to see if the library has been installed. It should
return the version information. Use the following commands to compile the
application library as shown in Table 2.
42

Table 2.9: Command to compile the library

Git clone https://github.com/blynkkk/blynk-library.git


Cd blynk-library/linux
Make clean all target=raspberry

Although the project provides a service for connecting the application and
the Raspberry Pi, can alternatively run the server on own workstation. The only need
is that Java be installed on this PC. The Server GitHub repository contains.jar
binaries, so all you have to do to deploy the server is download the newest version of
the server-x.x.jar binary and run it using the java -jar server-x.x.jar command. This
will start the server on port 8443 by default, but you can change it with the -hardPort
parameter: server-x.x.jar -hardPort 8555 java -jar server-x.x.jar.

2.3.2 PHYTON LANGUAGE

Python is a dynamically semantic, interpreted, object-oriented high-level


programming language. Its high-level built-in data structures, together with dynamic
typing and dynamic binding, making it ideal for Rapid Application Development and
as a scripting or glue language for connecting existing components. Python's concise,
easy-to-learn syntax promotes readability, which lowers software maintenance costs.
Modules and packages are supported by Python, which facilitates programme
modularity and code reuse. The Python interpreter and its substantial standard library
are free to download and distribute in source or binary form for all major platforms.

Python is popular among programmers because of the enhanced productivity


it offers. The edit-test-debug cycle is extraordinarily rapid because there is no
compilation step. Python scripts are simple to debug a bug or improper input will
never result in a segmentation fault. Instead, when the interpreter finds a mistake, it
throws an exception. The interpreter prints a stack trace if the application fails to
catch the exception. Inspection of local and global variables, execution of arbitrary
expressions, setting breakpoints, stepping through the code one line at a time, and so
on are all possible with a source level debugger. The debugger is written in Python,
43

demonstrating Python's introspective capabilities. On the other hand, adding a few


print statements to a programme is often the easiest method to debug it.

DATA ANALYSIS AND MACHINE LEARNING

Python has become a data science standard, allowing data analysts and other
professionals to perform complex statistical computations, produce data
visualisations, design machine learning algorithms, handle and analyse data, and
perform other data-related tasks using the language.

Python can create a variety of data visualisations, including line and bar
graphs, pie charts, histograms, and three-dimensional plots. TensorFlow and Keras
are two Python frameworks that let programmers create data analysis and machine
learning systems more rapidly and efficiently.

WEB DEVELOPMENT

Python is frequently used to create a website's or application's back end—the


elements that the user doesn't see. Sending data to and from servers, processing data
and interfacing with databases, URL routing, and ensuring security are all examples
of Python's role in web development. Python has a number of web development
frameworks. Django and Flask are two popular ones.Back end engineers, full stack
engineers, Python developers, software engineers, and DevOps engineers are some of
the web development positions that require Python.

AUTOMATION OR SCRIPTING

If you find yourself repeating a task frequently, automating it with Python can
help you work more efficiently. Scripting is the process of writing code that is used
to create these automated procedures. Automation can be used to check for flaws
across numerous files, convert files, perform simple math, and delete duplicates in
data in the coding industry. Relative amateurs can use Python to automate simple
computer chores like renaming files, discovering and downloading web information,
and sending emails or SMS at predetermined intervals.
44

CHAPTER 3

RESEARCH METHODOLOGY

3.1 INTRODUCTION

This chapter outlines the framework and workflow of the research


methodology in order to provide approaches that align with problem statement as
stated previously in the Chapter 1. There are three phase of work that need to be
conducted. There are work planning, hardware research and software research. Those
three phases will lead the project towards success through recognize each functions
of hardware and software in this chapter.

3.2 WORK PLANNING

The overview of this project is determined before conducting the work. Before
the work is conducted, there are a lot of preparations and planning need to be done to
make sure the project is done according to the flow. It also makes the project works
systematically. Time management of this project is planned properly through Gantt
Chart and the project flow is decided and constructed using flow chart for PSM 2.
Besides that, process flow and block diagram will give an overview of the flow of
this project and assign the tasks needed to be done by the device.
45

3.3 PROJECT FLOW

Project Flow is a measure of how much change is expected to happen in a


project over time. It depicts the progression of a project's product from conception
through design to delivery and deployment. Project flow is a predetermined sequence
of operations that must be completed in order to design, produce, deliver, and
manage project product, as well as the information, materials, and resources needed
for the project. Project flow is a useful tool for defining and planning projects. It aids
in the connection of a project's budget and schedule to its activities and tasks. It is
traditionally designed as a chart or diagram, which is an excellent tool for visually
representing how a project will develop and deploy its product. To map out and
display project flow, simple tree-like lists or hierarchies of project activities are also
employed.

The flow chart below in Figure 3.1, shows the overall process to be executed
to complete the project successfully. The important part need to be accomplish is to
identify the problem statement and the objective. As this two important part will
direct us in the project to the right solution and with objective it’s easier to move
forward to reach the project completion. Objective of the project plays a very
important role as the final of the project, should accomplish the objectives. Moreover,
it is important to get a clear objective and scope as a guideline to continue the project.
The project objective must be achieved at the ending of this project.

The next step was literature review after deciding the objective and scope
analysis. In this literature review, have done some research on internet and libraries
as well to gather information and related project works. The literature review started
with previous related projects that have been done and collected information such as
components been used, software basics, designs, data information and analysis.
Knowledge and information gained will be useful in identifying appropriate
components for the projects.

After that, started working on the methodology. Methodology is essential to


make sure all the ideas and information are gathered and arranged in order in a
46

flowchart. As flow chart is an easier way to read and understand about the project or
project flow. It will be easier to identify the workflow, strategy, and approach. Then,
the circuit connection are also mentioned in methodology with a schematic diagram
to show the components that have used in the project and connections of the
components to form the circuit. The measurement of yoga mat, Force Sensitive
Resistor wire connection length, and overall design of the project is also mentioned
in the methodology. The programming used to design this project is Phyton as the
micro controller is Raspberry Pi 4. The programming is done in 2 part. First part is to
send data from the Force Sensitive Sensors in analog form to Arduino Pro Mini will
convert the signal to digital form before sending to Raspberry Pi. The Arduino Pro
Mini perform to convert analog to digital in this project.

After the mechanism, programming and circuit connections are accomplish,


the process of troubleshooting done to check the overall performance of the
connections and coding. If incase there is an issue of no power, no connection or
other matters, been troubleshot until the could get the result. After the
troubleshooting process, integrated the entire project to get the specific result as
mentioned in the objective. In this integrating part, the programming and the
connection of the circuit been integrated to make sure the circuit connection and
components used in right method. Also the design for the yoga mat been done to
place the display and micro controller on the mat.

At last, the final testing of the project have done to get the result and collect
data for report purposes. The final testing is done to check the outcome of the project
and to make sure the project is functioning properly according to the programming
inserted.
47

Figure 3.1: Project Flow


48

3.4 BLOCK DIAGRAM

The main criteria of the project is Input, Control Unit and Output. The Input
for this project is five Force Sensitive Resistor sensor and Arduino Pro mini. The
Force Sensitive Resistor sensor function to detect the pressure and the function of the
Arduino Pro Mini is to convert analog signal to digital signal as an input. Secondly,
the control unit for this project is Raspberry Pi 4 Model B. This control unit will
receive the data from the input and process it with coding. The outputs are 3.5 inch
TFT touch screen and buzzer. The coding have to run inside the control uni and have
to open the application in the Raspberry Pi 4 to get the reading and also to get the
data and will display by the TFT touch screen. Buzzer is for alert system in the
project. The flow of the input, output and control unit is shown in the figure 3.2
below.

Figure 3.2: Block Diagram of the Project


49

3.3 THE PROCESS FLOW

The overall process flow starts from the control unit, Raspberry Pi 4. Once
connect the power supply to Raspberry Pi, it will authenticate and give power to the
TFT touch screen to display. Then, have to run the Phyton coding just once before
running the application. After running the programming, can access into the E-Health
Yoga Mat using Raspberry Pi application. In the application it shows the modes
available and selected mode can be performed on the mat by the user. If any
misplacement mistakes on the mat, the buzzer will give alert to the user to re-correct
the step. This is the overall process flow of the project.The figure 3.3 below shows
the project process flow.

The application named as E-Health Yoga Mat is installed in the Raspberry Pi


4 desktop. To use this application, for the first time user have to sign up once into the
application. If an existing user, can login in using name and password. For new
user’s, have to setup name and new password with reconfirming password again.
After the New sign up, can go into login and use the name and password as created
previously. After login into our personal database, can select the mode that we want
to perform on the yoga mat. There is eight different Asana’s shown in the mode.
Once selected the mode, it will direct into the Asana’s personal mode page, and
Force Sensitive Resistor sensor will activate on the yoga mat to get the input. So,
when we perform the yoga posture as shown the display, the sensor will read the
pressure and shown the pressure matrix in the screen as well. It will also show is the
sensor is detected when there is pressure on the sensors according to the labeled
sensor. If there is any wrong postures perform, the buzzer connected with Raspberry
Pi will send information to buzzer to alert the user to perform the right posture. The
process flow for the application is shown in Figure 3.4
Figure 3.3: Project Process Flow
51

Figure 3.4: Application Flow


52

3.4 HARDWARE DEVELOPMENT

The invention and optimization of electronics and mechanical system


elements that conduct various computational operation are all part of hardware
development. A hardware interface is frequently use to connect various components
to compile into a complete circuit.

3.4.1 FORCE SENSITIVE RESISTOR

Force sensitive resistor sensors in this project act as main input. As to provide
input signal, the user will perform the yoga posture on the yoga mat according to the
display shown in the screen. While the user perform on the mat, the force sensitive
resistor sensors will read the pressure in analog form and send signal to Arduino pro
mini. The figure 3.5 below shows the connection of the sensors connected in the
yoga mat accordingly.

Figure 3.5: The sensor connection accordingly on the yoga mat


53

As shown on the above figure 3.5, the sensors are labeled as 1,2,3,4 and 5.
Sensor 1 and 2 are placed on the top of yoga mat while sensor 3 placed in the middle
of the yoga mat. Finally the sensors 4 and 5, are at the bottom of the yoga mat. The
sensor will read the signal when there is pressure on the sensor cause this Force
Sensitive Resistor sensor have to give pressure or weight to lower the resistance.
According to this term, when the pressure increase in the sensors, the resistance will
be lesser.

3.4.2 Arduino Pro Mini

The Arduino can both input and output analogue and digital signals. Unlike a
digital signal, which has just two values: HIGH and LOW, an analogue signal can
take on any number of values. The Arduino has an analog-to-digital converter built
in to measure the value of analogue signals (ADC). The analogue voltage is
converted to a digital value by the ADC. The analogRead function is used to get the
value of an analogue signal (pin). This function takes the value of an analogue input
pin's voltage and transforms it to a digital value between 0 and 1023, relative to the
reference value. The default reference voltage is either 5 V (for 5 V Arduino boards)
or 3.3 V (for 3.3 V Arduino boards) (for 3.3 V Arduino boards).

As in this project, the Arduino Pro mini work as analog to digital converter.
This is to convert the input signal given to the Force sensitive resistor from analog to
digital signal. The input signal produced by the user performing posture on the mat,
and there is pressure on each sensors according to the mode selected in the software.
Every signal from the sensor will converted by the Arduino Pro mini before going
into control unit. Figure 3.6 shows the Arduino Pro Mini used in this project.
54

Figure 3.6: Arduino Pro Mini used in the project

3.4.3 Raspberry Pi 4 Model B

The new USB-C power connector is perhaps the most important in terms of
everyday use. Its inclusion ensures an extra 500mA, bringing the total to 1.2A for
USB devices. There are also two USB 3.0 ports in addition to two USB 2.0
connectors. The possibility of connecting high-speed USB devices to the Raspberry
Pi 4 is fascinating. The USB-C connector also supports OTG, allowing you to
connect the Pi to a USB port on your PC and access it locally.The Ethernet port was
on the USB hub in prior models with on-board LAN. The port's speed was dropped
as a result, however this time the Ethernet port is a full Gigabyte, ensuring superior
speed. The Raspberry Pi 4 has built-in wireless networking (dual-band 802.11
b/g/n/ac) and Bluetooth 5.0 BLE capability, just like previous models. A new
processor is also included in the latest Raspberry Pi. On the BCM2837 SoC (System-
on-Chip), a 1.5GHz 64-bit quad-core ARM Cortex-A72 CPU (ARM v8) sits,
marking a substantial departure from prior generations of Raspberry Pi. Finally,
instead of a single HDMI port, the Raspberry Pi 4 offers a pair of micro-HDMI ports.
These support 4K, which opens up the possibility of ultra HD video for media
streaming and twin monitor projects.

In this project, Raspberry Pi 4 Model B 4GB RAM is the control unit. It runs
the coding and also carries application of E-Health Yoga Mat Using Raspberry Pi.
The analog signals from Force sensitive sensor will move into Arduino Pro Mini to
convert into digital signal. After that, the digital signal will direct into the Raspberry
Pi and provide sensor data to the application.

3.4.4 3.5 Inch Touch Screen

The TFT touch screen is used in this project to minimize the display according
to the yoga mat. When the user perform the posture, this screen will be more helpful
and convenient to use together with the yoga mat. This TFT touch screen is an output
55

display from Raspberry Pi. The Figure 3.7 below shows the TFT touch screen used
in this project.

Figure 3.7: 3.5 Inch TFT Touch Screen used in this project

3.4.5 Buzzer

The buzzer in this project is for alert system. While the user perform the
postures on the mat, if they missed out any point on the sensor point or wrongly do
the posture, the alert system will produce sound from the buzzer. The buzzer from
the project is shown in the Figure 3.8 below.
56

Figure 3.8: Buzzer used in this project

3.4.6 Yoga Mat

The yoga mat that used for this project is natural rubber material as it will e
more convenient for the user to use while perform the yoga posture. Moreover, this
material is more light and easier to handle. As for this project, I have to install the
sensors in the mat, it will be an easy installation as well. The yoga mat size is 173cm
long, 61cm width and 10mm thickness. The size of the yoga mat shown below in the
Figure 3.9
57

Figure 3.9: Measurement of the yoga mat used for this project

3.4.7 Schematic Diagram

Figure 3.10 show the schematic diagram of the circuit. The components used are as
mentioned Raspberry Pi, Display, resistors, Arduino Pro mini and a buzzer.

Figure 3.10: Schematic Diagram


58

3.5 Software Development

Software development is a set of computer science activities concern with the


creation, design, deployment, end maintenance of software. The set of instruction of
programs that teach computer to what to do is a software development. It is hardware
a0gnostic and allow the computers to reprogram.

3.5.1 Phyton

In this project, Phyton language is used as the main coding for the Raspberry
Pi. The coding is to activate the application and create an interface between the
software sensor, buzzer and control unit. First coding is for the TFT screen
interfacing with the Raspberry Pi 4. Th previous version of Raspberry Pi is easy to
connect with the displays as it is direct connection and there is no any additional
settings. Nonetheless, for TFT touch screen needed setup and coding to activate the
screen. So, firstly connected the Raspberry Pi with power supply and then connected
the screen to the Raspberry Pi directly. After that, used an HDMI cable to connect
the Raspberry Pi with a monitor. In the monitor, have done the basic setup and the
memory card with 32GB memory installed in the Raspberry Pi. Then, inserted the
coding shown in Figure 3.11 below in the Command prompt in the Raspberry Pi to
interface the TFT touch screen.

sudo rm -rf LCD-show

git clone https://github.com/goodtft/LCD-show.git

chmod -R 755 LCD-show

cd LCD-show/

sudo ./LCD35-show
59

Figure 3.11: Coding to interface TFT touch screen with Raspberry PI.

After that, the display on the monitor have turned off automatically and the
TFT touch screen is displayed. Then, started working on the programming of E-
Health Yoga Mat Using Raspberry Pi. In the coding have included the sensors,
buzzers and others as well. The Figure 3.12 below shows the coding for buzzer
connection in the overall process.

# Register Virtual Pins


@blynk.VIRTUAL_WRITE(10)
def my_write_handler(value):
##########print('Button V10 value: {}'.format(value))
print(value)
STAT=str(value)
if (str(value)=="['1']"):
GPIO.output(BUZZ, True)

if (str(value)=="['0']"):
GPIO.output(BUZZ, False)

if (str(value)=="['3']"):
GPIO.output(BUZZ, True)
time.sleep(0.02)
GPIO.output(BUZZ, False)
time.sleep(0.02)
GPIO.output(BUZZ, True)
time.sleep(0.02)
GPIO.output(BUZZ, False)
time.sleep(0.02)
GPIO.output(BUZZ, True)
time.sleep(0.02)
GPIO.output(BUZZ, False)
60

time.sleep(0.02)

if (str(value)=="['2']"):
GPIO.output(BUZZ, True)
time.sleep(0.2)
GPIO.output(BUZZ, False)
time.sleep(0.2)
GPIO.output(BUZZ, True)
time.sleep(0.2)
GPIO.output(BUZZ, False)
time.sleep(0.2)

if (str(value)=="['0']"):
GPIO.output(BUZZ, False)

if (str(value)=="['5']"):
ser.write("A".encode())
blynk.notify("DEVICE IS NOW ONLINE!")

Figure 3.12: Coding for the Buzzer in the project

Next will be performing coding for sensors. This coding is to create the
numeric reading in the application from the Force Sensitive Resistor. When the
sensor detect pressure from the user while performing yoga posture, the resistance in
the sensor will decrease and will show a numeric reading on the pressure. On the
yoga mat, the sensor is arranged accordingly as Sensor 1 and Sensor 2 on top, Sensor
3 in the middle and Sensor 4 and Sensor 5 at the bottom shown in Figure 3.13 below.
61

Figure 3.13: The Force Sensitive Resistor sensor connected accordingly on the yoga
mat

After the sensor installation, the sensor coding is setup and uploaded to
activate the sensors to get input. The coding for the sensor is shown below in Figure
3.14

Figure 3.13: Coding for Buzzer


62

3.5.2 Application

For this project, I have created an Application named E-Health Yoga Mat
Using Raspberry Pi. In this application, it able to read the pressure value in numeric
from the sensors. Moreover, user’s can sign up or if already have an account can
login to perform the Asana’s they prefer in the Yoga Mode. This application also
able to save data of the user’s for reference purpose and keep track on the
performance as well. It also provides some doctor tips for better performance while
on the mat and off the mat as well. The icon of the application shown below in
Figure 3.14

Figure 3.14: The icon of the applicatio


63

CHAPTER 4

RESULTS AND DISCUSSION

4.1 Overview

This chapter will show and explain the development of the E-Health Yoga
Mat Using Raspberry Pi. Thus, the design for the project is based on two
fundamental points as follows:

i. Designing and developing the hardware with Force Sensitive Sensor, Arduino Pro
Mini, Raspberry Pi, 3.5 inch TFT touch screen and buzzer.
ii. Analyzing data in the application to get numeric data of the pressure given and
alert sound from the buzzer.

4.2 Hardware and Software Findings

In this part, will show the complete hardware design with circuit connections,
software working system and finally the outcome from this project with some
64

analysis. The overall project objective and scope will be proved in this chapter with
the results.

4.2.1 Sensor Connection

As for this project, have used five Force Sensitive Resistor on the Yoga Mat.
The connection of the sensors is from the resistor and Arduino Pro min. As the
sensor will read the data and send to Arduino Pro Mini to convert to digital signal
and will send information to the control unit. The five sensor that connected in this
circuit are shown below in Figure 4.1
65

Figure 4.1: Sensor Connection

4.2.2 Design and Assembly

The overall design of the project is completed after the circuit connections are done.
The Arduino Pro Mini and the resistors connected to the sensors are placed in a
casing separated from the control unit, Raspberry Pi 4 and Tft touch screen are
together in a casing. The Arduino pro mini will make a direct connection to the
Raspberry Pi along with buzzer. The figure 4.2 shows the overall circuit connection
and in Figure 4.3 shows the direct connection of the Arduino Pro mini to the
Raspberry Pi.
66

Figure 4.2: Overall circuit connection

Figure 4.3: Direct Connection of Arduino Pro Mini to Raspberry Pi 4

4.2.3 Multiple sensor connection testing

The sensor’s are connected on the yoga mat before the testing as shown in the
Figure 4.4 below. This is the final testing on the sensor accuracy to detect the
pressure on the mat when force is applied on the sensor.
67

Figure 4.4: Sensor connected on the yoga mat


After the sensor is connected on the Yoga mat, have tested by giving force on the
sensor one by one. Then, tested with multiple sensor at the same time. The sensors
are able to detect as shown in Figure 4.5.

A B C

D E F

Figure 4.5: A. Testing Sensor 2, B. Testing Sensor 1, C. Testing Sensor 3, D. Testing


Sensor 4, E. Testing Sensor 5, and F. Testing Multiple Sensor 1,2,4 and 5.
68

As shown in the above figure, all sensors are able to detect in the application. The
numeric value will be shown on the application and save data as well.

4.2.4 Display

3.5 inch TFT touch screen is the display connected to the raspberry pi to send data in
digital form. The Phyton coding and the application are able to run in the Raspberry
pi and displays in the touch screen. As shown in the Figure 4.6, the Raspberry should
connect to the power to on the screen and then can use the touch screen for coding
and application.

Figure 4.6: TFT touch screen connected with Raspberry Pi

4.2.5 Application

The Application created for the E-Health Yoga Mat using Raspberry Pi is apk
formatted software. This application is able to control in the phone and also on the
Raspberry Pi. There are few features in this application. Firstly, have to enter the
application after installing it, as shown in the Figure 4.7 below.
69

Figure 4.7: Homepage for the application

After enter into home page, have to select sign up or log in. If existing user can press
log in and insert the name and password, as shown in the figure 4.8

Figure 4.8: Login Page


70

If new user, have to press Sign Up and insert the details of name, password and
confirm password to own an account, Once created, log in as usual.

Figure 4.9: Sign Up

After log in, it will show type of yoga postures. There are 8 type of postures for now
in the application as shown in Figure 4.10 below
71

Figure 4.10: Type of Asana

After that, as an example, the user chooses Asana 1 to perform on the mat, it will
show the Sensor to read according to the posture. If the posture is wrong or wrong
sensor is detected it will produce alert sound from the buzzer. The Mode page is
shown in Figure 4.11

Figure 4.11: Read Sensor 1

Finally, when the user perform on the yoga mat, the sensor will show detect when
there is pressure on the sensor. It will keep data of the user in the history and will
provide health info’s as well in the health info section.

4.3 Result

To collect the results of the project, 8 participants were selected to perform


the Yoga postures called as “Asana’s” on the yoga mat. Every one of them have
given one post to perform and got the reading of the pressure from Force Sensitive
Resistor to the application. When the participant perform the posture on the yoga mat,
72

the detection of pressure delayed 3 seconds only. In Figure 4.12, shows the
participants perform the posture on the mat while the reading of pressure sensor in
the application.
73

Figure 4.12: Asana 8 performed by participant with result of the sensor detection in
the application.
Figure 4.12: Asana 3 performed by participant with result of the sensor detection in
the application.
75

Figure 4.12: Asana 7 performed by participant with result of the sensor detection in
the application.
76

CHAPTER 5

CONCLUSION

5.1 Overview

In this chapter, will conclude the overall project work, work flow, result, discussion
and finally the goal to achieve the aim and objective.

5.2 Conclusion

The objective and aim of this project is achieved. In this project, have
developed a E-Health Yoga Mat using Raspberry Pi 4 Model B. In this project, Force
Sensitive Resistor is used to detect the pressure or force given by the user to detect
the movement on the mat. Finally, after the hardware connection and software is
completed, the evaluation of the project is done completely to prove the result.

During the software development, the information on software management,


circuit designing, components selections and measurement reading has been
improved. A Phyton coding is developed in Raspberry Pi to connect the application
with the Raspberry Pi through the mobile phone. Moreover, this application able to
guide the user to learn and perform the yoga postures while it saves data of every
user in the history channel.
77

5.3 Recommendation for future work

For the future work, would suggest to have more features in this application
so that it’s use will be more on this yoga mat. Moreover, this sensor design could be
improved more or add more sensors for better performance and multiple detection on
the mat as more the sensor, the more the posture able to perform on the mat.
78

REFERENCES

[1] research gate. 2014. Smart-Mat: Recognizing and Counting Gym Exercises
with Low-cost Resistive Pressure Sensing Matrix. [online] Available at:
<https://www.researchgate.net/publication/280765362_Smart
mat_Recognizing_and_counting_gym_exercises_with_low-
cost_resistive_pressure_sensing_matrix>
[2] 2015. INTERACTIVE EXERCISE MAT. 1st ed. [ebook] Patent Application
Publication, p.28. Available at:
<https://patentimages.storage.googleapis.com/a3/6b/16/1cd370c8a78f09/US2015036
4059A1.pdf>
[3] Long, C., Jo, E. and Nam, Y., 2022. Development of a yoga posture coaching
system using an interactive display based on transfer learning.
[4] Kim, T. and Hong, Y., 2022. Prediction of Body Weight of a Person Lying on
a Smart Mat in Nonrestraint and Unconsciousness Conditions.
[5] Sensingtex.com. 2022. [online] Available at: <h.
[6] Ijircst.org. 2022. [online] Available at: <https://www.ijircst.org/DOC/26-a-
research-paper-on-new-generation-gym-mat.pdf>
[7] ACM Conferences. 2022. Social yoga mats | Proceedings of the Sixth
International Conference on Tangible, Embedded and Embodied Interaction. [online]
Available at: <https://dl.acm.org/doi/10.1145/2148131.2148151> [Accessed 20 June
2022].
[8] Ieeexplore.ieee.org. 2022. Real&#x2013;Time Yoga Activity with Assistance
of Embedded based Smart Yoga Mat. [online] Available at:
<https://ieeexplore.ieee.org/document/8902371> [Accessed 20 June 2022].
[9] HIIT Pi makes Raspberry Pi your home workout buddy – Binary Emotions
Blog, 2022
79

APPENDIX A

Programming for Arduino Pro Mini


float Temp=0;
float Sens1,Sens2,Sens3,Sens4,Sens5;
int MODE=0;
int Count=0;
float Voltage,Bat,Power;
float Is,Ib;
int Sens1Pin = 0;
int Sens2Pin = 1;

float CS;

void setup() {
Serial.begin(9600);

void loop() {

if (MODE==1){
//----------------------------------------------------------------
Sens1 = analogRead(A0); //read the value from the sensor
Sens1= (5.0 * Sens1 * 100)/1024.0; //convert the analog data to digital
Sens1=(500-Sens1) * 0.2;

Sens2 = analogRead(A1); //read the value from the sensor


Sens2= (5.0 * Sens2 * 100)/1024.0; //convert the analog data to digital
Sens2=(500-Sens2) * 0.2;

Sens3 = analogRead(A2); //read the value from the sensor


Sens3= (5.0 * Sens3 * 100)/1024.0; //convert the analog data to digital
Sens3=(500-Sens3)* 0.2;

Sens4 = analogRead(A3); //read the value from the sensor


Sens4= (5.0 * Sens4 * 100)/1024.0; //convert the analog data to digital
Sens4=(500-Sens4)* 0.2;

Sens5 = analogRead(A5); //read the value from the sensor


Sens5= (5.0 * Sens5 * 100)/1024.0; //convert the analog data to digital
Sens5=(500-Sens5) * 0.2;

/*
80

Serial.print(Sens1);
Serial.print("\t");
Serial.print(Sens2);
Serial.print("\t");
Serial.print(Sens3);
Serial.print("\t");
Serial.print(Sens4);
Serial.print("\t");
Serial.println(Sens5);

*/
//-------------------------------------------------------------------

delay(1000);

Count++;
if (Count==1){
Serial.println(Sens1);
}
if (Count==2){
Serial.println(Sens2);
}

if (Count==3){
Serial.println(Sens3);

if (Count==4){
Serial.println(Sens4);

}
if (Count==5){
Serial.println(Sens5);
Count=0;
}

void serialEvent() {
while (Serial.available()) {
// get the new byte:
char inChar = (char)Serial.read();
81

// add it to the inputString:

// if the incoming character is a newline, set a flag so the main loop can
// do something about it:
if (inChar == 'A') {
MODE=1;
}
}
}
82

PHYTON Coding
import BlynkLib
import time
import serial
import RPi.GPIO as GPIO

GPIO.setwarnings(False) # Ignore warning for now


#GPIO.setmode(GPIO.BOARD) # Use physical pin numbering
GPIO.setmode(GPIO.BCM)

STAT="0"
BUZZ = 23

GPIO.setup(BUZZ,GPIO.OUT)

T=0

BLYNK_AUTH ='quJuB8TwDl8GITidbULSBoEFwDoH4ECc'
blynk = BlynkLib.Blynk(BLYNK_AUTH, server='139.59.206.133', port=80,
heartbeat=30, log=print )

ser = serial.Serial(
port='/dev/ttyS0',
baudrate = 9600,
parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE,
bytesize=serial.EIGHTBITS,
timeout=1

)
83

ser.write("A".encode()) # Initialize Blynk

# Register Virtual Pins


@blynk.VIRTUAL_WRITE(10)
def my_write_handler(value):
##########print('Button V10 value: {}'.format(value))
print(value)
STAT=str(value)
if (str(value)=="['1']"):
GPIO.output(BUZZ, True)

if (str(value)=="['0']"):
GPIO.output(BUZZ, False)

if (str(value)=="['3']"):
GPIO.output(BUZZ, True)
time.sleep(0.02)
GPIO.output(BUZZ, False)
time.sleep(0.02)
GPIO.output(BUZZ, True)
time.sleep(0.02)
GPIO.output(BUZZ, False)
time.sleep(0.02)
GPIO.output(BUZZ, True)
time.sleep(0.02)
GPIO.output(BUZZ, False)
time.sleep(0.02)

if (str(value)=="['2']"):
GPIO.output(BUZZ, True)
time.sleep(0.2)
GPIO.output(BUZZ, False)
time.sleep(0.2)
84

GPIO.output(BUZZ, True)
time.sleep(0.2)
GPIO.output(BUZZ, False)
time.sleep(0.2)

if (str(value)=="['0']"):
GPIO.output(BUZZ, False)

if (str(value)=="['5']"):
ser.write("A".encode())
blynk.notify("DEVICE IS NOW ONLINE!")

@blynk.VIRTUAL_READ(0)
def my_read_handler():
blynk.virtual_write(0, SENS1)

@blynk.VIRTUAL_READ(1)
def my_read_handler():
blynk.virtual_write(1, SENS2)

@blynk.VIRTUAL_READ(2)
def my_read_handler():
blynk.virtual_write(2, SENS3)

@blynk.VIRTUAL_READ(3)
def my_read_handler():
blynk.virtual_write(3, SENS4)

@blynk.VIRTUAL_READ(4)
def my_read_handler():
blynk.virtual_write(4, SENS5)
85

# this widget will show some time in seconds..

while True:

#while ser.in_waiting:
x=ser.readline()
finalValue = x.decode('utf-8').replace('\r','').replace('\n','')

if (str(finalValue)):
if (T==4):
print (finalValue)
SENS5=(finalValue)
blynk.virtual_write(4, SENS5)
T += 1

if (T==3):
print (finalValue)
SENS4=(finalValue)
blynk.virtual_write(3, SENS4)
T += 1

if (T==2):
print (finalValue)
SENS3=(finalValue)
blynk.virtual_write(2, SENS3)
T += 1

if (T==1):
86

print (finalValue)
SENS2=(finalValue)
T += 1
blynk.virtual_write(1, SENS2)

if (T==0):
print (finalValue)
SENS1=(finalValue)
T += 1
blynk.virtual_write(0, SENS1)

if (T==5):
T=0
#PH=(finalValue)PH

blynk.run()
87

Circuit Connections in Proteus


1

APPENDIX
Gantt Chart
Week
2 3 4 5 6 7 8 9 10 11 12 13 14
No. Content

1 Briefing PSM 1

Select a title and send proposal


2
to validate the project title
Writing report and proposal
3
PSM 1

4 PSM 1 proposal presentation

Documentations Chapter 1 and


5 Chapter 2: Introduction and
Literature Review
Documentations Chapter 3 :
6
Methodology
Documentations Chapter 4 :
7
Result and analysis

8 Presentation preparation

9 Submit draft report to SV

Submit final report to SV and


10
Panel

11 PSM1 Presentation Seminar

Planned
Actual

You might also like