An Introduction to IoT Based Posture Detection and Underlying Sensor Technology

Analysis
of human posture has many applications in the field of sports and medical science
including patient monitoring, lifestyle analysis, elderly care etc. Many of the
works in this area have been based on computer vision techniques. These are
limited in providing real-time solution. Thus, Internet of Things (IoT) based
solution are being planned and used for the human posture recognition and
detection. The data collected from sensors is then passed to machine learning
or deep learning algorithms to find different patterns. In this chapter an
introduction to IoT based posture detection is provided with an introduction to
underlying sensor technology, which can help in selection for appropriate
sensors for the posture detection.


Introduction
Stanford Health News defines 'posture' as the way your muscles and skeleton hold the body erect. It can also be defined as the position in which a person holds their body upright against gravity when standing, sitting, walking or performing any activity. Maintaining a good posture is vital to the overall health of all human beings. Negligence towards maintaining a good posture can cause many life-threatening conditions such as shoulder, back pains, reduced lung function, gastrointestinal pains, scoliosis, postural syndrome, etc. Prolonged bad posture has a very severe negative impact on any person's day to day or work life.
People generally do not seek medication until an acute pain is felt. The treatment then may range from some rest and physiotherapy to even surgery depending on the severity of the issue. Thus, large amount of money is spent on such treatments which could have avoided in the first place if proper precautions had been taken. Therefore posture and posture analysis is an important issue. Posture analysis, as the name describes, is a process of examining the posture of a person and based on the posture, it can be concluded if a person is healthy or unhealthy.
In posture detection, the posture of a person is classified as a good or a bad, based on his current activity. Apart from this, another way to analyze the health of a person by his/her posture is posture recognition, where the activity patterns(sitting, standing, lying) can be analyzed to judge the overall health of a person. Activity monitoring through posture recognition or detection also forms an integral part of ambient assisted living systems for the elderly and can be used for fall detection.

Types of Posture Detection Techniques
After overview of posture analysis, an overview of different types of methods available for posture detection is presented in this section. The two broad approaches available presently for detecting the posture of a person are as follows: 1. Invasive Methods: Invasive methods are those which require the use of instruments inside or on the body of the subject i.e. the sensors may be implanted within the body or attached to the surface of the body for posture detection. For posture detection, wearables are more commonly used. Wearables that are very popular include iwatches, fitness bands etc which are used by people to monitor day to day health parameters such as blood pressure, heart rate etc. 2. Non-invasive Methods: Non invasive methods are those which do not require the use of any wearable sensors or device to detect postures. For example, using cameras to collect information about the posture of a person. This will then rely on the use of computer vision techniques to detect and classify postures. First of all the principal body parts which are the extremities of the body such as head, feet and hands are detected. Based on these detections, then the secondary body parts are searched i.e. shoulders, elbows and knees.

