0% found this document useful (0 votes)
26 views92 pages

Batch 6 Merged

The document presents a project report titled 'Iot Guardian Posture: Monitoring and Mitigating Muscle Strain,' which focuses on developing an IoT solution to monitor and improve posture, particularly for elderly individuals and workplace settings. The system utilizes wearable sensors for real-time posture monitoring, providing feedback through a user-friendly interface, and aims to mitigate muscle strain by promoting better posture habits. The project also explores future applications in healthcare and rehabilitation, emphasizing the importance of posture awareness for overall well-being.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views92 pages

Batch 6 Merged

The document presents a project report titled 'Iot Guardian Posture: Monitoring and Mitigating Muscle Strain,' which focuses on developing an IoT solution to monitor and improve posture, particularly for elderly individuals and workplace settings. The system utilizes wearable sensors for real-time posture monitoring, providing feedback through a user-friendly interface, and aims to mitigate muscle strain by promoting better posture habits. The project also explores future applications in healthcare and rehabilitation, emphasizing the importance of posture awareness for overall well-being.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 92

Iot Guardian Posture: Monitoring and

Mitigating Muscle Strain


A Report submitted in partial fulfillment of the requirements for the Degree of
Bachelor of Technology

in

CSE – Internet of Things

by

G. Akshitha 2111CS050066
P. Sindhu Reddy 2111CS050074
K. Charmika Reddy 2111CS050085

Under the esteemed guidance of

Prof. K.V. Siva Prasad Reddy


Assistant Professor

Department of CSE – Internet of Things


School of Engineering
MALLA REDDY UNIVERSITY
Maisammaguda, Dulapally, Hyderabad, Telangana 500100
2025

i
Department of CSE – Internet of Things

CERTIFICATE

This is to certify that the project report entitled “ Iot Guardian Posture: Monitoring and
Mitigating Muscle Strain”, submitted by G.Akshitha (2111CS050066), P. Sindhu Reddy
(2111CS050074), K.Charmika Reddy (2111CS050085), towards the partial fulfillment for
the award of Bachelor’s Degree in Internet of Things from the Department of CSE –
Internet of Things, Malla Reddy University, Hyderabad, is a record of bonafide work done
by them. The results embodied in the work are not submitted to any other University or
Institute for award of any degree or diploma.

Internal Guide Head of the Department


Prof. K.V. Siva Prasad Reddy Dr. G. Anand Kumar
Assistant Professor Professor & HoD

External Examiner

ii
DECLARATION

We hereby declare that the project report entitled “Iot Guardian Posture: Monitoring and
Mitigating Muscle Strain” has been carried out by us and this work has been submitted to
the Department of CSE – Internet of Things, Malla Reddy University, Hyderabad in partial
fulfillment of the requirements for the award of degree of Bachelor of Technology. We
further declare that this project work has not been submitted in full or part for the award of
any other degree in any other educational institutions.

Place:
Date:

G. Akshitha 2111CS050066
P. Sindhu Reddy 2111CS050074
K. Charmika Reddy 2111CS050085

iii
ACKNOWLEDGEMENT

We extend our sincere gratitude to all those who have contributed to the completion of this
project report. Firstly, we would like to extend our gratitude to Dr. V. S. K Reddy, Vice-
Chancellor, for his visionary leadership and unwavering commitment to academic excellence.

We would also like to express my deepest appreciation to our project guide Prof. K. V. Siva
Prasad Reddy, Assistant Professor in CSE – Internet of Things, whose invaluable guidance,
insightful feedback, and unwavering support have been instrumental throughout the course
of this project for successful outcomes.

We are also grateful to Dr. G. Anand Kumar, Head of the Department of CSE – Internet of
Things, for providing us with the necessary resources and facilities to carry out this project.

We would like to thank Dr. Kasa Ravindra, Dean, School of Engineering, for his
encouragement and support throughout our academic pursuit.

Our heartfelt thanks also go to Dr. Harikrishna Kamatham, Associate Dean, School of
Engineering for his guidance and encouragement.

We are deeply indebted to all of them for their support, encouragement, and guidance,
without which this project would not have been possible.

G. Akshitha (2111CS050066)
P .Sindhu Reddy (2111CS050074)
K. Charmika Reddy (2111CS050085)

iv
ABSTRACT
The “Iot Guardian Posture: Monitoring and Mitigating Muscle Strain” is an IoT
solution combatting musculoskeletal issues arising from sedentary lifestyles. It uses
wearable sensors for real-time posture monitoring, communicating with a microcontroller
and employing advanced algorithms for detection. The system seamlessly integrates into
daily routines without restricting mobility. Collected data is securely transmitted to the
cloud for comprehensive analysis and historical tracking. The user interface, accessible via
web or mobile app, provides real-time feedback, alerts for improper postures, and
corrective guidance. Key features include personalized posture recommendations, timely
alerts, and a user-friendly interface for heightened awareness. The system actively mitigates
muscle strain by promoting informed and proactive posture habits.
The anticipated outcomes of the major project include the successful development
and implementation of a real-time posture recognition algorithm that accurately
distinguishes between different human postures such as sitting, standing, walking, and
falling. Development of a user-friendly interface for the wearable device, providing
feedback to users about their current posture and, if applicable, delivering alerts or
notifications to prompt corrective actions and Exploration of potential applications in
healthcare, eldercare, workplace safety, and ergonomic monitoring, with a focus on
improving the well-being of individuals through posture awareness. The future scope of
the Guardian-Posture project extends into rehabilitation, physical therapy, and sports
training, aiming to optimize performance and prevent injuries in these domains. Innovative
applications, such as integrating robotic arms, target fall prevention among the elderly and
those with mobility challenges, enhancing overall safety and well-being.

v
TABLE OF CONTENTS

CHAPTER NO. TITLE PAGE NO.

Title Page i

Certificate ii

Declaration iii

Acknowledgement iv

Abstract v

Table of Contents vi

List of Figures viii

List of Tables x

1. INTRODUCTION 1-4

1.1 Introduction 1

1.2 Problem Definition 1

1.3 Objective of the Project 2

1.4 Existing System 2

1.4.1 Disadvantages of Existing System 3

1.5 Proposed System 3

1.5.1 Advantages of Proposed System 4

2. LITERATURE SURVEY 5-6

3. DESIGN 7-56

3.1 Introduction to IoT 7

3.2 Introduction to Embedded Systems 8

3.3 Project Architecture and Schematic Diagram 9

3.4 Hardware Description 11-43

3.4.1 Node MCU(ESP8266) 11

vi
3.4.2 Regulated Power supply 18

3.4.3 LED Indicator 27

3.4.4 MPU6050 sensor 27

3.4.5 Buzzer 31

3.4.6 LCD Display 32

3.4.7 GSM 34

3.4.8 Vibration 38

3.4.9 Muscle Stimulator 42

3.5 Software Description 44-55

3.5.1 Express PCB 44

3.5.2 Arduino IDE Studio Compiler 47

3.5.3 Procedural steps for Compilation 49

3.5.4 ThingSpeak 53

4. RESULTS 56-68

4.1 Results 56

4.2 Pseudocode 63

5. CONCLUSION 69-70

5.1 Conclusion 69

5.2 Future Scope 69

6. REFERENCES 71-72

vii
LIST OF FIGURES

Figure 3.1 Example of an IoT System 7


Figure 3.3.1 Architecture of Guardian-Posture 9
Figure 3.3.2 Project Schematic Diagram 11
Figure 3. 4. 1. 1 ESP8266 12
Figure 3. 4.1.2 ESP-12E Module 12
Figure 3. 4. 1. 3 Power Requirement 13
Figure 3. 4. 1. 4 Peripherals and I/O 14
Figure 3. 4.1.5 On-Board switches 15
Figure 3. 4.1.6 Serial Communication 15
Figure 3. 4.1.7 ESP8266 NodeMCU Pinout 16
Figure 3. 4. 2. 1 Regulated Power Supply 18
Figure 3. 4. 2. 2 Circuit diagram of Power Supply 18
Figure 3. 4. 2. 3 Transformer 20
Figure 3. 4. 2. 4 Bridge Rectifier 22
Figure 3. 4. 2. 5 DB107 23
Figure 3. 4. 2. 6 Capacitor 24
Figure 3. 4. 2. 7 Electrolytic Capacitor 24
Figure 3. 4. 2. 8 Voltage Regulator 25
Figure 3. 4. 2. 9 Resistor 26
Figure 3. 4. 3 LED Indicator 27
Figure 3. 4. 4. 1 MPU6050 Gyroscope 28
Figure 3. 4. 4. 2 3-Axis Gyroscope 28
Figure 3. 4. 4. 3 3-Axis Accelerometer 29
Figure 3. 4. 4. 4 MPU6050 Module 30
Figure 3. 4. 5 Buzzer 31
Figure 3. 4. 6 LCD Display 32
Figure 3. 4. 7 GSM 34
Figure 3. 4. 8 Vibration Motor 40
Figure 3. 9 Muscle Stimulator 42
Figure 3.5.1 Express PCB 44
Figure 3.5.2 Arduino IDE Studio 47
Figure 3. 4. 5. 1 Arduino setup 49
viii
Figure 3. 4. 5. 2 Arduino Boards selection 50
Figure 3. 4. 5. 3 Module selection 51
Figure 3. 4. 5. 4 Port selection 52
Figure 3. 4. 5. 4 LED Blink on ESP8266 52
Figure 3. 5. 4. 1 ThingSpeak Channel creation 54
Figure 3. 5. 4. 2 ThingSpeak API Key generation 54
Figure 4.1.1 GOOD POSTURE 56
Figure 4.1.2 Gyroscope LED Blink(green) 56
Figure 4.1.3 BAD POSTURE 57
Figure 4.1.4 LED blink of Relay(red) 57
Figure 4.1.5 LCD Display-Bad Posture 58
Figure 4.1.6 Buzzer ON if it detects bad posture 58
Figure 4.1.7 Muscle stimulators activation. 59
Figure 4.1.8 The GSM Module And FALL ALERT!! Notification 59
Figure 4.1.9 Various Readings of Gyroscope Sensor 60
Figure 4.1.10 Visualization of sensor data in ThingSpeak 61
Figure 4.1.11 Sensor Data in CSV file 62

ix
LIST OF TABLES

Table 3.4.6 : Character LCD pins with Microcontroller 33

x
CHAPTER 1: INTRODUCTION

1.1 Introduction

Human posture recognition has a wide range of application for elderly care. The
real problem occurs when an elderly person who is living alone get severally sick or in a
worst case fall and get injured making him or her unable to ask for help. In some
unfortunate situations, after they fall or got sick, they might even have to live through that
agony and physical pain until their final breath without any sort of help. To overcome this
problem, we design a wearable sensor based human postures (Activity) recognition
system. The main aim of this project is to design a wearable sensor based human postures
recognition and stimulation system using IOT and mpu6050 Gyroscope sensor. This
system uses IOT technology to send the data into the thingspeak cloud.

1.2 Problem Statement

In the context of elderly care, the critical issue arises when individuals living alone
face severe illness or experience a fall, rendering them incapacitated and unable to seek
assistance. Tragically, in some instances, the elderly may endure prolonged periods of
agony and physical distress without any means to request aid.

The urgency of such situations is further exacerbated by the potential absence of


immediate help, leading to a profound impact on the well-being and safety of these
vulnerable individuals. To address this pressing challenge, our project aims to develop a
wearable sensor based human posture recognition system.

By employing advanced technologies such as motion sensors and real-time


posture recognition algorithms, the system will have the capability to continuously
monitor the postures of elderly individuals. In addition to addressing the challenges faced
by elderly individuals living alone, there is a parallel concern regarding workplace
posture problems that contribute to discomfort and potential health issues among
employees. Prolonged periods of poor posture during work can lead to musculoskeletal
disorders, reduced productivity, and an increased risk of injuries.

By addressing both the challenges faced by elderly individuals living alone and
workplace posture problems, our project aims to create a versatile solution that enhances
the overall wellbeing of individuals across different life stages and environments

1
1.3 Objective of the project

