Praying is a central pillar of the Muslim faith; a mandatory religious ritual performed five times a day at prescribed times. The ritual is quite challenging for elders whose attentive and cognitive capabilities are deteriorating with age. When praying, a worshiper has to perform a sequence of six postures (Figure 1
) called Rakah (in singular) and Rakat (in plural). Because the sequence must be repeated a number of times while reciting passages from the Quran, elders frequently have difficulty remembering which cycle is being performed. Incomplete sequence, however, is not acceptable. Once forgotten, a worshiper must go back and fulfill an extra sequence to ensure that he has done the proper number of Rakat.
Furthermore, the number of cycles, which must be repeated by a worshiper in a pray, varies according to the time of day as well as the day. For example, two Rakat must be performed at dawn prayer, four at each prayer at noon, afternoon and evening, and three at sunset prayer. Old and forgetful people have problems not only remembering how many ritual cycles have to be performed in a prayer but also losing track of the cycles that they have already completed [1
]. Although Muslims with severe mental illness or intellectual disability are allowed to be exempted from praying, those with mild and moderate cognitive impairment are not. The options they currently have are quite limited: either to perform in a congregation following the leader or ask someone to inform them which Rakah is currently performed. Elders with cognitive impairment usually practice their rituals at home. They live independently and frequently do not have someone close to ask. At the same time, those who can usually hesitate being a burden to others and showing their cognitive problems, and may eventually lead to bad mood, depression, more extensive cognitive decay, and a stronger association with dementia [2
]. Therefore, information and communication technologies capable of assisting forgetful Muslims in praying are important.
In this article, we present a new technique for automatic sensing and recognition of Rakat postures by using a smart mat.
2. Related Research
Over the years, various technologies have been proposed to help Muslims with prayers and Rakat counting. Google Play and Apple Store nowadays contain a number of software applications which can automatically count the number of Rakat on mobile devices (smartphones or tablet PC) with embedded accelerometers. In order to use the applications, a worshiper must possess a proper device in addition to a prayer mat (which is not always the case for old and forgetful people), and also be within the area of Global System for Mobile Communications (GSM) or Wifi coverage in order to access the application server. Therefore, research efforts have been concentrated on incorporating Rakat counting electronics into the prayer mat itself.
] proposed the use of a solar-powered electrical switch pad and liquid crystal display (LCD) operable by a forehead of a worshipper when he or she prostrates on the mat. Faouaz [4
] also used LCD with a switch, built in the prayer mat, with the difference that the switch is turned on and off by the user. Abdelmohsen [5
] advocated placing a so-called “pressurable plate” under an ordinary mat to detect a prostration posture anytime the user’s forehead touches the mat, and incrementing the Rakat counter on display by every even prostration posture. Arrar [6
] developed a portable cycle counter based on IR sensors embedded into the prayer rug. Kantarceken [7
] presented a prayer assistance device with built-in camera, infra-red sensors, microphones, Bluetooth and acoustic transducers for detecting physical gestures and spoken words of a prayer. Ismail et al. [8
] used pressure sensors embedded in the mat under the forehead area to detect the prostration posture. When a second prostration is recognized, the counter is incremented, and its value is displayed on an MP3 player and replayed as an audible cue.
Despite differences in implementation, all of these smart prayer mats have several features in common. Namely, they differentiate human postures by patterns of binary signals (0 and 1) generated from switches or pressure sensors embedded into the mat. The sensors operate locally while the postures span the entire area of the prayer mat. Therefore, the devices either employ a large number of sensors distributed over the mat, as shown in Figure 2
a, in order to improve the detection accuracy on expense of cost (e.g., [6
]), or use a few sensors placed under the forehead (see Figure 2
b) to detect the prostration posture only (e.g., [4
]). These cost-oriented solutions do not take into account the other postures of the Rakah sequence and thus might increment the counter when the user skips a posture or makes two prostrations consequently; which is unacceptable. Besides, to our knowledge, none of the existing prayer mats proposed so far can differentiate the standing posture from the bowing posture, thus impeding the correct posture recognition.
It should be noted that research on smart mats/carpets capable of recognizing human postures and analyzing the human gait has intensified recently, especially for health-care and medical applications. Middleton et al. [9
] developed a gate-recognition “floor sensor” that had 1536 small sensing elements arranged in a 3 × 0.5 m2
rectangular strip with an individual sensor area of 3 cm2
. Aud et al. [10
] presented a fall-detecting smart carpet built from an array of signal-scavenging sensors that use energy available throughout the environment. Although this design does not have a power supply, the electronics put into the carpet make it thick and heavy. For example, a small mat of the carpet has four blocks of foil reading electronics parts, four AD convertors, one microcontroller, and one wireless transmitter. Miguel et al. [11
] and Cheng et al. [12
] advocated using arrays of pressure sensors made of electrostatic discharge protection foam mixed with carbon fiber to identify static activities on the carpet. Tanaka et al. [13
] designed a smart carpet from an array of pressure-sensing tiles that can be easily assembled on a floor to monitor user position, motion and falls. Chaccour et al. [14
] embedded a matrix of differential piezoresistive pressure sensors into a carpet for fall detection. Ho et al. [15
] proposed a textile technology for making smart carpets from tension-sensitive electro-conductive yarns. The sensing yarn has an elastic core wound around by two tension-sensitive electro-conductive threads of polyester and stainless steel fibers separated by a non-conductive basal layer. The technology can detect light touch, tactile perception, and tensile forces, and seems to be promising though its application in smart mats has not been revealed yet.
In addition to the abovementioned research, a number of successful products have been already deployed. An example is a smart yoga mat [16
] that employs over 21,000 built-in piezoresistive sensors to detect human poses and display them on a smartphone or tablet PC. The device provides robust identification of various yoga postures, thus allowing the user to improve his/her yoga practice. However, it is quite expensive (450 US$
In this article, we propose a new technique for posture detection and identification by using smart mats. In contrast to related methods, the proposed technique differentiates postures based on voltage levels generated by mat sensors. According to experimental evaluation, it provides unobtrusive and robust detection of all six Rakah postures and reliable Rakat counting. Its implementation is simple and efficient, yet inexpensive.
The rest of the article is organized as follows. In the next section, we discuss the proposed technique. Section 4
describes the prototype’s implementation in a smart mat and presents results of experimental evaluation. Section 5
summarizes our findings and outlines work for the future.
3. The Proposed Technique
3.1. An Overview
The key idea behind our method emanates from empirical analysis of output voltages produced by a pressure sensor of a single zone force-sensing resistor (FSR) family, which are largely used nowadays in automotive electronics, medical systems, and various industrial and robotics applications. A FSR is a two-wire device made from polymer thick film that “exhibits a decrease in resistance with increase in force applied to the surface of the sensor” [17
]. As the force grows, the output voltage increases. When a person steps over the sensor, his weight causes the sensor to generate an output voltage proportional to the product of person’s mass and the gravitational acceleration. For example, if a FSR sensor is tied to a measuring resistor RM
in a configuration shown in Figure 3
a, the output voltage, VOUT
, increases with weight, as depicted in Figure 3
b. Under a constant force, the output voltage remains constant. Note, the weight in the article is shown in terms of kilogram-force (1 kgf = 9.8 N).
As a force, weight has both a magnitude and a direction associated with it. While the direction of the weight force always remains toward the center of the earth, the distribution of the weight over the body’s center of gravity changes with human posture. For instance, when a person stands straight, his weight concentrates over his feet. So the weight force is maximal. When a person bows, sits or prostrates, his body’s center of gravity shifts and so does the weight distribution. Because a posture affects the weight force applied to the sensor, it changes the voltage produced by the sensor.
depicts the FSR voltage variations with postures, accumulated (at RM
= 600 Ω) from a test in which 30 people of different weight were standing, sitting and prostrating while a FSR sensor was under their feet. As one can see, the postures induce distinguishable voltages though the levels of the voltages vary with the mass.
Our posture detection technique exploits this posture-voltage dependency. In contrast to existing approaches, which differentiate human postures by binary patterns of active sensors, the proposed technique identifies postures by voltage levels produced by the sensors. It assumes that the prayer mat contains an array of FSR strip-line sensors connected to an embedded microcontroller. The microcontroller reads the sensor voltages, and based on them, detects postures performed by the user.
3.2. Positioning of Sensors Inside a Mat
In order to determine sensor placement within the mat, we experimentally studied the mat usage in a prayer. The study involved 30 Muslims aged from 20 to 60 years old. The participants varied in height (140~178 cm), weight (40~72 kg), shape (slim, ordinary, fat), gender, and feet size (23~26 cm). In the study, each participant was asked to pray using same mat lined by squares of 5 cm × 5 cm in size.
We measured the positions of participants over the mat and recorded the squares touched by the participant’s feet, knees, forehead or hands in different postures.
The results revealed three distinguishable areas of the mat usage, associated with the user’s feet (Area 1), knees, (Area 2) and head (Area 3), respectively, as shown in Figure 5
. Without being asked, all participants used same area for feet, identified from a picture printed on the mat. Namely, the Area 1 was used in standing and bowing postures; Area 2 in sitting and prostrating postures; and Area 3 in the prostrating posture only.
shows the details of mat area usage for each posture. In this figure, lines and columns determine the squares within the mat areas (see Figure 7
); the vertical axis shows the square usage in terms of the number of participants that touched a particular square in a posture. The two visible peaks in the graphs, associated with Areas 1 and 2, correspond to the mat regions used by the left and the right legs, respectively; the graph at the bottom reflects the regions of Area 3 touched by head. As the results demonstrate, every participant in the test placed their feet over Line 3 of Area 1 in the standing posture, pressed Line 3 of Area 1 and Line 2 of Area 2 in the sitting posture, and in the prostration posture had their feet over Line 4 of Area 1, their knees over Line 4 of Area 2 and their forehead over Line 3 of Area 3. Thus, to detect all of the postures of the Rakah sequence, only five strip-type (Model 408) FSR sensors [16
] are needed. A standard strip-type FSR-408 sensor is 622 mm long and 6.35 mm wide, and 1 mm thin. Because it responds to pressure applied from up to ±5 cm from its edge, we position the sensors on the mat as shown in Figure 7
Now consider output voltages induced by these five FSR sensors when a mat user implements the Rakah postures. Table 1
presents an example observed for a 40 kg user (RM
= 600 Ω). The standing posture leads to the maximal voltage in comparison to the other voltages listed in the Table. This is because the user in this posture presses the mat by his entire weight. When the user bows, the Area 1 sensors generate voltages around 90–100% of the maximal level. The sitting posture causes only 80% of the maximal voltage on sensors in Area 1, and around 60% of the maximal level on sensors in Area 2. When the user takes the prostrating posture, the sensors of Areas 2 and 3 produce voltages in the range of 50–75% and 4–25% of the maximal level, respectively.
To study the relationship between the user’s posture, weight, and voltage ranges, we empirically measured the sensor outputs induced by 30 different users of the prayer mat. Figure 8
shows the results in terms of sensor voltages (VOUT
) normalized to the peak voltage levels (V0
) of the Area 1 sensors.
For the sake of simplicity, we depict only the maximal values of the normalized voltages generated by sensors in Areas 1 and 2 for the bowing, the sitting and the prostration postures. The absolute variation of peak voltage (V0
) with the weight is given in Figure 4
. Interestingly, the voltage ranges associated with the postures are quite distinguishable and do not depend much on the user’s weight. In the sequel, we exploit these voltage–posture correlation for posture detection.
3.3. The Posture Detection and Rakat Counting Technique
The proposed posture detection technique is based on identifying patterns of sensor readings associated with each posture of the Rakah sequence. In contrast to related techniques, which differentiate postures by logic patterns associated with positions of active sensors within the mat, it distinguishes patterns (and hence postures) by voltage levels produced by the sensors. At each time of prayer, the voltage levels of the sensor outputs are compared to the pre-defined thresholds. A posture is considered detected if and only if all of the sensors associated with the posture produce voltages within the specified range. If the completed sequence of postures matches the correct order of the Rakah sequence (Figure 1
), the Rakat counter is incremented. Otherwise, it remains unchanged.
illustrates the proposed posture generation and Rakat counting technique in terms of state transition diagram. In this figure, circles represent postures; arrows show their execution order in Rakah sequence, the formulas above the arrows represent conditions at which the posture is considered detected i.e., the state transition occurs. The thresholds associated with the conditions have been obtained from an analysis of experimental data, of which a part is shown in Figure 8
The state machine works as follows. As the user activates the machine, it evaluates the outputs of sensors in Area 1 for 3 s in order to identify the peak voltage of the standing posture. If the voltage level is less than a given threshold (L0
), i.e., no pressure on sensors, the system remains in the initial stage. Otherwise, the calculated peak voltage is applied as a reference (V0
) for computing ten voltage thresholds (Li) of the detection conditions. Namely,
For example, if the reference voltage V0 = 1.89 V, the L1 = 1.7 V, L2 = 1.89 V, L3 = 0.945 V, and so on. The bowing posture is detected when the output voltages of Area 1 sensors are within the range L1 ≤ V1 ≤ L2. Otherwise, the system waits until the user implements the posture correctly i.e., the outputs of sensors 1 and 2 satisfy the specified condition. Note that even if the specified condition is satisfied but there is non-zero output from other sensors, the system will remain in the current state. To detect the prostration posture, we use Areas 2 and 3 sensors. If the outputs of the Area 2 sensors satisfy the condition: L3 ≤ V2 ≤ L4, and the outputs of the Area 3 sensors satisfy the condition: L5 ≤ V3 ≤ L6, then the system identifies the prostration posture. Otherwise, it continues waiting for the correct implementation of the required posture. To detect the sitting posture, we check whether the Area 1 voltages (V1) and the Area 2 voltages (V2) are within the ranges: L7 ≤ V1 ≤ L8 and L9 ≤ V2 ≤ L10. If either of these two conditions is unsatisfied, or there is a non-zero voltage output from the Area 3 sensors, the posture is rejected as incorrect. Thus, we proceed to the next state if the user correctly implements the postures. As the second prostration is identified, the system increments the Rakat Counter (RC) by 1 and repeats the cycle.
4. Implementation and Evaluation
The proposed technique was implemented in a smart mat prototype [18
] that additionally to Rakah counting also determined the start time of a next prayer and the direction to Mekkah (or Qibla). The praying mat was 120 cm × 70 cm in size, which is conventional for a medium height user. Figure 10
shows a block diagram of electronics embedded into the mat. The sensor array contained five force-sensing resistive strips (FSR 406) placed under Areas 1–3 of the mat, as shown in Figure 7
. To reduce sensor displacement and eliminate undesirable effects of dirt, the sensors were fixed in special pockets made of cloth that were sewn to the backside of the praying mat. The processing unit (depicted by gray pattern in Figure 10
) includes an 8-bit microcontroller (AVR ATmega32, from Atmel Crop., Chandler, AR, USA), a GPS receiver (Ublox NEO 6M, from Thalwil, Switzerland), a digital compass (CMPS10, from Robot Electroncs, Norfolk, UK), a real-time clock (RTC) unit, and an interface circuitry. The control panel contains a 128 × 64 graphical LCD display, a digital buzzer and a number of switches. By pushing a corresponding button on the control panel, the user can display on the screen either the ST (start time of the next prayer), QD (Qibla Direction), and RC (Rakah Counter). He or she can also reset RC, deactivate the buzzer (alarm off) or power off the smart mat if necessary.
On the mat, the FSR sensing strips were attached to the backside of the mat, while the microcontroller and the control panel shared the board placed on the foreside of the mat. The proposed posture detection and Rakat counting technique was implemented in software.
a,b shows photographs of the smart mat prototype and its usage in a prayer. The user activates the smart mat by pushing the power bottom on the control panel. By default, the RC is zero. When activated, the system displays the value of RC and the next posture to be taken by the user, thus guiding him or her through the Rakah sequence. If the system recognizes that the user completed a Rakah, it increments the RC value. Otherwise, the value of RC remains unchanged.
c exemplifies data shown on the display as the user completed the sitting posture of the second Rakah sequence. At any time, the user can reset the counter or switch the power OFF if necessary.
4.2. Evaluation and Results
To evaluate the quality of the proposed posture recognition and Rakat counting algorithm, we performed a number of tests, which involved 30 participants (of ages 10 to 60). The tests have been conducted in laboratory conditions with the smart mat placed on a flat, smooth, clean flooring. The temperature and humidity levels in the room were normal. The participants had different heights (from 128 cm to 180 cm), feet size (from 18 cm to 29 cm), and shapes (from 26 to 94 kg). During the tests, each participant was asked to perform the praying ritual with three Rakat correctly and then randomly skip or perform incorrectly (e.g., sitting instead bowing or vs. versa) one or several postures in a “faulty” Rakah sequence. These scenarios were repeated three times by each subject in a random order. In between the tests, the power was switched OFF. The tests totaled 120 simulated cycles of six postures each.
The evaluation revealed several results. First, when the system was switched ON and no pressure asserted to the mat, the voltage readings from the FSR sensors were almost 0, causing the system to remain in the initial state. The system operation started only when someone stepped over sensing Area 1, and when the level of voltage generated from the sensors of this area exceeds L0
. (Though we used L0
= 1, the threshold level can be calibrated to reduce external noise if any. According to [17
], the FSR sensors are no more prone to noise pickup than a passive resistor).
Second, the posture detection ratio of the proposed technique was 100%, even though the participants in the tests had different styles for sitting, standing, and prostration. Some of them inclined or moved forward/backward more than others; some used their hands to support their body when standing. Despite variations in posture style, the proposed method was able to effectively distinguish all six postures of the Rakah sequence and correctly count the Rakat. At the same time, we should notice that the posture detection and recognition might depend on the person’s height. Namely, it might be possible that a mat designated for a person of an average height may fail to correctly identify postures of a very tall or a short person or vice versa. We assume that this issue will not pose a problem in reality, because worshippers usually use mats of sizes proportional to their height.
Finally, the tests showed that the sensors in the mat successfully detect gait characteristics and are not perceptible to the people as they stay, sit, or prostrate. Overall, all the participants of the evaluation experiments reported the proposed smart mat useful and quite helpful.
5. Limitations and Future Work
In this section, we discuss the limitations of our study. Recognizing human activity is a challenge for any cyber-physical system application, as it requires modeling the peculiarities of an application environment, as well as the complex behavioral, psychological, and physiological aspects of human beings. The level of modeling for each of these aspects depends on application requirements.
In the current work, we modeled the application environment through laboratory settings that resembled environmental conditions in a Mosque or at home (flat, smooth, dry, and clean surfaces), i.e., conditions typical to the majority of Muslims. In the future, we will consider other settings to cover praying outdoors. For example, people may pray in open air and place the mat on a bumpy, sandy and dusty surface. Though worshipers usually pray in dry and clean places outdoors and do not pray in the event of rain or snow, several external factors such as dirt, moisture, liquids, and trapped air bubbles can cause the FSR sensors to generate faulty signals. Also, proximity to high intensity radio frequency (RF) sources may require special measures to reduce electro-magnetic noise. To investigate these issues, we plan to conduct a larger study of outdoor mat use.
We should also acknowledge that the developed system prototype is just a testbed to evaluate the efficiency of the proposed method, as well as other techniques [18
]. Though the strip-type sensors are flexible, neither the sensors nor the control panel can be folded, as this may cause shearing or breakup. We are now working on providing a foldable and portable solution of battery-operated smart-mat electronics which is reliable, easy to use and attach/detach whenever necessary.
Another limitation of the current work deals with the user modeling. The number of old and forgetful people involved in the study was very limited, and so it is hard to draw a statistically significant conclusion. Though all subjects considered in the study are real prayer mat users, some old people may implement postures differently than others or use assistive tools such as a cane to support their body. Also, people suffering from memory loss or cognitive impairment may also have different behavior. Extending the study to cover more elders and forgetful people will be performed in the near future.
Further, the current study assumed that the mat user is the only person who asserts force to the mat during a prayer. Moreover, the worshiper performs praying activities and takes postures within the mat area. Someone unfamiliar with Islam may argue that a mat user hypothetically might jump, step out of the mat during a prayer, go out, return back, and so on. Moreover, a prayer might be interrupted by a child, another person (e.g., caregiver), or a pet, for example, who might step over the mat and cause an error. While these events might happen hypothetically, they are far from reality. Religious people are very serious in their beliefs, obligations, and rituals. Preparations to pray are actually taken with a large care to prevent any external interruption. When a prayer starts, everyone in a Muslim family prays, including kids. During a prayer, each worshiper uses his own mat and is fully concentrated on the spiritual act of praying, i.e., communicating with God. So it is a realistic consideration that a Muslim will not be doing anything else other than praying if someone near them is also engaged in prayer. However, even if a hypothetical case takes place and a faulty action or posture is detected, the system will remain in its current state until the required posture is done correctly.
In this paper, we presented a new technique for unobtrusive human posture identification by a smart mat to assist Muslims in praying. As the experimental evaluation revealed, the proposed technique provides robust recognition of postures taken by a worshiper in a prayer and correct counting of the Rakat cycles in real time.
Finally, we would like to notice that the proposed voltage based posture identification technique is not limited to the smart prayer mat and Rakat counting, even though the paper has been focused on this specific application only. We think that it can be used in other applications as well. In healthcare, for example, the technique can be applied to identify the sleeping postures, or for monitoring the frequency of posture change of in-bed patients to decrease the development of ulcers. Similarly, it can be applied to detect sitting postures from sensors placed inside a chair. We are currently investigating further applications.