Invasive vs Non-invasive
The advantage of the non invasive methods is that these provide lesser hindrance to the user. Moreover, these methods give higher accuracy than the non-invasive methods and are less likely to be affected by external environmental conditions. These can also be used for a variety of activities and are not limited to a few. Thus invasive methods are more suitable for real-time applications than non-invasive methods. Further, invasive methods may hinder the activities of a person in day to day scenario (depending on the size and position of the sensor), and working of the systems are based highly on a subject's willingness to wear the sensors. On the other hand, non-invasive methods are prone to lesser accuracy than the invasive methods. The non-invasive methods (cameras) may also be affected by the external environmental conditions like the lighting of a room [1], the angle at which a subject is facing the detector or any other obstructions in the room. Apart from this, large computational requirements are required to handle the images, often rendering the solution unsustainable for real-time applications. Thus depending on the application, invasive or non-invasive methods can be used accordingly.
3 Sensor based methods for posture detection Generally, there are two main methods of using sensors for posture detection: 1. Calculation of the pressure distribution over various weight dividing surfaces: This is a non-invasive approach in which sensors are placed on the sitting/lying surface and not on the body of the subject itself.
2. Calculation of the angular difference between current posture and a pre-determined good posture: This is a non invasive approach in which sensors are placed on the body of subjects.
For the first (pressure based) approach as described in [2], strength and ultrasonic sensors are used. The authors proposed an approach for analyzing the posture in only sitting position. First of all a comfortable and height appropriate chair according to the subject is selected, such that they maintain a good posture for data collection. The chair selection is described as an important step such that the subjects reach their natural state where the spine position and the space between the vertebrae does not differ and the waist and back muscles stay relaxed. Generally, Arduino platform is used for implementation of the system not only because it is a powerful embedded system but also very versatile in nature.
Once the data is collected, it is fed to a machine learning algorithm like K-nearest neighbour algorithm (KNN). Because the number of features are very large, another algorithm Principal Component Analysis (P.C.A.) may also be used for dimensionality reduction. Figure 1 shows the stages for data collection and analysis. This approach is limited to sitting posture where sensors can be installed inside the chair to acquire data. This can be beneficial for scenario where people or students work for a long time at desk without causing any hindrance. It can also be used for patients on the wheelchair. The limitation of this method is that it cannot help in correcting the posture or for detection throughout.
In the second approach wearable sensors like accelerometer are used to measure the acceleration along x, y and z axis at the point where it is placed on the body [3]. Along with it, gyroscope may also be used to measure angular velocity along x, y and z direction. These values can then be transmitted to a computing model through wires or wireless medium (through WiFi or Bluetooth) for further processing and classification.
Generally, a belt is designed which consists of a sensor network comprising of an accelerometer and gyroscope: accelerometer for measuring the tilt of the body and gyroscope for measuring the movement of the body. Then bluetooth module is used for connecting the belt containing these sensors to the mobile application designed to display these readings. This application then alerts the user if he/she is exhibiting a good or a bad posture.
Further, serial port programming has been done in [3] to get the particular output on the Arduino. The programming in the Arduino has been done for different gestures and positions of the body that a person undergoes in routine life. Figure 2 depicts the basic design of a posture belt. A very similar approach like the posture belt described in [3] has been used in [4]. The authors describe the design and development of a wearable Smart Rehabilitation Garment (S.R.G.) for posture detection and analysis. This sensor based garment is also connected a mobile application via bluetooth and alerts the user by buzzing an alarm when the user is exhibiting a bad posture.
In another wearable sensor-based approach by Lim et al. [5], two accelerometers are placed on different parts of a person's spine. Apart from accelerometer, two other sensors that are also used in this approach are goniometer and electrogoniometer. A goniometer is a device that is used by a doctor or physical therapy to measure the range of motion (ROM) around a joint in the body. The goniometer is a manual device and cannot store the data and thus electrogoniometer was invented. This device shows a high precision by ±0.1 0 for all different ROM angles and can evaluate six types of movement directions and five different angles for a given movement direction. The authors mentioned that gyroscope would help in providing more information but was not used such that system does not become more bulky and also power is not highly drained.
The other two sensors goniometer and electrogoniometer help in calculation of angle leading to determination of posture. This design is simple, effective and wearable, however, is only implemented on sitting positions. After interfacing the accelerometer with Arduino, authors performed three experiments performed on the subject. Experiment I: Calibration test to compare the accelerometer with goniometer; Experiment II: Measurement performance test to compare the accelerometer angle with electrogoniometer, and Experiment III: Real-time system analysis. Figure 3 shows the flowchart for different experiments conducted by Lim et al. [5].
In a novel solution presented in [6] and [7], a custom-designed wireless body area sensor network (WBASN), called WiMoCA has been used. WiMoCA sensing node is designed to be a wearable sensor and is a low-power module providing fast update of each component. It also gives the complete implementation of a distributed posture recognition application.
One very innovative, application specific way for posture detection where the computer users are warned when they lean too close to the computer, is the "Postuino" [8].
Here the sensors are placed next to the computer screen and not on the body of the user. This innovative approach helps the user to keep a safe distance from the electronic screen, however does not detect the overall posture as a healthy or unhealthy one.

Sensor Technology for posture detection
Next, in order to understand the working of the sensors, the underlying technology is required to be understood. This section will elaborate underlying technology for various sensors and will help in the selection of appropriate sensors for posture detection. Currently, generally Micro Electro-Mechanical Systems (MEMS) technology is used in sensors [9].

Introduction to MEMS
MEMS is a Micro technology, as the physical dimensions range is less than one micrometer, therefore even smaller in comparison to the width of a human hair (75 micrometer). Electro-Mechanical refers to the fact that it consists of the actuator in the chip itself. Broadly, it consists two main parts:

Accelerometer
Next, in this subsection, accelerometer is discussed in detail. An Accelerometer is a device that is used to measure acceleration forces in all the 3-axis, i.e. X-axis, Y-axis and Z-axis. The force may be static such as, in the case of gravity, but mostly the dynamic forces are used such that vibrations/movement can be sensed. Figure 5 shows the composition of an accelerometer and Figure 6 gives an insight about the principle behind the working of an accelerometer. This work can be seen, in everyday items such as smartphones as a luxury, to a car's mechanism of opening the airbags. Basically, the data is taken and decided what is to be done, for which signal processing chip connected to the accelerometer is used usually. In order to achieve this, Piezoresistive materials are used, which are basically materials that exhibit a change in resistance as a result of an applied strain and generally termed as strain gauges. Further, Gauge Factor is the relative change in the resistance per unit strain [10]. There are two modes of resistance change, when strain is applied the device is deformed.
1. Physical Change in dimensions. 2. Resistivity, which is a function of strain.
Physical change contributes to the gauge factor majorly, in case of metal strain gauge. Figure 7 is a digram of metal gauge. These methods make an accelerometer as one of the most widely used sensors. They also give very high accuracy and their manufacturing and efficient use is made possible by MEMS. Once working of accelerometer is understood, it can be used in the correct way to collect the required data. While collecting data for postures, the data should be as accurate and sensitive as possible.

Gyroscope
It is basically, a device used for finding orientation and angular velocity. Figure 9 shows a digram of gyroscope. Initially, vibrating ring gyroscopes and tuning fork gyroscopes were used. MEMS gyroscopes soon took over and still are the most widely produced. One of the most widely used MEMS gyroscopes is the Piezoelectric Plate Gyroscope which uses a PZT plate as its base. At micro levels, an entire plate is made of piezoelectric material. It requires a much smaller drive voltage to create readable outputs, in comparison to its predecessors. Generally piezoelectric plate is having length and width much more than its depth. This plate has electrical leads connected to all six sides and is placed on top of a thin membrane of a cavity in a silicon wafer. The cavity allows more freedom for the PZT to vibrate and deform. The leads provide the driving voltage and measure the output. Figure 10 represents a cross sectional view of gyroscopes used these days. The sheet does not vibrate like a plate or fork. An AC driving voltage is applied vertically across the plate, also the thickness of the plate vibrates, which also oscillates with time and hence creates vibration. When the vibrating plate is rotated about an axis perpendicular to the drive voltage, a voltage is produced in the third perpendicular direction. This output voltage is proportional to the angular velocity.
This subsection helped to understand the importance of placing gyroscope at the right position and at the right orientation. MEMS technology provides very high sensitivity and thus high precision can be acquired. Further, Vibrating-ring gyroscope is another popular gyroscope and mainly used in cars. It can also be used according to the requirement.

Ultrasonic Sensor
An ultrasonic sensor is one of the most commonly sensor used to measure the distance. Figure 11 shows an ultrasonic distance sensor module and figure 12 shows the working of the ultrasonic sensors.
It has basically two parts, the Transmitter (left side in the Figure 11) and the Receiver (right side in the Figure 11). The transmitter is the source of the ultrasonic waves. These waves are at much higher frequency for humans to hear. When these waves hit an object, they are reflected back. When the receiver detects these waves after reflection, the distance can be computed by the time it takes for the waves to return using (1), This is used while measuring the distance of different points, like to measure the distance of the spine from different parts of the chair, when the person is sitting on it.

IR Distance Sensor
IR Distance Sensor is one of the most common sensors used for object detection. The key difference between IR Distance Sensor and Ultrasonic Sensor is that mostly IR sensor is used just to detect the object and not to measure the distance. Ultrasonic Sensor offers more range, as well as accuracy, however, the IR sensor has its own advantages such as low cost. Figure 13 shows an IR sensor and figure 14 depicts the working of an IR sensor.
In the infra-red spectrum, all the objects radiate some form of thermal radiation. An infra-red sensor can detect these radiations where the emitter is simply an IR LED and the detector is simply an IR photo-diode. A photo-diode is sensitive to IR light of the Fig. 13. A real-life IR proximity sensor same wavelength which is emitted by the IR LED. As the IR light falls on the photodiode, the resistances and the output voltages change in proportion to the magnitude of the received IR light. This can be used when presence or absence of an object is is require to be detected, before any further task or analysis is carried out. IR Distance Sensor is very efficient and cost effective for this purpose.