The primary objective of this project is to design a wearable sensor based human
postures recognition and stimulation system using IOT and mpu6050 Gyroscope sensor.
This system uses IOT technology to send the data into the thingspeak cloud. Human
posture recognition has a wide range of application for elderly care. The real problem
occurs when an elderly person who is living alone get severally sick or in a worst-case
fall and get injured making him or her unable to ask for help. In some unfortunate
situations, after they fall or got sick, they might even have to live through that agony and
physical pain until their final breath without any sort of help. To overcome this problem,
we design a wearable sensor based human postures (Activity) recognition system. The
controlling device of the whole system is NodeMCU. NodeMCU acts an intermediate
between input and output modules and acts accordingly on the output modules from the
input received as in the way it is programmed. Here, the Microcontroller gets input from
mpu6050 module. Based on that microcontroller displays the human activity on LCD
module and send the data into the thingspeak cloud through Wi-Fi and also activate the
buzzer and vibration when the system detects wrong posture and also sending the alert
SMS when the system detects fall detection. BY using switch, we can switch ON the
muscle stimulator when we required to provide the rhythmic muscle contractions to the
persons. This total setup will keep on the belt and it is operated with battery power.

1.4 Existing System

The existing system relies primarily on traditional methods and manual processes as
individuals experiencing back pain are often presented with a range of treatment options,
from invasive surgeries and complicated equipment like dynamic joint braces to
minimally invasive back surgery, which, despite its potential for early recovery in 6 to 12
months, may have a variable success rate. Conventional remedies include heat/cool pads
and acupuncture techniques, offering temporary relief. Some patients may explore the use
of spinal disks— 3 rubbery pads with a tough outer layer and elastic core—embedded
between vertebrae and secured by ligaments. However, this process is known for its pain
and potential serious side effects, adding to the complexity and costliness of available
treatments for back pain.

2
1.4.1 Disadvantages of the Existing System

Lack of Personalization: Traditional methods and manual processes lack


personalized care tailored to individual patient needs.
Variable Success Rates: Treatment options such as surgery and equipment like
dynamic joint braces may have variable success rates, leaving patients uncertain about
outcomes.
Risk and Cost: Invasive surgeries and complicated equipment carry significant
risks and costs, deterring some patients from seeking treatment and potentially leading to
adverse outcomes.
Complexity and Inefficiency: The existing system's limitations contribute to the
complexity and inefficiency of managing back pain, hindering timely and effective
solutions.

1.5 Proposed System

The proposed system incorporates an MPU6050 Gyroscope sensor, surpassing


accelerometers in its ability to measure and maintain body orientation and angular
velocity. Unlike accelerometers that solely capture linear motion, the gyroscope sensor
excels in measuring tilt and lateral orientation. The system activates a buzzer and vibrator
for alerts if incorrect posture is sustained for 20 seconds. It integrates a switch to operate
a stimulator, applying electrical currents through electrodes to the skin near affected
muscles, inducing rhythmic contractions. Leveraging GSM technology, the system sends
a message upon detecting a fall, and the project status is displayed on an LCD screen.
With the primary goal of promoting a healthy lifestyle and alleviating back pain, this
wearable device offers users a simple yet effective tool for posture correction during daily
activities like desk work or sitting in class.

1.5.1 Advantages of Proposed System

Advanced Sensor Technology: The utilization of the MPU6050 Gyroscope


sensor provides a more sophisticated approach to posture monitoring compared to
traditional accelerometers. By measuring both orientation and angular velocity, the
system offers a comprehensive understanding of body movements, surpassing the
capabilities of accelerometer-based systems.

3
Electrical Stimulation for Muscle Engagement: Unlike conventional solutions
that primarily focus on passive monitoring, the proposed system integrates a stimulator
with electrodes to actively engage muscles. This electrical stimulation induces rhythmic
contractions, promoting muscle activity and contributing to a more proactive approach in
addressing back pain and posture-related issues.
GSM-Based Fall Detection and Notification: The incorporation of GSM
technology enhances the system's responsiveness in case of a fall. By sending instant
messages upon fall detection, the proposed system ensures that relevant parties, such as
caregivers or emergency services, are promptly informed, facilitating quicker intervention
and assistance.
Simplified and Wearable Design: The proposed system aims for simplicity and
wearability, addressing concerns related to the complexity and intrusiveness of existing
solutions. By offering a discreet and user-friendly wearable device, the system
encourages consistent usage and longterm adherence to posture correction practices.

4
CHAPTER 2: LITERATURE SURVEY

This paper presents a wearable posture identification system designed to assess seated
posture using accelerometers. Two accelerometers are placed on the lumbar and cervical
spine to calculate posture angles via Arduino processing. Three experiments were
conducted: calibration to determine accelerometer error compared to a goniometer,
performance measurement to assess dynamic conditions, and real-time analysis. Results
indicate accelerometer errors of less than 3% compared to goniometer and
electrogoniometer readings, affirming the system's ability to monitor and identify both
good and bad sitting postures.[1]

For a population that is moving towards an elderly stage of development, Parkinson's


disease (PD) is characterized in the second place for the most common chronic
progressive neurodegenerative illness in the world after Alzheimer's disease, which
regularly affects older generation. In the next 30 years, this amount is estimated to double
due to the increase in the number of ageing people, as age is the leading key risk feature
for the start of PD. There are a variety of medications, such as levodopa available to treat
PD. With the latest advancement in healthcare technology, current researches permit the
monitoring of PD with the application of wearable sensor technology.[2]

This paper presents an architecture for information capture and analysis of sitting posture
using force sensor. We utilize force sensor and microcontroller to build a system for force
information. We fix positions of force sensors on seat cushions firstly. Then, we design
the circuits on microcontroller and obtain the data from sensors. There are different types
of information in deferent sitting postures. We analyze and categorize the information for
recognizing the sitting postures. This system could be utilized to detect the incorrect
sitting postures for children, patients or elder people in the future.[3]

Emerging evidence suggests that respiratory frequency (fR) is a valid marker of physical
effort. This has stimulated interest in developing devices that allow athletes and exercise
practitioners to monitor this vital sign. The numerous technical challenges posed by
breathing monitoring in sporting scenarios (e.g., motion artifacts) require careful
consideration of the variety of sensors potentially suitable for this purpose. Despite being
less prone to motion artifacts than other sensors (e.g., strain sensors), microphone sensors
have received limited attention so far.[4]

5
This book showcases the state of the art in the field of sensors and microsystems,
revealing the impressive potential of novel methodologies and technologies. It covers a
broad range of aspects, including: bio-, physical and chemical sensors; actuators; micro-
and nano- structured materials; mechanisms of interaction and signal transduction;
polymers and biomaterials; sensor electronics and instrumentation; analytical
microsystems, recognition systems and signal analysis; and sensor networks, as well as
manufacturing technologies, environmental, food and biomedical applications. The book
gathers a selection of papers presented at the 19th AISEM National Conference on
Sensors and Microsystems. Held in Lecce, Italy in February 2017, the event brought
together researchers, end users, technology teams and policy makers.[5]

Embedded hardware systems, such as wearable devices, are widely used for health status
monitoring of ageing people to improve their well-being. In this context, it becomes
increasingly important to develop portable, easy-to-use, compact, and energy-efficient
hardware-software platforms, to enhance the level of usability and promote their
deployment. With this purpose an automatic tri-axial accelerometer-based system for
postural recognition has been developed, useful in detecting potential inappropriate
behavioral habits for the elderly. Systems in the literature and on the market for this type
of analysis mostly use personal computers with high computing resources, which are not
easily portable and have high power consumption.[6]

6
CHAPTER 3: DESIGN

3.1 Introduction to IoT

Figure 3. 1 Example of an IoT System

The Internet of Things (IoT) involves connecting everyday objects to the internet,
enabling them to collect and exchange data. In the context of the "Guardian-Posture"
project, IoT devices are utilized to gather data from wearable sensors worn by individuals.
These IoT devices may include microcontrollers or small computing devices equipped
with wireless communication capabilities. The collected data, which may include
information about muscle activity and movement patterns, is transmitted over the internet
to a central monitoring system. This allows for remote access to the data and facilitates
real-time analysis and monitoring of muscle strain. Additionally, IoT technology enables
seamless integration with other systems and applications for further analysis and decision-
making.

IoT devices share the sensor data they collect by connecting to an IoT gateway,
which acts as a central hub where IoT devices can send data. Before the data is shared, it
can also be sent to an edge device where that data is analyzed locally. Analyzing data
locally reduces the volume of data sent to the cloud, which minimizes bandwidth
consumption.Sometimes, these devices communicate with other related devices and act
on the information they get from one another. The devices do most of the work without
human

7
intervention, although people can interact with the devices -- for example, to set them up,
give them instructions or access the data.

The connectivity, networking and communication protocols used with these web-
enabled devices largely depend on the specific IoT applications deployed.IoT can also use
artificial intelligence and machine learning to aid in making data collection processes
easier and more dynamic. An IoT system collects data from sensors installed in IoT
devices and transfers that data through an IoT gateway for it to be analyzed by an
application or back- end system. IoT is one of the most important technologies and it
continues to advance as more businesses realize the potential of connected devices to
keep them competitive.

3.2 Introduction to Embedded Systems

An embedded system is a computer system designed to perform one or a few


dedicated functions often with real-time computing constraints. It is embedded as part of
a complete device often including hardware and mechanical parts. By contrast, a general-
purpose computer, such as a personal computer (PC), is designed to be flexible and to
meet a wide range of end-user needs. Embedded systems control many devices in
common use today.

Embedded systems are controlled by one or more main processing cores that are
typically either microcontrollers or digital signal processors (DSP). The key
characteristic, however, is being dedicated to handle a particular task, which may require
very powerful processors. For example, air traffic control systems may usefully be
viewed as embedded, even though they involve mainframe computers and dedicated
regional and national networks between airports and radar sites. (Each radar probably
includes one or more embedded systems of its own.)

Since the embedded system is dedicated to specific tasks, design engineers can
optimize it to reduce the size and cost of the product and increase the reliability and
performance. Some embedded systems are mass-produced, benefiting from economies of
scale.

Physically embedded systems range from portable devices such as digital watches
and MP3 players, to large stationary installations like traffic lights, factory controllers, or
the systems controlling nuclear power plants. Complexity varies from low, with a single
8
microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.

In general, "embedded system" is not a strictly definable term, as most systems


have some element of extensibility or programmability. For example, handheld computers
share some elements with embedded systems such as the operating systems and
microprocessors which power them, but they allow different applications to be loaded and
peripherals to be connected. Moreover, even systems which don't expose programmability
as a primary feature generally need to support software updates. On a continuum from
"general purpose" to "embedded", large application systems will have subcomponents at
most points even if the system as a whole is "designed to perform one or a few dedicated
functions", and is thus appropriate to call "embedded".

3.3 Project Architecture and Schematic Diagram

Figure 3. 3. 1 Architecture of Guardian-Posture

The Guardian Posture Project architecture is designed to monitor and correct user posture
using advanced sensors, wireless communication, and cloud integration. Here's an
overview of the key components and their interactions:

9
1. Sensor Layer :
a) MPU6050 Gyroscope Sensor: Measures body orientation and angular
velocity. Captures tilt and lateral orientation, providing detailed posture information.
2. Wearable Device Layer :
a) NodeMCU Module: Facilitates wireless communication and connectivity.
Acts as a bridge between the wearable device and external systems.
b) Stimulation System: Employs electrodes to deliver electrical stimulation for
muscle
engagement. Rhythmic muscle contractions aid in alleviating back pain.
c) Real-time Alert Mechanism: Monitors posture continuously. Activates
alerts (buzzer and vibrator) if incorrect posture is sustained.
3. Communication Layer:
a) GSM Technology: Sends instant messages or notifications in case of a fall.
Enhances communication capabilities, especially in emergency situations.
b) NodeMCU and ThingSpeak Integration: Utilizes NodeMCU for
wireless communication. Integrates with ThingSpeak for cloud-based data storage
and analytics.Enables the transmission of posture data to the cloud for further
analysis and monitoring.
4. User Interface Layer:
a) LCD Display: Displays the current status of the project, including posture
information and system alerts. Enhances user understanding and engagement with
the wearable device.
b) Switch for Stimulator Control: Allows users to manually control the
stimulator,
activating or deactivating electrical stimulation as needed.
5. Power Management Layer:
a) Battery System: Manages the power supply to the wearable device.
Optimizes power consumption to extend battery life for prolonged usage.

