Human Activity Recognition System For Moderate Performance Microcontroller Using Accelerometer Data And Random Forest Algorithm




Classification, recognition, activity, real-time, wearable, microcontroller, moderate performance


There has been increasing interest in the application of artificial intelligence technologies to improve the quality of support services in healthcare. Some constraints, such as space, infrastructure, and environmental conditions, present challenges with assistive devices for humans. This paper proposed a wearable-based real-time human activity recognition system to monitor daily activities. The classification was done directly on the device, and the results could be checked over the internet. The accelerometer data collection application was developed on the device with a sampling frequency of 20Hz, and the random forest algorithm was embedded in the hardware. To improve the accuracy of the recognition system, a feature vector of 31 dimensions was calculated and used as an input per time window. Besides, the dynamic window method applied by the proposed model allowed us to change the data sampling time (1-3 seconds) and increase the performance of activity classification. The experiment results showed that the proposed system could classify 13 activities with a high accuracy of 99.4%. The rate of correctly classified activities was 96.1%. This work is promising for healthcare because of the convenience and simplicity of wearables.


Download data is not yet available.


F. Lanza, V. Seidita, and A. Chella, “Agents and robots for collaborating and supporting physicians in healthcare scenarios,” Journal of Biomedical Informatics, vol. 108, no. January, p. 103483, 2020. [Online]. Available: DOI:

M. M. Rodgers, V. M. Pai, and R. S. Conroy, “Recent advances in wearable sensors for health monitoring,” IEEE Sensors Journal, vol. 15, no. 6, pp. 3119–3126, 2015. DOI:

N. C. Minh, T. H. Dao, N. Q. Huy, D. N. Tran, N. T. Thu, and D. T. Tran, “Evaluation of Smartphone and Smartwatch Accelerometer Data in Activity Classifica-tion,” in 2021 8th NAFOSTED Conference on Information and Computer Science. IEEE, 2021, pp. 33–38. DOI:

L. Mo, F. Li, Y. Zhu, and A. Huang, “Human physical activity recognition based on computer vision with deep learning model,” Conference Record - IEEE Instrumentation and Measurement Technology Conference, vol. 2016-July, 2016. DOI:

N. Zhu, J. Cao, K. Shen, X. Chen, and S. Zhu, “A deci-sion support system with intelligent recommendation for multi-disciplinary medical treatment,” ACM Trans-actions on Multimedia Computing, Communications and Applications, vol. 16, no. 1s, pp. 1–23, 2020. DOI:

S. Chandra Mukhopadhyay, “Wearable Sensors for Human Activity Monitoring: A Review,” IEEE Sensors Journal, vol. 15, no. 3, pp. 1321–1330, 2015. DOI:

T. H. Dao, V. C. Ngo, Q. H. Nguyen, D. N. Tran, and D. T. Tran, “Building Human Activity Recognition System using Accelerometers and Machine Learning Methods on Low Performance Microcontrollers,” Research and Devel-opment on Information and Communication Technology, vol. 12/2021, no. 2, pp. 69–76, 2021.

G. Biagetti, P. Crippa, L. Falaschetti, S. Orcioni, and C. Turchetti, “Human activity monitoring system based on wearable sEMG and accelerometer wireless sensor nodes,” BioMedical Engineering Online, vol. 17, no. S1, pp. 1–18, 2018. [Online]. Available: DOI:

S. Chung, J. Lim, K. J. Noh, G. Kim, and H. Jeong, “Sensor data acquisition and multimodal sensor fusion for human activity recognition using deep learning,” in Sensors (Switzerland), vol. 19, no. 7, 2019. DOI:

G. Şengül, M. Karakaya, S. Misra, O. O. Abayomi-Alli, and R. Damaševičius, “Deep learning based fall detec-tion using smartwatches for healthcare applications,” Biomedical Signal Processing and Control, vol. 71, no. October 2021, p. 103242, 2022. DOI:

Y. Zhao, R. Yang, G. Chevalier, X. Xu, and Z. Zhang, “Deep Residual Bidir-LSTM for Human Activity Recog-nition Using Wearable Sensors,” Mathematical Problems in Engineering, vol. 2018, 2018. DOI:

N. T. Thu, T.-h. Dao, B. Q. Bao, D.-n. Tran, P. V. Thanh, and D.-T. Tran, “Real-Time Wearable-Device Based Activity recognition Using Machine Learning Methods,” International Journal of Computing and Digital Systems, vol. 12, no. 1, pp. 321–333, 2022. [Online]. Available:

D. N. Tran, T. N. Nguyen, P. C. P. Khanh, and D. T. Trana, “An IoT-based Design Using Accelerometers in Animal Behavior Recognition Systems,” IEEE Sensors Journal, vol. 12, no. 18, pp. 17 515–17 528, 2021.