Electro-Goniometer
Electro-Goniometer is a device used for measuring joint angles. Electro-Goniometer continuously measure joint angles, and is ideal to measure dynamic movement. It is extremely precise as it is mostly used to determine deformities in patients. The readings can be displayed real time as well as be stored to create a dataset. Figure 15 represents the basic outline of a goniometer.  When motion occurs at the joint, an electrical output from the potentiometer provides a continuous record of the angle present at the joint. Electrical resistance from the potentiometer can be used to determine the angle between the joints. Figure 17 shows a potentiometer type electrogoniometer. 3. Strain gauges: These are commonly known as flexible electrogoniometers and are also the most popular type. The strain gauge mechanism is housed inside the spring, which changes its electrical resistance proportionally to the change in angle between the plastic end blocks' longitudinal axes. Figure 18 shows a strain gauge based electrogoniometer.

Fall Detection
This section consists of one of the most important and widely used applications of posture detection. Fall detection is one of the main problem especially for older people due to their poor physical fitness. If the old people fell down, then it would be difficult for them to request for help. IoT and network sensors make it possible to overcome this problem. Using IoT and sensor network, a system can be developed which will be able to detect the falling incident of the person and report it to the healthcare department soonest possible.

System Design and Workflow
Tang et al. [11] proposed the fall detection system for elderly. Figure 19 describes the architecture of the proposed system for elderly people. Following workflow of the proposed system has been described by the authors. a) Falling detection devices like sensors will be worn by elderly people on their wrist or waist. b) The embedded algorithm will run by a sensor device and it will detect the geographic location and body measures of the person. c) If body position detected by sensor device is in falling mode the system embedded alarm will be triggered. d) If the alarm is triggered by mistake (false positive), the user can reset the alarm by clicking on the reset button. e) If the alarm is not cancelled within 15 seconds then an emergency SMS with the user's geographic location will be sent to the contact person. f) After sending the SMS, system will automatically reset the alarm to its original condition. Fig. 19. Architecture of the system [12]

Fall detection System
There are mainly two type of existing system for fall detection [13] 1. Wearable System: In a wearable system, the sensor is embedded within the wearable device worn by the subject in order to detect the fall detection. The sensorbased system consists of an accelerometer, gyroscope, and magnetometer which are placed on the subject/person to detect the changes in acceleration, position, the plane of motion, or body measure. Other parameters that are monitored by the wearable device-based system are Electrocardiogram (ECG), oxygen saturation of blood, heart rate variability (HRV). The data reported by sensors is then passed to a machine learning algorithm or checked against a threshold value to classify and detect fall [14]. Wearable systems are usually less expensive, low power consumption, and small in size which makes them more convenient to use and easily affordable. Most of the wearable devices are usually in bend form which can be worn around the wrist or thigh. In smartphone-based devices sensors are embedded within the smartphones, and when the user carries their smartphone with them, then the smartphone can detect the fall. [15]. 2. Non-Wearable System: The non-wearable system does not include an embedded system that is worn by people. These include cameras, pressure sensors, acoustic sensors which are placed in the subject's normal environment [13]. The nonwearable system does not perform any parameter evaluation instead they use an image or video processing captured by the camera to detect the fall. Machine algorithms are applied to the captured image by applying image processing. Generally, Convolutional neural networks are trained on different datasets of images to get more accuracy [14]. The non-wearable system provides more accurate details in abnormal conditions via images or video. However, they are more expensive, take more time in processing and computationally intensive.

Design Components
Both hardware and software components are necessary for fall detection. The sensorbased device, microcontroller comes in the category of hardware which is used to measure the body position and motion and communication with the software system to send out an emergency SMS if falling is detected. If an alarm is triggered by the sensor for 15 seconds only then the message will be sent to the ambulance. Arduino programming language is used to load the program in a Arduino. Arduino IDE, and other Arduino libarary are also used. GPRS is compatible with Arduino UNO and is based on the SIM900 module from SIMCOM. GSM cell phone network in GPRS shields provides the way to communicate it. By sending AT commands via UART, the GPRS shield allows sending SMS, MMS, audio, and GPRS. The GPRS shield also has 12 GPIOs, 2 PWMs, and 1 ADC. The default setting for the shield UART is 19200 bps 8-N-1 and can be changed by AT commands.