10
Schematic Diagram of Guardian-Posture

Figure 3.3.2 Project Schematic Diagram

3.4 HARDWARE DESCRIPTION

3.4.1 Node MCU (ESP8266)

The ESP8266 is a low-cost Wi-Fi microchip, with built-in TCP/IP networking


software, and microcontroller capability, produced by Espressif Systems in Shanghai,
China. The ESP8266EX microcontroller integrates a Tensilica L106 32-bit RISC
processor, which achieves extra-low power consumption and reaches a maximum clock
speed of 160 MHz. The Real-Time Operating System (RTOS) and Wi-Fi stack allow
about 80% of the processing power to be available for user application programming and
development.

11
Figure 3. 4. 1. 1 ESP8266

ESP-12E Module(Wifi module)

Figure 3. 4.1.2 ESP-12E Module

The development board equips the ESP-12E module containing ESP8266 chip

12
having Tensilica Xtensa® 32-bit LX106 RISC microprocessor which operates at 80 to
160 MHz adjustable clock frequency and supports RTOS.

There’s also 128 KB RAM and 4MB of Flash memory (for program and data
storage) just enough to cope with the large strings that make up web pages, JSON/XML
data, and everything we throw at IoT devices nowadays. The ESP8266 Integrates
802.11b/g/n HT40 Wi-Fi transceiver, so it can not only connect to a WiFi network and
interact with the Internet, but it can also set up a network of its own, allowing other
devices to connect directly to it. This makes the ESP8266 NodeMCU even more versatile.

Power Requirement

Figure 3. 4. 1. 3 Power Requirement

As the operating voltage range of ESP8266 is 3V to 3.6V, the board comes with a
LDO voltage regulator to keep the voltage steady at 3.3V. It can reliably supply up to
600mA, which should be more than enough when ESP8266 pulls as much as 80mA
during RF transmissions. The output of the regulator is also broken out to one of the sides
of the board and labeled as 3V3. This pin can be used to supply power to external
components.

13
Power to the ESP8266 NodeMCU is supplied via the on-board MicroB USB
connector. Alternatively, if you have a regulated 5V voltage source, the VIN pin can be
used to directly supply the ESP8266 and its peripherals.

Peripherals and I/O

The ESP8266 NodeMCU has total 17 GPIO pins broken out to the pin headers on
both sides of the development board. These pins can be assigned to all sorts of peripheral
duties, including:

 ADC channel – A 10-bit ADC channel.


 UART interface – UART interface is used to load code serially.
 PWM outputs – PWM pins for dimming LEDs or controlling motors.
 SPI, I2C & I2S interface – SPI and I2C interface to hook up all sorts of sensors
and peripherals.
 I2S interface – I2S interface if you want to add sound to your project.

Figure 3. 4. 1. 4 Peripherals and I/O

The ESP8266’s pin multiplexing feature (Multiple peripherals multiplexed on a


single GPIO pin). Meaning a single GPIO pin can act as PWM/UART/SPI.

On-board Switches & LED indicator

The ESP8266 NodeMCU features two buttons. One marked as RST located on the
top left corner is the Reset button, used of course to reset the ESP8266 chip. The

14
other FLASH button on the bottom left corner is the download button used while
upgrading firmware.

Figure 3. 4.1.5 On-Board switches

The board also has a LED indicator which is user programmable and is connected
to the D0 pin of the board.

Serial Communication

The board includes CP2102 USB-to-UART Bridge Controller from Silicon Labs,
which converts USB signal to serial and allows your computer to program and
communicate with the ESP8266 chip.

Figure 3. 4.1.6 Serial Communication

15
ESP8266 NodeMCU Pinout

The ESP8266 NodeMCU has total 30 pins that interface it to the outside world. The
connections are as follows:

Figure 3. 4.1.7 ESP8266 NodeMCU Pinout

Power Pins: There are four power pins viz. one VIN pin & three 3.3V pins. The VIN pin
can be used to directly supply the ESP8266 and its peripherals, if you have a regulated 5V
voltage source. The 3.3V pins are the output of an on-board voltage regulator. These pins
can be used to supply power to external components.

GND: is a ground pin of ESP8266 NodeMCU development board.

I2C PINS: are used to hook up all sorts of I2C sensors and peripherals in your project.
Both I2C Master and I2C Slave are supported. I2C interface functionality can be realized
programmatically, and the clock frequency is 100 kHz at a maximum. It should be noted

16
that I2C clock frequency should be higher than the slowest clock frequency of the slave
device.

GPIO PINS: ESP8266 NodeMCU has 17 GPIO pins which can be assigned to various
functions such as I2C, I2S, UART, PWM, IR Remote Control, LED Light and Button
programmatically. Each digital enabled GPIO can be configured to internal pull-up or
pull- down, or set to high impedance. When configured as an input, it can also be set to
edge- trigger or level-trigger to generate CPU interrupts.

ADC CHANNEL: The NodeMCU is embedded with a 10-bit precision SAR ADC. The
two functions can be implemented using ADC viz. Testing power supply voltage of
VDD3P3 pin and testing input voltage of TOUT pin. However, they cannot be
implemented at the same time.

UART: ESP8266 NodeMCU has 2 UART interfaces, i.e. UART0 and UART1, which
provide asynchronous communication (RS232 and RS485), and can communicate at up to
4.5 Mbps. UART0 (TXD0, RXD0, RST0 & CTS0 pins) can be used for communication.
It supports fluid control. However, UART1 (TXD1 pin) features only data transmit signal
so, it is usually used for printing log.

SPI PINS: ESP8266 features two SPIs (SPI and HSPI) in slave and master modes. These
SPIs also support the following general-purpose SPI features:

 4 timing modes of the SPI format transfer


 Up to 80 MHz and the divided clocks of 80 MHz
 Up to 64-Byte FIFO
 ESP8266 features Sec

SDIO PINS: ESP8266 features Secure Digital Input/Output Interface (SDIO) which is
used to directly interface SD cards. 4-bit 25 MHz SDIO v1.1 and 4-bit 50 MHz SDIO
v2.0 are supported.

PWM PINS: The board has 4 channels of Pulse Width Modulation (PWM). The PWM
output can be implemented programmatically and used for driving digital motors and
LEDs. PWM frequency range is adjustable from 1000 μs to 10000 μs, i.e., between 100
Hz and 1 kHz.

17
CONTROL PINS: are used to control ESP8266. These pins include Chip Enable pin
(EN), Reset pin (RST) and WAKE pin.

 EN pin – The ESP8266 chip is enabled when EN pin is pulled HIGH. When
pulled LOW the chip works at minimum power.
 RST pin – RST pin is used to reset the ESP8266 chip.
 WAKE pin – Wake pin is used to wake the chip from deep-sleep.

3.4.2 Regulated Power Supply

Figure 3. 4. 2. 1 Regulated Power Supply

The basic circuit diagram of a regulated power supply (DC O/P) with led connected as
load is shown below.

Figure 3. 4. 2. 2 Circuit diagram of Power Supply

The components mainly used in above figure are

 230V AC MAINS
 TRANSFORMER

18
 BRIDGE RECTIFIER(DIODES)
 CAPACITOR
 VOLTAGE REGULATOR(IC 7805)
 RESISTOR
 LED(LIGHT EMITTING DIODE)

The detailed explanation of each and every component mentioned above is as


follows:

Transformation:

The process of transforming energy from one device to another is called


transformation. For transforming energy we use transformers.

Transformers:

A transformer is a device that transfers electrical energy from one circuit to


another through inductively coupled conductors without changing its frequency. A
varying current in the first or primary winding creates a varying magnetic flux in the
transformer's core, and thus a varying magnetic field through the secondary winding. This
varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the
secondary winding. This effect is called mutual induction.

If a load is connected to the secondary, an electric current will flow in the


secondary winding and electrical energy will be transferred from the primary circuit
through the transformer to the load. This field is made up from lines of force and has the
same shape as a bar magnet.

If the current is increased, the lines of force move outwards from the coil. If the
current is reduced, the lines of force move inwards.

If another coil is placed adjacent to the first coil then, as the field moves out or in,
the moving lines of force will "cut" the turns of the second coil. As it does this, a voltage
is induced in the second coil. With the 50 Hz AC mains supply, this will happen 50 times
a second. This is called MUTUAL INDUCTION and forms the basis of the transformer.

19
The input coil is called the PRIMARY WINDING; the output coil is the
SECONDARY WINDING.

Figure 3. 4. 2. 3 Transformer

The voltage induced in the secondary is determined by the TURNS RATIO.

For example, if the secondary has half the primary turns; the secondary will have
half the primary voltage.

Another example is if the primary has 5000 turns and the secondary has 500 turns,
then the turn’s ratio is 10:1.

If the primary voltage is 240 volts then the secondary voltage will be x 10 smaller
= 24 volts. Assuming a perfect transformer, the power provided by the primary must
equal the power taken by a load on the secondary. If a 24-watt lamp is connected across a
24 volt secondary, then the primary must supply 24 watts.

To aid magnetic coupling between primary and secondary, the coils are wound on
a metal CORE. Since the primary would induce power, called EDDY CURRENTS, into
this core, the core is LAMINATED. This means that it is made up from metal sheets
insulated from each other. Transformers to work at higher frequencies have an iron dust
core or no core at all.

Note that the transformer only works on AC, which has a constantly changing
current and moving field. DC has a steady current and therefore a steady field and there
would be no induction.

20
Some transformers have an electrostatic screen between primary and secondary.
This is to prevent some types of interference being fed from the equipment down into the
mains supply, or in the other direction. Transformers are sometimes used for
IMPEDANCE MATCHING.

We can use the transformers as step up or step down.

Step Up transformer:

In case of step up transformer, primary windings are every less compared to


secondary winding.

Because of having more turns secondary winding accepts more energy, and it
releases more voltage at the output side.

Step down transformer:

Incase of step down transformer, Primary winding induces more flux than the
secondary winding, and secondary winding is having less number of turns because of that
it accepts less number of flux, and releases less amount of voltage.

Rectification:

The process of converting an alternating current to a pulsating direct current is


called as rectification. For rectification purpose we use rectifiers.

Rectifiers:

A rectifier is an electrical device that converts alternating current (AC) to direct


current (DC), a process known as rectification. Rectifiers have many uses including as
components of power supplies and as detectors of radio signals. Rectifiers may be made
of solid-state diodes, vacuum tube diodes, mercury arc valves, and other components.

A device that it can perform the opposite function (converting DC to AC) is


known as an inverter.

21
When only one diode is used to rectify AC (by blocking the negative or positive
portion of the waveform), the difference between the term diode and the term rectifier is
merely one of usage, i.e., the term rectifier describes a diode that is being used to convert
AC to DC. Almost all rectifiers comprise a number of diodes in a specific arrangement
for more efficiently converting AC to DC than is possible with only one diode. Before the
development of silicon semiconductor rectifiers, vacuum tube diodes and copper (I) oxide
or selenium rectifier stacks were used.

Bridge full wave rectifier:

The Bridge rectifier, which converts an ac voltage to dc voltage using both half
cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure. The
circuit has four diodes connected to form a bridge. The ac input voltage is applied to the
diagonally opposite ends of the bridge. The load resistance is connected between the other
two ends of the bridge.

For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct,
whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in
series with the load resistance RL and hence the load current flows through RL.

For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct
whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series with
the load resistance RL and hence the current flows through R L in the same direction as in
the previous half cycle. Thus a bi-directional wave is converted into a unidirectional
wave.

Input Output

Figure 3. 4. 2. 4 Bridge Rectifier

22
DB107:

Now -a -days Bridge rectifier is available in IC with a number of DB107. In our


project we are using an IC in place of bridge rectifier. The picture of DB 107 is shown
below

Figure 3. 4. 2. 5 DB107

Features:

 Good for automation insertion


 Surge overload rating - 30 amperes peak
 Ideal for printed circuit board
 Reliable low cost construction utilizing molded
 Glass passivated device
 Polarity symbols molded on body
 Mounting position: Any
 Weight: 1.0 gram

Filtration:

The process of converting a pulsating direct current to a pure direct current using
filters is called as filtration.

Filters:

Electronic filters are electronic circuits, which perform signal-processing


functions, specifically to remove unwanted frequency components from the signal, to
enhance wanted ones.

23
Introduction to Capacitors:

The Capacitor or sometimes referred to as a Condenser is a passive device, and


one which stores energy in the form of an electrostatic field which produces a potential
(static voltage) across its plates. In its basic form a capacitor consists of two parallel
conductive plates that are not connected but are electrically separated either by air or by
an insulating material called the Dielectric. When a voltage is applied to these plates, a
current flows charging up the plates with electrons giving one plate a positive charge and
the other plate an equal and opposite negative charge. This flow of electrons to the plates
is known as the Charging Current and continues to flow until the voltage across the
plates (and hence the capacitor) is equal to the applied voltage Vcc. At this point the
capacitor is said to be fully charged and this is illustrated below.

Figure 3. 4. 2. 6 Capacitor

Figure 3. 4. 2. 7 Electrolytic Capacitor

24
Units of Capacitance:

Microfarad (μF) 1μF = 1/1,000,000 = 0.000001 = 10-6 F

Nanofarad (nF) 1nF = 1/1,000,000,000 = 0.000000001 = 10-9 F

Pico farad (pF) 1pF = 1/1,000,000,000,000 = 0.000000000001 = 10-12 F

Regulation:

The process of converting a varying voltage to a constant regulated voltage is


called as regulation. For the process of regulation we use voltage regulators.

Voltage Regulator:

A voltage regulator (also called a ‘regulator’) with only three terminals appears to
be a simple device, but it is in fact a very complex integrated circuit. It converts a varying
input voltage into a constant ‘regulated’ output voltage. Voltage Regulators are available
in a variety of outputs like 5V, 6V, 9V, 12V and 15V. The LM78XX series of voltage
regulators are designed for positive input. For applications requiring negative input, the
LM79XX series is used. Using a pair of ‘voltage-divider’ resistors can increase the output
voltage of a regulator circuit.

It is not possible to obtain a voltage lower than the stated rating. You cannot use a
12V regulator to make a 5V power supply. Voltage regulators are very robust. These can
withstand over-current draw due to short circuits and also over-heating. In both cases, the
regulator will cut off before any damage occurs. The only way to destroy a regulator is to
apply reverse voltage to its input. Reverse polarity destroys the regulator almost instantly.

Figure 3. 4. 2. 8 Voltage Regulator

25
Resistors:

A resistor is a two-terminal electronic component that produces a voltage across


its terminals that is proportional to the electric current passing through it in accordance
with Ohm's lawV = IR

Resistors are elements of electrical networks and electronic circuits and are
ubiquitous in most electronic equipment. Practical resistors can be made of various
compounds and films, as well as resistance wire (wire made of a high-resistivity alloy,
such as nickel/chrome).

The primary characteristics of a resistor are the resistance, the tolerance,


maximum working voltage and the power rating. Other characteristics include
temperature coefficient, noise, and inductance. Less well-known is critical resistance, the
value below which power dissipation limits the maximum permitted current flow, and
above which the limit is applied voltage. Critical resistance is determined by the design,
materials and dimensions of the resistor.

Resistors can be made to control the flow of current, to work as Voltage dividers,
to dissipate power and it can shape electrical waves when used in combination of other
components. Basic unit is ohms.

Figure 3. 4. 2. 9 Resistor

Power dissipation:

The power dissipated by a resistor (or the equivalent resistance of a resistor


network) is calculated using the following:

26
3.4.3 LED Indicator

A light-emitting diode (LED) is a semiconductor light source. LEDs are used as


indicator lamps in many devices, and are increasingly used for lighting. Introduced as a
practical electronic component in 1962, early LEDs emitted low-intensity red light, but
modern versions are available across the visible, ultraviolet and infrared wavelengths,
with very high brightness.

Figure 3. 4. 3 LED Indicator

3.4.4 MPU6050 Sensor

Gyroscope sensor (MPU6050)

A gyroscope or gyro is a device for measuring or maintaining orientation, based


on the principles of conservation of angular momentum. It will keep the original direction
of its rotation axis no matter which way the sensor is turned. The data received from this
module is useful in activity/posture recognition process because of the estimation of the
sensor orientation and rotation. The advantage compared to accelerometers orientation
estimation is in dynamic activities/postures. During these activities/postures the user
individual acceleration affects the estimation of the orientation using only acceleration
data, which corrupts the final estimation. In these situations the gyroscope and
magnetometer data are used as addition in orientation estimation.

27
Figure 3. 4. 4. 1 MPU6050 Gyroscope

Let’s see MPU6050 inside sensors.

3-Axis Gyroscope

The MPU6050 consist of 3-axis Gyroscope with Micro Electro Mechanical


System(MEMS) technology. It is used to detect rotational velocity along the X, Y, Z axes
as shown in below figure.

Figure 3. 4. 4. 2 3-Axis Gyroscope

• When the gyros are rotated about any of the sense axes, the Coriolis Effect
causes a vibration that is detected by a MEM inside MPU6050.
• The resulting signal is amplified, demodulated, and filtered to produce a
voltage that is proportional to the angular rate.
• This voltage is digitized using 16-bit ADC to sample each axis.
• The full-scale range of output are +/- 250, +/- 500, +/- 1000, +/- 2000.
• It measures the angular velocity along each axis in degree per second unit.

28
3-Axis Accelerometer

The MPU6050 consist 3-axis Accelerometer with Micro Electro Mechanical


(MEMs) technology. It used to detect angle of tilt or inclination along the X, Y and Z
axes as shown in below figure.

Figure 3. 4. 4. 3 3-Axis Accelerometer

- Acceleration along the axes deflects the movable mass.


- This displacement of moving plate (mass) unbalances the differential
capacitor which results in sensor output. Output amplitude is proportional to
acceleration.
- 16-bit ADC is used to get digitized output.
- The full-scale range of acceleration are +/- 2g, +/- 4g, +/- 8g, +/- 16g.
- It measured in g (gravity force) unit.
- When device placed on flat surface it will measure 0g on X and Y axis and
+1g on Z axis.

DMP (Digital Motion Processor)

The embedded Digital Motion Processor (DMP) is used to compute motion


processing algorithms. It takes data from gyroscope, accelerometer and additional 3rd
party sensor such as magnetometer and processes the data. It provides motion data like
roll, pitch, yaw angles, landscape and portrait sense etc. It minimizes the processes of host
in computing motion data. The resulting data can be read from DMP registers.

29
MPU-6050 Module

Figure 3. 4. 4. 4 MPU6050 Module

• The MPU-6050 module has 8 pins,


• INT: Interrupt digital output pin.
• AD0: I2C Slave Address LSB pin. This is 0th bit in 7-bit slave address of
device. If connected to VCC then it is read as logic one and slave address
changes.
• XCL: Auxiliary Serial Clock pin. This pin is used to connect other I2C
interface enabled sensors SCL pin to MPU-6050.
• XDA: Auxiliary Serial Data pin. This pin is used to connect other I2C
interface enabled sensors SDA pin to MPU-6050.
• SCL: Serial Clock pin. Connect this pin to microcontrollers SCL pin.
• SDA: Serial Data pin. Connect this pin to microcontrollers SDA pin.
• GND: Ground pin. Connect this pin to ground connection.
• VCC: Power supply pin. Connect this pin to +5V DC supply.
• MPU-6050 module has Slave address (When AD0 = 0, i.e. it is not connected
to Vcc) as,
• Slave Write address(SLA+W): 0xD0
• Slave Read address(SLA+R): 0xD1
• MPU-6050 has various registers to control and configure its mode of operation.
So, kindly go through MPU-6050 datasheet and MPU-6050 Register Map.

MPU6050 sensor module is complete 6-axis Motion Tracking Device. It combines 3-


axis Gyroscope, 3-axis Accelerometer and Digital Motion Processor all in small package.
Also, it has additional feature of on-chip Temperature sensor. It has I2C bus interface to
communicate with the microcontrollers.

30
It has Auxiliary I2C bus to communicate with other sensor devices like 3-axis
Magnetometer, Pressure sensor etc.

If 3-axis Magnetometer is connected to auxiliary I2C bus, then MPU6050 can


provide complete 9-axis Motion Fusion output.

3.4.5 Buzzer

Basically, the sound source of a piezoelectric sound component is a piezoelectric


diaphragm. A piezoelectric diaphragm consists of a piezoelectric ceramic plate which has
electrodes on both sides and a metal plate (brass or stainless steel, etc.). A piezoelectric
ceramic plate is attached to a metal plate with adhesives. Applying D.C. voltage between
electrodes of a piezoelectric diaphragm causes mechanical distortion due to the
piezoelectric effect. For a misshaped piezoelectric element, the distortion of the
piezoelectric element expands in a radial direction. And the piezoelectric diaphragm
bends toward the direction. The metal plate bonded to the piezoelectric element does not
expand. Conversely, when the piezoelectric element shrinks, the piezoelectric diaphragm
bends in the direction Thus, when AC voltage is applied across electrodes, the bending is
repeated, producing sound waves in the air.

Figure 3. 4. 5 Buzzer

To interface a buzzer the standard transistor interfacing circuit is used. Note that if
a different power supply is used for the buzzer, the 0V rails of each power supply must be
connected to provide a common reference.

If a battery is used as the power supply, it is worth remembering that piezo


sounders draw much less current than buzzers. Buzzers also just have one ‘tone’,
whereas a piezo sounder is able to create sounds of many different tones.

To switch on buzzer -high 1

31
To switch off buzzer -low 1

Notice (Handling) In Using Self Drive Method

• When the piezoelectric buzzer is set to produce intermittent sounds, sound may be
heard continuously even when the self drive circuit is turned ON / OFF at the "X"
point This is because of the failure of turning off the feedback voltage.
• Build a circuit of the piezoelectric sounder exactly as per the recommended circuit
shown in the catalog. Hfe of the transistor and circuit constants are designed to
ensure stable oscillation of the piezoelectric sounder.
• Design switching which ensures direct power switching.
• The self drive circuit is already contained in the piezoelectric buzzer. So there is
no need to prepare another circuit to drive the piezoelectric buzzer.
• Rated voltage (3.0 to 20Vdc) must be maintained. Products which can operate
with voltage higher than 20Vdc are also available.
• Do not place resistors in series with the power source, as this may cause abnormal
oscillation. If a resistor is essential to adjust sound pressure, place a capacitor
(about 1μF) in parallel with the piezo buzzer.
• Do not close the sound emitting hole on the front side of casing.
• Carefully install the piezo buzzer so that no obstacle is placed within 15mm from
the sound release hole on the front side of the casing.

3.4.6 LCD Display

Figure 3. 4. 6 LCD Display

32
LCD Background:

One of the most common devices attached to a micro controller is an LCD


display. Some of the most common LCD’s connected to the many microcontrollers are
16x2 and 20x2 displays. This means 16 characters per line by 2 lines and 20 characters
per line by 2 lines, respectively.

Pin description:

Pin No. Name Description


Pin no. 1 VSS Power supply (GND)
Pin no. 2 VCC Power supply (+5V)
Pin no. 3 VEE Contrast adjust
0 = Instruction input
Pin no. 4 RS
1 = Data input
0 = Write to LCD module
Pin no. 5 R/W
1 = Read from LCD module
Pin no. 6 EN Enable signal
Pin no. 7 D0 Data bus line 0 (LSB)
Pin no. 8 D1 Data bus line 1
Pin no. 9 D2 Data bus line 2
Pin no. 10 D3 Data bus line 3
Pin no. 11 D4 Data bus line 4
Pin no. 12 D5 Data bus line 5
Pin no. 13 D6 Data bus line 6
Pin no. 14 D7 Data bus line 7 (MSB)

Table 1: Character LCD pins with Microcontroller

The LCD requires 3 control lines as well as either 4 or 8 I/O lines for the data bus.
The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data
bus. If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines

33
plus the 4 lines for the data bus). If an 8-bit data bus is used the LCD will require a total of
11 data lines (3 control lines plus the 8 lines for the data bus).

The three control lines are referred to as EN, RS, and RW.

