Due to the increasingly fast-paced life in the city, people have become exhausted. In addition, the increasing severity of aging also reminds society of the need to reduce the difficulty of using electrical appliances. To change this situation, smart homes came into being, which can also greatly reduce the energy consumed by users at home. In this paper, based on a data set that records sensor data under different activities provided by a mobile phone worn on the waist, an activity recognition tool has been developed to provide a new control strategy for smart homes. This tool classifies user activities including standing, sitting, lying, walking, going upstairs and downstairs by analyzing data from the sensors. It realizes real-time transmission and update of human body movement data through the signal of Micro Controller Unit (MCU). Then, we use customized machine learning algorithm based on experiment data and a method based solely on human movement data to analyze and identify user activity. The main superiority of this system is that the hardware used is simple, efficient, and cost-effective. After evaluating the proposed system, we have found that it has obtained more than 85% accurate recognition of human activities. Different from the current mainstream algorithms based solely on machine learning, we have also introduced data related to human kinematics to better fit the training model. For users with different physical conditions, different parameters can be configured for better versatility.