Programming language Used
The Arduino IDE supports the languages C & C++ using rules of code structuring [11]. The Arduino IDE already has a software library from wiring projects. Two basic functions are required to write the code, one for starting the sketch and the other for is the main program loop. The avrdude program in the Arduino IDE used to convert the executable code into a text file in hexadecimal encoding. With the help of the loader program, the text file is loaded in the Arduino board. The setup() function is called once and the loop() function is called repeatedly until the board is reset.

Algorithm Design
In fall alarm system, algorithm is mainly based on sum threshold value of acceleration and rotational angle. When fall happens, collision between body and ground produce a peak value at sum acceleration a. Here magnitude of a represents the three axes value of accelerometer. For the first step, system uses sum acceleration to detect high-intensity movement. However, jumping and sitting also produce peak value, so additional feature may be required for detection.
The second feature is an angle which can be calculated by acceleration measurements to calculate the rotational angle in 3-dimensional space by separating the gravity component before and after fall.  Coordinate and gravity before and after fall [12] When the device is mounted on the elderly wrist or waist, it will record the g value while the person is standing. After measuring in all the three different axes, the sum acceleration |a| will be calculated. When elderly fall in real, the acceleration will reach its peak value which is greater than threshold value i.e. |a| ≥ a threshold [12] 6 Challenges and Future Work In this section, various challenges and possible future works that can be done in this area are discussed. a) Selection of right transmission interval and data collection that is accurate for a specific purpose is a challenging problem. It depends on the type of considered sensor. The range varies in wired and wireless sensors. For instance, while collecting the knee data of a person, it is required that the data transmitted after a regular fixed interval of time (400-500ms) in the case of wired sensors. Selecting the right transmission interval increases accuracy while training the collected data on a machine learning model. However, bigger the time interval, more is the chances of the loss of data. At the same time, the lesser the interval, the system will be overloaded. Therefore, selecting the time interval which best fits for considered model and can handle the data flow is very important. b) While collecting data from multiple sensors, data collection rate may get affected.
Due to this, the sensor may start reading wrong data which affects data quality. Either use of multiple sensors need to be avoided or there is a need to write a program that works on a particular interval of time to collect that data. c) Sensor drift is another challenging problem with time-sensitivity of sensors insensate. It means if when one sensor is used for very long time then it is possible that its reading starts to tilt and deviate. Therefore either changing the sensor after a certain period of time is necessary or algorithm may be designed to tackle the sensor drift. d) After collecting thousands of data it becomes complex to find the interdependency between the different datasets and finding the desired relationship among them. Even if sometimes the relationship can be find between the dataset, it is possible that it would be changed for the different interval or property. For instance, let there exist a dataset of a male in different position and there is a relation between them such that all healthy people have almost the same reading of x, y, z-axis. However, it may be possible that for the females, this doesn't satisfy. Therefore, more data will be needed to get the desired result e) In a fall detection, it is necessary that the system works accurately and trigger the alarm within the time. Designing instruments that can prevent fall detection is also a very important factor. f) Lots of research work is also going on a posture detection system like fall detection using computer vision instead of IoT. Computer vision uses images and videos which can be proved very beneficial in a fall detection system. As the sensor takes time in measuring the person's position and triggers an alarm after 15 seconds, and with the help of cameras and computer vision technology, the fall of a person can be detected in real and it reduces the false positive, so the alarm can be triggered early. Therefore, efficient algorithms which can use benefits of both sensors and image processing algorithms are required.

Conclusion
The study of human posture has many applications. There are different types of sensors which can be used to collect the human posture data. This data is then used for classification of a posture as a healthy or unhealthy one using machine learning techniques. Once the model is trained the data will be classified in realtime after sending it to the model using WiFi. In this chapter, an introduction to human posture recognition using IoT networks is provided. Further, chapter also summarized the underlying sensor technology that is used in IoT networks involved in human posture detection. This chapter will help in understanding the sensors such that their selection for different situations will be easier. Still, lots of research is going on in this area. This chapter also gave insight for possible future works that can be done for achieving better results.