The EN line is called "Enable." This control line is used to tell the LCD that we
are sending it data. To send data to the LCD, our program should make sure this line is
low (0) and then set the other two control lines and/or put data on the data bus. When the
other lines are completely ready, bring EN high (1) and wait for the minimum amount of
time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing
it low
(0) again.

The RS line is the "Register Select" line. When RS is low (0), the data is to be
treated as a command or special instruction (such as clear screen, position cursor, etc.).
When RS is high (1), the data being sent is text data which should be displayed on the
screen. For example, to display the letter "T" on the screen we would set RS high.

The RW line is the "Read/Write" control line. When RW is low (0), the
information on the data bus is being written to the LCD. When RW is high (1), the
program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD
status") is a read command. All others are write commands--so RW will almost always be
low.

Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0,
DB1, DB2, DB3, DB4, DB5, DB6, and DB7.

3.4.7 GSM(Global System for Mobile Commmunication)

34
Figure 3. 4. 7 GSM

35
GSM, which stands for Global System for Mobile communications, reigns
(important) as the world’s most widely used cell phone technology. Cell phones use a cell
phone service carrier’s GSM network by searching for cell phone towers in the nearby
area. Global system for mobile communication (GSM) is a globally accepted standard for
digital cellular communication.

GSM is the name of a standardization group established in 1982 to create a


common European mobile telephone standard that would formulate specifications for a
pan- European mobile cellular radio system operating at 900 MHz. It is estimated that
many countries outside of Europe will join the GSM partnership.

MODEM SPECIFICATIONS:

SIM800L is a quad-band GSM/GPRS module, that works on frequencies


GSM850MHz, EGSM900MHz, DCS1800MHz and PCS1900MHz. SIM800L features
GPRS multi-slot class 12/ class 10 (optional) and supports the GPRS coding schemes CS-
1, CS-2, CS-3 and CS-4.

With a tiny configuration of 15.8*17.8*2.4mm, SIM800L can meet almost all the
space requirements in user applications, such as smart phone, PDA and other mobile
devices.

SIM800L has 88pin pads of LGA packaging, and provides all hardware
interfaces between the module and customers’ boards.

• Support 5*5*2 keypads


• One full modem serial port, user can configure two serial ports
• One USB, the USB interfaces can debug, download software
• Audio channel which includes two microphone input; a receiver output and
a speaker output
• Programmable general purpose input and output.
• A SIM card interface
• Support FM
• Support one PWM

1. SIM800L is designed with power saving technique so that the current


consumption is as low as 0.7mA in sleep mode.

36
2. GSM COMMANDS:

Commands always start with AT (which means Attention) and finish with a
<CR> character.

3. Information responses and result codes


Responses start and end with <CR><LF>, except for the ATV0 DCE
response format) and the ATQ1 (result code suppression) commands.

_ If command syntax is incorrect, an ERROR string is returned.

_ If command syntax is correct but with some incorrect parameters, the +CME
ERROR:
4. <Err> or +CMS ERROR: <Sms Err> strings are returned with different error
codes.
5. _ If the command line has been performed successfully, an OK string is returned.
6. In some cases, such as “AT+CPIN?” or (unsolicited) incoming events, the
product does not return the OK string as a response.
7. In the following examples <CR> and <CR><LF> are intentionally omitted.
o Manufacturer identification +CGMI
o Request model identification +CGMM
o Request revision identification +CGMR
o Product Serial Number +CGSN
o Dial command D
o ATD<nb> where <nb> is the destination phone number.
o Please note that for an international number, the local international
prefix does not need to be set (usually 00) but does need to be replaced by
the ‘+’ character.
o Example: to set up a voice call to Wavecom offices from another country,
the AT command is:
o “ATD+33146290800;”
o Note that some countries may have specific numbering rules for their
GSM handset numbering. The response to the ATD command is one of the
following:
o Hang-Up command H
o Description:

37
 The ATH (or ATH0) command disconnects the remote user. In the