P. C. P. Khanh, D.-T. Tran, V. T. Duong, N. H. Thinh, and D.-N. Tran, “The new design of cows’ behavior classifier based on acceleration data and proposed feature set,” Mathematical Biosciences and Engineering, vol. 17, no. 4, pp. 2760–2780, 2020. [Online]. Available: https://www. DOI:

V. Bianchi, M. Bassoli, G. Lombardo, P. Fornacciari, M. Mordonini, and I. De Munari, “IoT Wearable Sensor and Deep Learning: An Integrated Approach for Personalized Human Activity Recognition in a Smart Home Environment,” IEEE Internet of Things Journal, vol. 6, no. 5, pp. 8553–8562, 2019. DOI:

N. Damodaran, E. Haruni, M. Kokhkharova, and J. Schäfer, “Device free human activity and fall recognition using WiFi channel state information (CSI),” CCF Transactions on Pervasive Computing and Interaction, vol. 2, no. 1, pp. 1–17, 2020. [Online]. Available: DOI:

P. Kumar and S. Chauhan, “RETRACTED ARTICLE: Human activity recognition with deep learning: overview, challenges and possibilities,” CCF Transactions on Pervasive Computing and Interaction, vol. 3, no. 3, p. 339, 2021. [Online]. Available: https: // DOI:

J. Qi, P. Yang, M. Hanneghan, S. Tang, and B. Zhou, “A hybrid hierarchical framework for gym physical activity recognition and measurement using wearable sensors,” IEEE Internet of Things Journal, vol. 6, no. 2, pp. 1384–1393, 2019. DOI:

P. Casale, O. Pujol, and P. Radeva, “Human activity recognition from accelerometer data using a wearable device,” in Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), vol. 6669 LNCS, 2011, pp. 289–296. DOI:

M. Milenkoski, K. Trivodaliev, S. Kalajdziski, M. Jovanov, and B. R. Stojkoska, “Real time human activity recogni-tion on smartphones using LSTM networks,” 2018 41st International Convention on Information and Communica-tion Technology, Electronics and Microelectronics, MIPRO 2018 - Proceedings, pp. 1126–1131, 2018. DOI:

P. Van Thanh, D. T. Tran, D. C. Nguyen, N. Duc Anh, D. Nhu Dinh, S. El-Rabaie, and K. Sandrasegaran, “Development of a Real-Time, Simple and High-Accuracy Fall Detection System for Elderly Using 3-DOF Accelerometers,” Arabian Journal for Science and Engineering, vol. 44, no. 4, pp. 3329–3342, 2019. [Online]. Available: DOI:

J. Suto, S. Oniga, C. Lung, and I. Orha, “Comparison of offline and real-time human activity recognition results using machine learning techniques,” Neural Computing and Applications, vol. 32, no. 20, pp. 15 673–15 686, 2020. [Online]. Available: https: // DOI:

A. T. Özdemir and B. Barshan, “Detecting Falls with Wearable SensorsUsing Machine Learning Techniques,” Sensors, vol. 14, pp. 10 691–10 708, 2014. DOI:

T. H. Dao, M. H. Le, D. N. Tran, and D. T. Tran, “Xay dung mang giam sat hanh vi trong toa nha su dung cong nghe wifi,” in REV-ECIT2021. 978-604-80-5958-3, 2021, pp. 48–53.

A. Mannini, S. S. Intille, M. Rosenberger, A. M. Sabatini, and W. Haskell, “Activity recognition using a single accelerometer placed at the wrist or ankle,” Medicine and Science in Sports and Exercise, vol. 45, no. 11, pp. 2193–2203, 2013. DOI:

C. Torres-Huitzil and M. Nuno-Maganda, “Robust smartphone-based human activity recognition using a tri-axial accelerometer,” in 2015 IEEE 6th Latin American Symposium on Circuits and Systems, LASCAS 2015 -Conference Proceedings, 2015, pp. 2–5. DOI:

D. Rodriguez-Martin, A. Samà, C. Perez-Lopez, A. Català, J. Cabestany, and A. Rodriguez-Molinero, “SVM-based posture identification with a single waist-located triaxial accelerometer,” Expert Systems with Applications, vol. 40, no. 18, pp. 7203–7211, 2013.[Online]. Available: 2013.07.028 DOI:

D. Naranjo-Hernández, L. M. Roa, J. Reina-Tosina, and M. Á. Estudillo-Valderrama, “SoM: A smart sensor for human activity monitoring and assisted healthy ageing,” IEEE Transactions on Biomedical Engineering, vol. 59, no. 12 PART2, pp. 3177–3184, 2012. DOI:

S. Balli, E. A. Sağbaş, and M. Peker, “Human activity recognition from smart watch sensor data using a hybrid of principal component analysis and random forest algorithm,” Measurement and Control (United Kingdom), vol. 52, no. 1-2, pp. 37–45, 2019. DOI:

R. Caruana and A. Niculescu-Mizil, “An empirical comparison of supervised learning algorithms,” in ACM International Conference Proceeding Series, vol. 148, 2006, pp. 161–168. DOI:

A. Mannini and A. M. Sabatini, “Machine learning methods for classifying human physical activity from on-body accelerometers,” Sensors, vol. 10, no. 2, pp. 1154–1175, 2010. DOI:

Q. V. Le, “Building high-level features using large scale unsupervised learning,” in ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing -Proceedings, 2013, pp. 8595–8598.

J. Bassen, B. Balaji, M. Schaarschmidt, C. Thille,

J. Painter, D. Zimmaro, A. Games, E. Fast, and J. C. Mitchell, “Reinforcement Learning for the Adaptive Scheduling of Educational Activities,” in Conference on Human Factors in Computing Systems - Proceedings, 2020, pp. 1–12.

D. Guan, W. Yuan, Y. K. Lee, A. Gavrilov, and

S. Lee, “Activity recognition based on semi-supervised learning,” in Proceedings - 13th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications, RTCSA 2007, no. 1, 2007, pp. 469–475.

F. Yang and L. Zhang, “Real-time human activity classification by accelerometer embedded wearable devices,” in 2017 4th International Conference on Systems and Informatics, ICSAI 2017, vol. 2018-Janua, no. Icsai, 2017, pp. 469–473. DOI:

A. Wang, G. Chen, J. Yang, S. Zhao, and C.-Y. Chang, “A Comparative Study on Human Activity Recognition Using Inertial Sensors in a Smartphone,” IEEE Sensors Journal, vol. 16, no. 11, pp. 4566–4578, 2016. DOI:

L. Bao and S. S. Intille, “Activity Recognition from User-Annotated Acceleration Data,” in Pervasive Computing, A. Ferscha and F. Mattern, Eds. Berlin, Heidelberg: Springer Berlin Heidelberg, 2004, pp. 1–17. DOI:

W. Xiao and Y. Lu, “Daily Human Physical Activity Recognition Based on Kernel Discriminant Analysis and Extreme Learning Machine,” Mathematical Problems in Engineering, vol. 2015, p. 790412, 2015. [Online]. Available: DOI:

R. Igual, C. Medrano, and I. Plaza, “A comparison of public datasets for acceleration-based fall detection,” Medical Engineering and Physics, vol. 37, no. 9, pp. 870–878, 2015. [Online]. Available: DOI:

S. Abbate, M. Avvenuti, P. Corsini, J. Light, and

A. Vecchio, “Monitoring of Human Movements for Fall Detection and Activities Recognition in Elderly Care Using Wireless Sensor Network: a Survey,” Wireless Sensor Networks: Application-Centric Design, pp. 1–22, 2010.

A. T. Özdemir, “An analysis on sensor locations of the human body for wearable fall detection devices: Principles and practice,” Sensors (Switzerland), vol. 16, no. 8, 2016. DOI:

X. Sun, L. Qiu, Y. Wu, Y. Tang, and G. Cao, “Sleepmonitor: monitoring respiratory rate and body position during sleep using smartwatch,” in Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, vol. 1, no. 3, 2017, pp. 1–22. DOI:

B. Fida, I. Bernabucci, D. Bibbo, S. Conforto, and M. Schmid, “Varying behavior of different window sizes on the classification of static and dynamic physical activities from a single accelerometer,” Medical Engineering and Physics, vol. 37, no. 7, pp. 705–711, 2015. [Online]. Available: DOI:

K. Maswadi, N. A. Ghani, S. Hamid, and M. B. Rasheed, “Human activity classification using Decision Tree and Naïve Bayes classifiers,” Multimedia Tools and Applications, vol. 80, no. 14, pp. 21 709–21 726, 2021. DOI:

T. H. Lee, A. Ullah, and R. Wang, “Bootstrap Aggregating and Random Forest,” Advanced Studies in Theoretical and Applied Econometrics, vol. 52, pp. 389–429, 2020. DOI:

D. Anguita, A. Ghio, L. Oneto, X. Parra, and J. L. Reyes-Ortiz, “A Public Domain Dataset for Human Activity Recognition Using Smartphones,” in Proceedings of the 21th international European symposium on artificial neural networks, computational intelligence and machine learning, 2013, pp. 437–442.




How to Cite

Dao, T.-H., Hoang, H.-Y., Hoang, V.-N., Tran, D.-T., & Tran, D.-N. (2022). Human Activity Recognition System For Moderate Performance Microcontroller Using Accelerometer Data And Random Forest Algorithm. EAI Endorsed Transactions on Industrial Networks and Intelligent Systems, 9(4), e4.