case of multiple calls, all calls are released (active, on-hold and
waiting calls). The specific Wavecom ATH1 command has been
appended to disconnect the current outgoing call, only in dialing or
alerting state (ie. ATH1 can be used only after the ATD command,
and before its terminal response (OK, NO CARRIER, ...). It can be
useful in the case of multiple calls.
o Syntax:
o Command syntax: ATH
• Answer a call A
o Description:
o When the product receives a call, it sets the RingInd signal and sends the
ASCII “RING” or
o “+CRING: <type>” string to the application (+CRING if the cellular
result code +CRC is enabled). Then it waits for the application to accept
the call with the ATA command.
o Syntax:
o Command syntax: ATA
• Redial last telephone number ATDL
o Description:
o This command redials the last number used in the ATD command. The
last number dialed is displayed followed by “;” for voice calls only
o Syntax:
o Command syntax: ATDL
• Preferred Message Format +CMGF
o Description:
o The message formats supported are text mode and PDU mode. In PDU
mode, a complete SMS Message including all header information is given
as a binary string (in hexadecimal format). Therefore, only the following
set of characters is allowed: {‘0’,’1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’, ‘A’,
‘B’,’C’,’D’,’E’,’F’}. Each pair or characters are converted to a byte (e.g.:
‘41’ is converted to the ASCII character ‘A’, whose ASCII code is 0x41 or
65). In Text mode, all commands and responses are in ASCII characters. The
format selected is stored in EEPROM by the +CSAS command.

38
o Syntax:
o Command syntax: AT+CMGF
• Read message +CMGR
o Description:
o This command allows the application to read stored messages. The
messages are read from the memory selected by +CPMS command.
o Syntax:
o Command syntax: AT+CMGR=<index>
• Send message +CMGS
o Description:
o The <address> field is the address of the terminal to which the message is
sent. To send the message, simply type, <ctrl-Z> character (ASCII 26).
The text can contain all existing characters except <ctrl-Z> and <ESC>
(ASCII 27). This command can be aborted using the <ESC> character
when entering text. In PDU mode, only hexadecimal characters are used
(‘0’…’9’,’A’…’F’).
o Syntax:
o AT+CMGS= <length> <CR>
o PDU is entered <ctrl-Z / ESC >
• Delete message +CMGD
o Description:
o This command deletes one or several messages from preferred message
storage (“BM” SMS CB ‘RAM storage’, “SM” SMSPP storage ‘SIM
storage’ or “SR” SMS Status-Report storage).
o Syntax:
• Command syntax: AT+CMGD=<Index> [,<DelFalg>]

3.4.8 Vibration

A vibrating alert is a feature of communications devices to notify the user of an


incoming connection. It is particularly common on mobile phones and pagers and usually
supplements the ring tone.

39
Vibrating alerts are primarily used when a user cannot hear the ring tone (a noisy
environment or through hearing loss) or wants a more discreet notification. However
when the device is placed on a hard surface it can often be as loud as a ringtone.

Most 21st-century mobile phones are fitted with a vibrating alert, one of the
exceptions being the Nokia 9500: due to the large size of this phone a larger motor would
be required to make the phone vibrate. The phone itself would absorb too much of the
vibration and therefore the motor required to make it vibrate was too big and could
damage the phone.

The vibrating alert is produced by a small electric motor connected to an eccentric


(unbalanced) weight.

Electronic Components
Vibration motor is a compact size coreless DC motor used to informs the users of
receiving the signal by vibrating, no sound. Vibration motors are widely used in a variety
of applications including cell phones, handsets, pagers, and so on.
The main features of vibration motor is the magnet coreless DC motor are
permanent, which means it will always have its magnetic properties (unlike an
electromagnet, which only behaves like a magnet when an electric current runs through
it); another main feature is the size of the motor itself is small, and thus light weight.
Moreover, the noise and the power consumption that the motor produce while using are
low. Based on those features, the performance of the motor is highly reliable. The
vibration motors are configured in two basic varieties: coin (or flat) and cylinder (or bar).
There are some components in both of their internal constructions.

40
Figure 3. 4. 8 Vibration Motor

Rotor:
The rotor is the non-stationary part of a rotary electric motor. The wires and
magnetic field of the motor are arranged so that a torque is developed about the rotor's
axis. In some designs, the rotor can act to serve as the motor's armature, across which the
input voltage is supplied.
Stator:
The stator is the stationary part of a rotary electric motor. It could be worked as
the magnet field and interact with the armature to create motion. Another function of the
stator is it could act as the armature, which receives its influence from moving field coils
on the rotor.
Commutator:
A commutator is a rotary electrical switch in certain types of electric motors or
electrical generators that periodically reverses the current direction between the rotor and
the external circuit. In a motor, it applies power to the best location on the rotor, and in a
generator, picks off power similarly. As a switch, it has exceptionally long life,
considering the number of circuit makes and breaks that occur in normal operation.

41
Armature:
The armature in this motor is a set of thin metal plates stacked together, with thin
copper wire coiled around each of the three poles of the armature. (How the electric
motor works) The main function of the armature is to convert the magnetic energy into
the kinetic energy.
Windings:
Windings are consisted with some turns of coils. These coils are assembled to
generate a magnetic field once electricity goes through them.
Weight:
In order to make a vibrating alerts, a weight mass need to be attached to the shaft.
Through the high speed displacement of weight, the vibration can be achieved. Moreover,
the magnitude of the force can be controlled and adjusted, and the factors that could affect
it will be discussed below.
Load:
Load is defined as the output of a circuit connected to the device. In motor
selection, load can be defined as the torque needed to operate the whole system. The
magnitude of load can be a constant, or it can be varied by time.
Power:
Power is the product of speed and torque. The maximum power of a DC motor is
produced at the operating point that is defined by operation at half the no-load speed and
half the stall torque.
Torque:
The relationship between torque and speed is called a characteristic of the
operating system. This DC motor's characteristic varies based on three different
magnetization sources: separately excited field, self-excited field or permanent-field,
which is used selectively to control the motor over the mechanical load's range.
Beside these requirements, some restrictions exist as well that limit the motor
selection. The major constraint on motor operation is thermal in nature. The heat a motor
must dissipate can always be calculated as follows:
Pdis = I^2 x R
Heat dissipated= current through the motor squared, multiplied by the terminal resistance.
The current through a motor is determined by the torque the motor produces. Current and
torque is related by the torque constant of the motor:
I = Mo / kM

42
Current through motor = torque produced divided by the torque constant

The primary function of the vibration motor is to alert the user to incoming calls.
Vibration motors are normally classified into cylinder type and button type. Here, we will
look at how the cylinder type works.

FEATUREs AND APPLICATIONS

● Features

o Permanent magnet coreless DC motor.


o Miniature Size, light weight.
o Smooth rotation due to no cogging
o Low noise and low power consumption
o Highly Reliable Performance

● Applications

o Mobile phone
o PCS (Personal Communication by Satellite)
o PDA (Personal Digital Assistants)
o Game machine, Toy

3.4.9 Muscle Stimulator

Figure 3. 9 Muscle Stimulator

43
Muscle stimulators, also known as neuromuscular electrical stimulation (NMES)
devices, are gadgets designed to elicit muscle contractions through electrical impulses.
These devices are commonly used in physical therapy, sports training, and rehabilitation
settings. By delivering electrical currents to targeted muscle groups, muscle stimulators
can help improve muscle strength, increase blood circulation, and alleviate pain. They
work by mimicking the natural signals sent by the central nervous system to activate
muscles. Users can adjust the intensity and frequency of the electrical impulses to suit
their needs and goals. While muscle stimulators can offer benefits such as muscle
recovery and enhanced performance, they should be used cautiously, following guidelines
to prevent misuse or overstimulation that could potentially cause harm.

Applications of Muscle Stimulators

 Physical Therapy and Rehabilitation: Muscle stimulators are commonly used in


rehabilitation settings to prevent muscle atrophy, improve muscle strength, and aid
in the recovery process after injuries or surgeries.
 Sports Training and Performance Enhancement: Athletes and fitness
enthusiasts use muscle stimulators to complement their training regimens by
targeting specific muscle groups, enhancing muscle recruitment, and accelerating
recovery between workouts.
 Pain Management: Muscle stimulators can help alleviate pain by stimulating the
release of endorphins, blocking pain signals, and improving blood circulation,
making them useful in managing chronic pain conditions such as lower back pain
or arthritis.
 Muscle Recovery: After intense workouts or competitions, muscle stimulators
can promote muscle recovery by increasing blood flow, reducing inflammation,
and flushing out metabolic waste products, helping athletes recover faster and
perform at their best.
 Muscle Activation: In cases where certain muscles are underactive or weak,
muscle stimulators can be used to activate those muscles, aiding in neuromuscular
re-education and restoring proper movement patterns.
 Cosmetic and Aesthetic Uses: Muscle stimulators are also used in cosmetic
treatments to tone and firm muscles, such as in facial toning or body contouring
procedures.

44
 Research and Development: Muscle stimulators play a crucial role in scientific
research to study muscle physiology, neuromuscular function, and the effects of
electrical stimulation on muscle performance and adaptation.

3.5 SOFTWARE DESCRIPTION

3.5.1 Express PCB

Figure 3.5.1 Express PCB

Breadboards are great for prototyping equipment as it allows great flexibility to


modify a design when needed; however the final product of a project, ideally should have
a neat PCB, few cables, and survive a shake test. Not only is a proper PCB neater but it is
also more durable as there are no cables which can yank loose.

Express PCB is a software tool to design PCBs specifically for manufacture by the
company Express PCB (no other PCB maker accepts Express PCB files). It is very easy
to use, but it does have several limitations.

 It can be likened to more of a toy then a professional CAD program.

45
 It has a poor part library (which we can work around)
 It cannot import or export files in different formats
 It cannot be used to make prepare boards for DIY production

Express PCB has been used to design many PCBs (some layered and with surface-
mount parts. Print out PCB patterns and use the toner transfer method with an Etch
Resistant Pen to make boards. However, Express PCB does not have a nice print layout.
Here is the procedure to design in Express PCB and clean up the patterns so they print
nicely.

Preparing Express PCB for First Use:

Express PCB comes with a less then exciting list of parts. So before any project is
started head over to Audio logic and grab the additional parts by morsel, ppl, and tangent,
and extract them into your Express PCB directory. At this point start the program and get
ready to setup the workspace to suit your style.

Click View -> Options. In this menu, setup the units for “mm” or “in” depending
on how you think, and click “see through the top copper layer” at the bottom. The
standard color scheme of red and green is generally used but it is not as pleasing as red
and blue.

The Interface:

When a project is first started you will be greeted with a yellow outline. This
yellow outline is the dimension of the PCB. Typically after positioning of parts and
traces, move them to their final position and then crop the PCB to the correct size.
However, in designing a board with a certain size constraint, crop the PCB to the correct
size before starting.

Tools:

 The select tool: It is fairly obvious what this does. It allows you to move and
manipulate parts. When this tool is selected the top toolbar will show buttons to
move traces to the top / bottom copper layer, and rotate buttons.
 The zoom to selection tool: does just that.
 The place pad: button allows you to place small soldier pads which are useful for

46
board connections or if a part is not in the part library but the part dimensions are

47
available. When this tool is selected the top toolbar will give you a large selection of
round holes, square holes and surface mount pads.
 The place component: tool allows you to select a component from the top toolbar
and then by clicking in the workspace places that component in the orientation
chosen using the buttons next to the component list. The components can always
be rotated afterwards with the select tool if the orientation is wrong.
 The place trace: tool allows you to place a solid trace on the board of varying
thicknesses. The top toolbar allows you to select the top or bottom layer to place
the trace on.
 The Insert Corner in trace: button does exactly what it says. When this tool is
selected, clicking on a trace will insert a corner which can be moved to route
around components and other traces.
 The remove a trace button is not very important since the delete key will achieve
the same result.

Design Considerations:

Before starting a project there are several ways to design a PCB and one must be
chosen to suit the project’s needs.

Single sided, or double sided?

When making a PCB you have the option of making a single sided board, or a
double sided board. Single sided boards are cheaper to produce and easier to etch, but
much harder to design for large projects. If a lot of parts are being used in a small space it
may be difficult to make a single sided board without jumpering over traces with a cable.
While there’s technically nothing wrong with this, it should be avoided if the signal
travelling over the traces is sensitive (e.g. audio signals).

A double sided board is more expensive to produce professionally, more difficult


to etch on a DIY board, but makes the layout of components a lot smaller and easier. It
should be noted that if a trace is running on the top layer, check with the components to
make sure you can get to its pins with a soldering iron. Large capacitors, relays, and
similar parts which don’t have axial leads can NOT have traces on top unless boards are
plated professionally.

48
Ground-plane or other special purposes for one side?

When using a double sided board you must consider which traces should be on
what side of the board. Generally, put power traces on the top of the board, jumping
only to the bottom if a part cannot be soldiered onto the top plane (like a relay), and
vice- versa.

Some projects like power supplies or amps can benefit from having a solid plane
to use for ground. In power supplies this can reduce noise, and in amps it minimizes the
distance between parts and their ground connections, and keeps the ground signal as
simple as possible. However, care must be taken with stubborn chips such as the
TPA6120 amplifier from TI. The TPA6120 datasheet specifies not to run a ground
plane under the pins or signal traces of this chip as the capacitance generated could
effect performance negatively.

3.5.2 Arduino IDE Studio Compiler

Figure 3.5.2 Arduino IDE Studio


49
Arduino IDE setup:

Setting up the Arduino IDE (Integrated Development Environment) is relatively


straightforward. Here's a step-by-step guide:

Step-1 Download Arduino IDE:

Visit the official Arduino website (https://www.arduino.cc/en/software) and


download the Arduino IDE for your operating system (Windows, macOS, or Linux).

Step-2 Install Arduino IDE:

Once the download is complete, follow the installation instructions provided by


the installer wizard. Installation is typically a matter of running the downloaded
executable file and following the prompts.

Step-3 Connect Arduino Board:

If you haven't already, connect your Arduino board to your computer using a USB
cable. Make sure the board is properly connected and recognized by your operating
system.

Step-4 Launch Arduino IDE:

After installation, launch the Arduino IDE. You'll be greeted with a simple
interface with a text editor area for writing your code and a toolbar with various buttons
and menus.

Step-5 Select Board:

Go to the "Tools" menu, then "Board," and select the appropriate Arduino board
that you're using. If you're unsure, you can usually find the board model written on the
board itself.

Step-6 Select Port:

While still in the "Tools" menu, navigate to the "Port" option and select the port
that corresponds to your Arduino board. On Windows, it will typically be something like
"COMX," and on macOS or Linux, it will be "/dev/ttyX."

Step-7 Test Connection (Optional):

You can test whether your Arduino board is properly recognized by uploading a
simple sketch (e.g., Blink) to the board. Open the "File" menu, go to "Examples," select
"01.Basics," and choose "Blink." Click the "Upload" button (right arrow icon) to compile
and upload the sketch to your Arduino board.

Step-8 Start Coding:

You're now ready to start coding! You can write your own Arduino sketches in the
text editor area. Refer to Arduino's extensive documentation and example sketches to get

50
started with programming your Arduino board.

51
3.5.3 Procedural steps for compilation and stimulation

Installing the ESP8266 Core on Windows OS:

Let’s proceed with installing ESP8266 Arduino core.

The first thing is having latest Arduino IDE (Arduino 1.6.4 or higher) installed on
your PC. If don’t have it, we recommend upgrading now.

Latest Arduino IDE

To begin, we’ll need to update the board manager with a custom URL. Open up
Arduino IDE and go to File > Preferences. Then, copy below URL into the Additional
Board Manager URLs text box situated on the bottom of the window:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Figure 3. 4. 5. 1 Arduino setup

Hit OK. Then navigate to the Board Manager by going to Tools > Boards >
Boards Manager. There should be a couple new entries in addition to the standard
Arduino boards. Filter your search by typing esp8266. Click on that entry and select
Install.

52
Figure 3. 4. 5. 2 Arduino Boards selection

The board definitions and tools for the ESP8266 include a whole new set of gcc,
g++, and other reasonably large, compiled binaries, so it may take a few minutes to
download and install (the archived file is ~110MB). Once the installation has completed,
a small INSTALLED text will appear next to the entry. You can now close the Board
Manager.

Arduino Example: Blink

To make sure ESP8266 Arduino core and the NodeMCU are properly set up, we’ll
upload the simplest sketch of all – The Blink!

We will use the on-board LED for this test. As mentioned earlier in this tutorial,
D0 pin of the board is connected to on-board Blue LED & is user programmable. Perfect!

Before we get to uploading sketch & playing with LED, we need to make sure that
the board is selected properly in Arduino IDE. Open Arduino IDE and select NodeMCU
0.9 (ESP-12 Module) option under your Arduino IDE > Tools > Board menu.

53
Figure 3. 4. 5. 3 Module selection

Now, plug your ESP8266 NodeMCU into your computer via micro-B USB cable.
Once the board is plugged in, it should be assigned a unique COM port. On Windows
machines, this will be something like COM#, and on Mac/Linux computers it will come
in the form of /dev/tty.usbserial-XXXXXX. Select this serial port under the Arduino
IDE > Tools > Port menu. Also select the Upload Speed : 115200

54
Figure 3. 4. 5. 4 Port selection

void setup()
{
pinMode(D0, OUTPUT);
}
void loop()
{
digitalWrite(D0,
HIGH); delay(500);
digitalWrite(D0, LOW);
delay(500);
}

Once the code is uploaded, LED will start blinking. You may need to tap the
RST button to get your ESP8266 to begin running the sketch.

Figure 3. 4. 5. 4 LED Blink on ESP8266

55
3.5.4 Thing Speak

ThingSpeak is an innovative platform that enables users to collect, analyze, and


visualize data from Internet of Things (IoT) devices in real-time. Developed by
MathWorks, it offers a cloud-based infrastructure that simplifies the process of building
IoT applications and monitoring sensor data. ThingSpeak allows users to easily connect
their IoT devices, such as sensors and actuators, to the platform using various
communication protocols like MQTT, HTTP, and TCP/IP.

Once the data is uploaded to ThingSpeak, users can perform a wide range of data
processing tasks, including data aggregation, filtering, and analysis, using built-in
MATLAB functions or custom MATLAB code. Additionally, ThingSpeak provides
powerful visualization tools, allowing users to create customizable charts, graphs, and
gauges to display their data in a meaningful and intuitive way. Furthermore, ThingSpeak
supports real-time alerts and notifications based on user-defined thresholds, enabling
proactive monitoring and response to critical events. One of the most compelling features
of ThingSpeak is its open nature, which encourages collaboration and sharing within the
IoT community.

Users can share their data publicly or privately, collaborate with others on
projects, and access a wealth of publicly available data sets for research and
experimentation. Overall, ThingSpeak empowers individuals and organizations to harness
the power of IoT by providing a user-friendly platform for collecting, analyzing, and
visualizing sensor data, thereby facilitating innovation and discovery in various domains
such as agriculture, environmental monitoring, smart cities, and industrial automation.

How to setup ThingSpeak?

1. Create a ThingSpeak Account:

Visit the ThingSpeak website (https://thingspeak.com/) and sign up for an account


if you don't have one already. You can sign up using your email address or through a
third- party account like Google or GitHub.

2. Create a New Channel:

Once logged in, navigate to the "Channels" tab and click on "New Channel" to
create a new channel. Give your channel a name, description, and assign field labels to
the data you plan to collect (e.g., temperature, humidity, etc.). Click "Save Channel" to
create your channel.

56
Figure 3. 5. 4. 1 ThingSpeak Channel creation

3. Get Your Channel API Keys:

After creating your channel, you'll be provided with two API keys: the "Write API
Key" and the "Read API Key." These keys are used to authorize data uploads and
retrievals to and from your ThingSpeak channel, respectively. Keep these keys secure, as
they are essential for accessing your channel programmatically.

Figure 3. 5. 4. 2 ThingSpeak API Key generation

4. Configure Your IoT Device or Application:

Configure your IoT device or application to send data to your ThingSpeak


channel. This typically involves programming your device to make HTTP POST requests
to the ThingSpeak API with the data you want to upload. You'll need to use the Write
API Key obtained in the previous step to authenticate these requests.

57
5. Send Data to ThingSpeak:

Start sending data from your IoT device to ThingSpeak by making HTTP POST
requests to the ThingSpeak API endpoint (https://api.thingspeak.com/update). Include
your channel ID and the field values you want to update in the request parameters, along
with your Write API Key for authentication.

6. Visualize and Analyze Data:

Once data is being sent to your ThingSpeak channel, you can visualize and
analyze it using the built-in tools provided by ThingSpeak. Navigate to your channel's
page, where you'll find options to view your data in charts, graphs, and gauges. You can
customize the visualization settings and even set up MATLAB analysis scripts to perform
more advanced data processing.

7. Explore Additional Features:

ThingSpeak offers various additional features and integrations that you can
explore, such as MATLAB analysis, React, and ThingHTTP. These features allow for
advanced data analysis, webhooks, and integration with third-party services, expanding
the capabilities of your IoT applications.

58
CHAPTER 4: RESULTS

4.1 Results

Figure 4.1.1 GOOD POSTURE

The above figure features an individual seated and stood with proper alignment,
demonstrating an exemplary posture. This serves as a visual representation of the ideal
sitting posture that users should strive to maintain for musculoskeletal health and comfort.

Figure 4.1.2 Gyroscope LED Blink(green)

59
When the LED blinks green as shown in Figure 4.1.2 it depicts that the person is
standing or sitting with good posture

Figure 4.1.3 BAD POSTURE

The above image depicts an individual seated with improper alignment,


showcasing a common example of bad posture. This serves as a visual representation of
the postural habits that can contribute to muscle strain, discomfort, and long-term
musculoskeletal issues.

Figure 4.1.4 LED blink of Relay(red)

When the LED blinks red as shown in Figure 4.1.4 it depicts that the person is standing or
sitting with bad posture

60
Figure 4.1.5 LCD Display-Bad Posture

The LCD display the Abnormal Posture message when a person is in wrong posture.

Figure 4.1.6 Buzzer ON if it detects bad posture

Buzzer gets ON if it is notified with the bad posture.

61
Figure 4.1.7 Muscle stimulators activation.

Electronic muscle stimulators work by sending electrical signals to contract our muscles.

Figure 4.1.8 The GSM Module And FALL ALERT!! Notification

The Guardian Posture system incorporates a GSM fall alert feature designed to
swiftly respond to detected falls and ensure the safety of individuals with disabilities.
Upon sensing a sudden and significant change in orientation indicative of a fall, the
system triggers the GSM module to send an immediate alert message to a predefined
mobile number. This rapid response mechanism ensures that assistance can be promptly
provided

62
to the individual in distress. Within a timeframe of 5 seconds from the detected fall event,
the GSM module initiates the transmission of an alert message containing relevant
information, such as the individual's location and status, to designated caregivers or
emergency contacts.

This enables timely intervention and support in the event of a fall-related


emergency, enhancing the overall safety and well-being of the user. Beyond its primary
function of ensuring user safety, the GSM fall alert feature empowers individuals with
disabilities to maintain a sense of independence and autonomy in their daily activities.
Knowing that assistance is readily available in case of emergencies provides peace of
mind and promotes confidence in navigating their environment.

SENSOR DATA and ThingSpeak Analysis

Figure 4.1.9 Various Readings of Gyroscope Sensor

63
The above image illustrates a key feature of the Guardian Posture project, wherein
gyroscope sensor data is displayed on an LCD screen in three axes: X, Y, and Z. The
setting depicts a close-up of the LCD screen with the graphical representation of the
sensor data.

Figure 4.1.10 Visualization of sensor data in ThingSpeak

The image portrays a pivotal feature of the Guardian Posture project, showcasing
the visualization of gyroscope sensor data on ThingSpeak with three axes: X, Y, and Z.
The image depicts a graphical representation of the sensor data displayed on a computer
screen, with each axis. By visualizing gyroscope sensor data on ThingSpeak, the
Guardian Posture system enhances posture monitoring capabilities. Users can track their
posture quality and stability over time, identify trends, and make informed adjustments to
improve posture habits and musculoskeletal health.

64
Figure 4.1.11 Sensor Data in CSV file

The image illustrates a key feature of the Guardian Posture project, showcasing
the option to export gyroscope sensor data as an Excel sheet file. The image depicts a
computer screen displaying an Excel spreadsheet containing posture analysis data over
time, including three-axis data for X, Y, and Z. Users have the option to export gyroscope
sensor data as an Excel sheet file for offline analysis and record-keeping. The exported
Excel file contains posture analysis data captured over time, including timestamped
measurements for X, Y, and Z axes.

The exported Excel file facilitates posture analysis time-to-time, allowing users to
track posture dynamics and changes over different intervals. By examining posture data
across multiple time points, users can identify trends, patterns, and areas for improvement
in their sitting habits.

The Guardian-Posture system promises to revolutionize healthcare and eldercare


by offering continuous monitoring and early detection of postural abnormalities,
enhancing patient safety and quality of life. Its applications extend to workplace safety,
ergonomics, and rehabilitation, where it can prevent injuries and optimize performance
outcomes. With potential integration of robotic assistance, the system holds promise for
fall prevention among the elderly and individuals with mobility challenges. As
technology evolves, this project represents a beacon of hope for effectively addressing
and mitigating posture- related issues, ushering in a future of improved musculoskeletal
health and wellness.
65
4.2 Pseudocode

#include

<Adafruit_MPU6050.h>

#include <Adafruit_Sensor.h>

#include <Wire.h>

#include <LiquidCrystal_I2C.h>

#include <ESP8266WiFi.h>

#include "ThingSpeak.h"

#include <stdio.h>

#include <string.h>

Adafruit_MPU6050 mpu;

int st = D5;

int vib = D6;

int buz = D7;

const char* ssid = "project6446"; // Your ssid

const char* password = "123456789"; // Your Password

WiFiClient client;

String myStatus = "";

const char * myWriteAPIKey = "JP1MPTMPK6WW2544";

66
String number1="+917993797003";

void setup(void) {

Serial.begin(115200);

//while (!Serial)

lcd.init();

lcd.print("Welcome To

"); lcd.setCursor(0, 1);

lcd.print("The Project");

delay(2000);

WiFi.begin(ssid, password);

pinMode(vib,OUTPUT);

pinMode(st,OUTPUT);

pinMode(buz,OUTPUT);

digitalWrite(buz,1);

digitalWrite(vib,1);

delay(700);

digitalWrite(vib,1);

delay(700);

digitalWrite(vib,0);

ThingSpeak.begin(client); // Initialize ThingSpeak

67
}

int tcount = 0;

void loop() {

/* Get new sensor events with the readings

*/ sensors_event_t a, g, temp;

mpu.getEvent(&a, &g, &temp);

float ax = abs(a.acceleration.x);

float ay = abs(a.acceleration.y);

float az = abs(a.acceleration.z);

lcd.clear();

lcd.setCursor(0,

0); lcd.print("X::");

lcd.print(ax);

lcd.print(" Y:");

lcd.print(ay);

lcd.setCursor(0,

1); lcd.print("Z: ");

lcd.print(az);

delay(1000);

68
int i = 0;

if((ax > 2) || (ay > 2))

digitalWrite(vib,1);

lcd.clear();

lcd.setCursor(0,

0);

lcd.print("Abnormal Posture");

while(i < 100)

digitalWrite(st,1);

delay(10);

digitalWrite(st,0);

delay(10);

i++;

else

digitalWrite(vib,0);

if((ax > 8) || (ay > 8))

{
69
digitalWrite(buz,1);

Serial.println("AT+CMGF=1");

delay(700);

Serial.print(number1);

Serial.println("\"");

delay(700);

Serial.println("*** Fall Alert ***");

delay(2500);

Serial.write(26);

digitalWrite(buz,0);

tcount++;

if(tcount >

25)0

tcount = 0;

ThingSpeak.setField(1, ax);

ThingSpeak.setField(2, ay);

ThingSpeak.setField(3, az);

ThingSpeak.setStatus(myStatus);

updating channel. HTTP error code " + String(x));


70
}

delay(500);

71
CHAPTER 5 : CONCLUSION

5.1 Conclusion

The Guardian-Posture project represents a pioneering endeavor in addressing the


pervasive musculoskeletal issues exacerbated by sedentary lifestyles in the modern era.
Through the fusion of wearable sensor technology, advanced algorithms, and user-
centered design, it offers a comprehensive solution for monitoring and mitigating muscle
strain in real-time. By seamlessly integrating into daily routines without impeding
mobility, the system fosters heightened awareness of posture and empowers users to
cultivate proactive habits for musculoskeletal well-being.

Key features such as personalized recommendations, timely alerts, and a user-


friendly interface underscore the project's commitment to enhancing user experience and
promoting informed decision-making regarding posture. The anticipated outcomes,
including the development of a real-time posture recognition algorithm and exploration of
diverse applications in healthcare, eldercare, workplace safety, and ergonomic
monitoring, hold significant promise for improving the overall well-being of individuals
across various domains.

Looking to the future, the Guardian-Posture project envisions a broader scope that
extends into rehabilitation, physical therapy, and sports training, with the goal of
optimizing performance and preventing injuries. Innovative applications, such as
integrating robotic arms for fall prevention among vulnerable populations, underscore the
project's commitment to advancing safety and well-being through technological
innovation.

In summary, the Guardian-Posture project represents a holistic approach to


addressing musculoskeletal health challenges in the digital age, leveraging cutting-edge
technology to empower individuals, enhance awareness, and foster a proactive stance
towards maintaining optimal posture and overall well-being.

5.2 Future Scope

In addition to its primary focus on personal use, the Guardian-Posture project sets
its sights on broader horizons in the realm of healthcare and wellness. Its future scope
encompasses rehabilitation, physical therapy, and sports training, where it aims to
optimize performance and prevent injuries. Through advanced monitoring and analysis

72
capabilities,

73
the system seeks to enhance outcomes in these domains by providing valuable insights
into posture and movement patterns.

Furthermore, the project explores innovative applications such as integrating


robotic arms, with the specific goal of preventing falls among vulnerable populations like
the elderly and individuals with mobility limitations. By extending its reach beyond
traditional boundaries, the Guardian-Posture project aims to significantly enhance overall
safety and wellbeing. These forward-thinking initiatives underscore the project's
commitment to leveraging IoT technology for impactful solutions that address critical
health challenges and improve quality of life for diverse populations.

74
CHAPTER 6 : REFERENCES

[1] A. Pathologies, “Wearable Posture Detection System,” pp. 1–2, 2014.

[2] Q. W. Oung, M. Hariharan, H. L. Lee, S. N. Basah, M. Sarillee, and C. H. Lee,


“Wearable multimodal sensors for evaluation of patients with Parkinson disease,” Proc.
- 5th IEEE Int. Conf. Control Syst. Comput. Eng. ICCSCE 2015, no. November, pp.
269– 274, 2016.

[3] Y.-R. Huang y X.-F. Ouyang, «Sitting Posture Detecting And Recognition Using
Force Sensor,» de International Conference on BioMedical Engineering and Informatics
, Chongqing, 2012.

[4] Raiano L., Di Tocco J., Massaroni C., Di Pino G., Schena E., Formica D.
Respiratory rate estimation during walking/running activities using principal
components estimated from signals recorded by a smart garment embedding
piezoresistive sensors; Proceedings of the 2021 IEEE 6 International Workshop on
Metrology for Industry 4.0 & IoT (MetroInd4. 0&IoT); Rome, Italy. 7–9 June 2021; pp.
544–549

[5] Lamberti N.A., La Mura M., D’Uva P., Greco N., Apuzzo V. Proceedings of the
Sensors and Microsystems, Proceedings of the 19th AISEM 2017 National Conference
19, Lecce, Italy, 21–23 February 2017. Volume 457. Springer; Cham, Switzerland:
2018.
A New Resonant Air Humidity Sensor: First Experimental Results; pp. 79–87

[6] Leone A., Rescio G., Caroppo A., Siciliano P., Manni A. Human Postures
Recognition by Accelerometer Sensor and ML Architecture Integrated in
Embedded Platforms: Benchmarking and Performance Evaluation. Sensors.
2023;23:1039. doi: 10.3390/s23021039.

[7] Lind C.M., Abtahi F., Forsman M. Wearable Motion Capture Devices for the
Prevention of Work-Related Musculoskeletal Disorders in Ergonomics–An Overview of
Current Applications, Challenges, and Future Opportunities. Sensors. 2023;23:4259.
doi: 10.3390/s23094259.

[8] Wu S.L., Cui R.Y. Human behavior recognition based on sitting postures;
Proceedings of the 2010 International Symposium on Computer, Communication,
Control and Automation (3CA); Tainan, Taiwan. 5–7 May 2010; pp. 138–141
75
[9] Liang G., Cao J., Liu X. Smart cushion: A practical system for fine-grained sitting
posture recognition; Proceedings of the 2017 IEEE International Conference on
Pervasive Computing and Communications Workshops (PerCom Workshops); Kona, HI,
USA. 13– 17 March 2017; pp. 419–424.

76
IOT Guardian Posture Monitoring and Mitigation Muscle Strain
K.V. Siva Prasad Reddy1

G.Akshitha reddy2,P.Sindhu reddy3, K.Charmika reddy4

1
Assistant Professor, Department of Cybersecurity & IoT, Malla reddy University, Hyderabad, Telangana, India.
2-5
Department Of Internet of Things, Malla reddy University, Hyderabad, Telangana, India.
[email protected], [email protected],
[email protected]

ABSTRACT studies, improper posture can lead to chronic pain,


The “Guardian-Posture: IoT Enabled System decreased mobility, and even long-term health
for Monitoring and Mitigating Muscle Strain” complications. To address these challenges, the Guardian-
is an IoT solution combatting musculoskeletal Posture project introduces an Internet of Things (IoT)
issues arising from sedentary lifestyles. It uses enabled system designed to monitor and mitigate muscle
wearable sensors for real-time posture strain. By leveraging wearable technology, the system
monitoring, communicating with a provides real-time feedback on users' postural habits,
microcontroller and employing advanced helping them to develop awareness and make informed
algorithms for detection. The system adjustments. This innovative approach combines data
seamlessly integrates into daily routines collection through sensors, advanced analytics, and
without restricting mobility. Collected data is personalized recommendations to create a comprehensive
securely transmitted to the cloud for solution for posture management. The Guardian-Posture
comprehensive analysis and historical system notonly identifies poor posture but also educates
tracking. The user interface, accessible via web users about ergonomic practices and exercises to
or mobile app, provides real-time feedback, strengthen muscles and improve overall posture. In this
alerts for improper postures, and corrective introduction, we outline the project's objectives, the
guidance. Key features include personalized underlying technologies, and the potential impact on
posture recommendations, timely alerts, and individual health and productivity. By harnessing the power
a user-friendly interface for heightened of IoT, we aim to empower users to take proactive steps
awareness. The system actively mitigates toward better musculoskeletal health, ultimately
muscle strain by promoting informed and contributing to a healthier, more active lifestyle.
proactive posture habits. The anticipated
outcomes of the project include the successful Utilizing a network of wearable sensors, the Guardian-
development and implementation of a real- Posture system continuously collects data on users' body
time posture recognition algorithm that positions and movements. Advanced algorithms analyze
accurately distinguishes between different this data to detect poor posture and excessive strain,
human postures such as sitting, standing, delivering instant feedback through a companion mobile
walking, and falling. Development of a user- application. Additionally, the system offers personalized
friendly interface for the wearable device, recommendations and alerts to promote ergonomic
providing feedback to users about their practices. By integrating machine learning and user-
current posture. the Guardian-Posture project friendly interfaces, Guardian-Posture empowers
extends into rehabilitation, physical therapy, individuals to take charge of their musculoskeletal health,
and sports training, aiming to optimize ultimately enhancing their quality of life and productivity.
performance and prevent injuries. Through this project, we aim to bridge the gap between
technology and health, paving the way for smarter,
healthier living.Human posture recognition has a wide
1. Introduction
range of application for elderly care. The real problem
In today's fast-paced world, sedentary lifestyles
occurs when an elderly person who is living alone get
and prolonged periods of sitting have become
severally sick or in a worst case fall and get injured making
commonplace,leading to a rise in
him or her unable to ask for help. In some unfortunate
musculoskeletal disorders, particularly muscle
situations, after they fall or got sick, they might even have
strain and poor posture. These issues not only
to live through that agony any physical pain until their final
affect physical health but also impact overall
breath without any sort of help.
well-being and productivity. According to recent
IOT Guardian Posture Monitoring and Mitigation Muscle Strain
 Data Collection: Wearable sensors collect
2. Literature Review posture and movement data and transmit it via
Bluetooth or Wi-Fi to the CPU.
This paper presents a wearable posture
identification system designed to assess seated
posture using accelerometers. Two
accelerometers are placed on the lumbar and
cervical spine to calculate posture angles via
Arduino processing. Three experiments were
conducted: calibration to determine
accelerometer error compared to a
goniometer, performance measurement to
assess dynamic conditions, and real-time
analysis. Results indicate accelerometer errors
of less than 3% compared to goniometer an
electro goniometer readings, affirming the
system's ability to monitor and identify both  2.Data Processing: The CPU processes the data
good and bad sitting postures. in real-time, employing machine learning
algorithms to evaluate posture quality and
3. System Design and Architecture detect strain.
3.1 System Components
 3.User Feedback: Processed information is sent
Wearable Sensors Functionality: The to the mobile application, where users receive
system utilizes lightweight, ergonomic instant feedback and recommendations.
wearable sensors (e.g., smart vests or
bands) equipped with accelerometers 3.3 Communication Protocols
and gyroscopes. These sensors  1.Wireless Communication: The system employs
continuously monitor users' posture, secure wireless protocols (e.g., Bluetooth Low
movement patterns, and muscle strain Energy for sensor connectivity and HTTPS for
levels. Sensors gather data on body cloud communication) to ensure data privacy and
orientation, angles, and motion, integrity.
transmitting this information wirelessly
to a central processing unit. The CPU,  2.Data Synchronization: The app synchronizes
typically a cloud-based server, receives data with the cloud server to maintain an up-to-
and processes data from multiple date record of user activity and posture history.
wearable sensors. Machine learning User Interaction and Engagement.
algorithms analyze the incoming data to  3.Personalized Dashboard: The mobile app
detect poor posture and identify features a dashboard that visualizes posture
patterns indicative of muscle strain. The trends, muscle strain patterns, and improvement
system can adapt its recommendations over time. smaller, More Discreet Devices
based on user behavior over time.A Advancements in sensor technology and
companion mobile app serves as the miniaturization will enable the development of
user interface, providing real-time even smaller, more comfortable wearable devices
feedback, alerts, and Improved Battery Life Breakthroughs in energy
personalized storage and efficiency will extend battery life,
recommendations. The app is designed allowing for longer periods of continuous
for ease of use, with intuitive navigation monitoring.
and visual representations of posture
data. Users receive timely alerts for poor
posture and reminders for corrective
actions or exercises, fostering
engagement and compliance..

3.2 System Architecture


IOT Guardian Posture Monitoring and Mitigation Muscle Strain

4. Implementation serves as a visual representation of the ideal


Implementing an IoT-based posture monitoring
and muscle strain mitigation system involves
several key steps, each integrating hardware,
software, and data analytics to create a
comprehensive, real-time solution. The first step
is the design and development of wearable
devices equipped with sensors such as
accelerometers, gyroscopes, and pressure
sensors to detect and measure body posture and
movements. These sensors would collect data
about the user’s posture, muscle tension, and
movement patterns. The collected data is then
transmitted wirelessly to a central processing
unit, typically a mobile app or cloud-based
platform. On the software side, the system needs
a robust algorithm that can analyze the incoming
data to detect deviations from an optimal posture
and identify potential muscle strain This analysis
would be based on predefined posture models
and thresholds for muscle strain, which would
allow the system to issue real-time alerts when an
issue is detected, such as a slouched posture or
excessive strain on a specific muscle group. To
mitigate muscle strain, the system could
incorporate recommendations for posture
correction, stretches, or short breaks, which are
delivered via notifications or vibrations from the
wearable device Advanced versions could also
integrate with external devices such as muscle
stimulators to provide immediate relief or
support.

Results :

Fig:1
The above figure features an individual seated
and stood with proper alignment,
demonstrating an exemplary posture. This
sitting posture that users should strive to maintain
for musculoskeletal health and comfort.
Fig:2
The Guardian Posture system incorporates a GSM
fall alert feature designed to swiftly respond to
detected falls and ensure the safety of individuals
with disabilities.

Fig:3
The above image illustrates a key feature of the
Guardian Posture project, wherein gyroscope sensor
data is displayed on an LCD screen in three axes: X, Y,
and Z.
IOT Guardian Posture Monitoring and Mitigation Muscle Strain
5. Conclusion and Future Work recommendations,tailoring

 The Guardian-Posture project


represents a significant step forward in
the integration of IoT technology into
personal health management,
specifically targeting the challenges of
poor posture and muscle strain. By
leveraging wearable sensors, advanced
data analytics, and a user-friendly
mobile application, the system
empowers individuals to monitor their
posture in real time and take proactive
measures to improve their
musculoskeletal health. The initial
implementation has demonstrated the
potential of this approach to enhance
user awareness and promote healthier
behaviors.
 Through comprehensive data collection
and personalized feedback, Guardian-
Posture aims to mitigate the risks
associated with prolonged poor posture
and muscle strain, ultimately improving
users' quality of life and productivity.
The system not only addresses
immediate posture correction needs
but also educates users about long-
term ergonomic practices, fostering a
more informed and health-conscious
community. By bridging the gap
between technology and health,
Guardian-Posture has the potential to
revolutionize how individuals approach
their posture and overall well-being.

 While the current implementation


provides a solid foundation, several
avenues for future work can enhance
the Guardian-Posture system Future
iterations could explore the integration
of more advanced sensors, such as
electromyography (EMG) sensors, to
provide deeper insights into muscle
strain and activity levels. Developing
partnerships with smart furniture
manufacturers could allow for real-time
adjustments of desks and chairs based
on user posture, creating a fully
adaptive ergonomic environment.
Continuous improvement of machine
learning algorithms can enhance the
accuracy of posture
detection and
interventions to individual user patterns over
time. Introducing social elements, such as
forums or group challenges, could foster
community engagement and support among
users, motivating them to adhere to better
posture practices. Conducting long-term
studies to assess the impact of the Guardian-
Posture system on users' health outcomes
and productivity would provide valuable data
for further refinement and validation of the
system.

6. References
[1] A. Pathologies, “Wearable Posture
Detection System,” pp. 1–2, 2014.
[2] Q. W. Oung, M. Hariharan, H. L. Lee, S. N.
Basah,
M. Sarillee, and C. H. Lee, “Wearable
multimodal sensors for evaluation of patients
with Parkinson disease,” Proc. -5th IEEE Int.
Conf. Control Syst. Comput. Eng. ICCSCE 2015,
no. November, pp. 269274, 2016.
[3] Y.-R. Huang y X.-F. Ouyang, «Sitting Posture
Detecting And Recognition Using Force
Sensor,» de International Conference on
BioMedical Engineering and Informatics ,
Chongqing, 2012.
[4] Liang G., Cao J., Liu X. Smart cushion: A
practical system for fine-grained sitting posture
recognition; Proceedings of the 2017 IEEE
International Conference on Pervasive
Computing and Communications Workshops
(PerCom Workshops); Kona, HI, USA. 13–17
March 2017; pp. 419–424.
[5] Lamberti N.A., La Mura M., D’Uva P., Greco
N., Apuzzo V. Proceedings of the Sensors and
Microsystems, Proceedings of the 19th AISEM
2017 National Conference 19, Lecce, Italy, 21–
23 February 2017.
[6] Leone A., Rescio G., Caroppo A., Siciliano
P., Manni A. Human Postures Recognition by
Accelerometer Sensor and ML Architecture
Integrated in Embedded Platforms:
Benchmarking and Performance Evaluation.
Sensors. 2023;23:1039. doi:
10.3390/s23021039.
[7] Lind C.M., Abtahi F., Forsman M. Wearable
Motion Capture Devices for the Prevention of
Work- Related Musculoskeletal Disorders in
Ergonomics– An Overview of Current
Applications, Challenges, and Future
Opportunities. Sensors. 2023;23:4259. doi:
10.3390/s23094259.

You might also like