Children's home accidents are less common than in the past. However, safety accidents continue to occur due to carelessness of the parents. To solve the problem, there are fall prevention screens that can withstand the weight of children, and safety railings that can be adjusted directly to solve the problem. However, these have disadvantages such as stability, convenience, and damage to the landscape. In this paper, we developed an automatic safety accident prevention fence system that can be installed on a window using Arduino, eliminating the disadvantages of previous safety accident prevention products. This system measures the height of a person standing in front of the fence and the distance between the person and the fence with two infrared sensors and moves automatically using a motor. In addition, in accordance with the U-Healthcare society, users can check the temperature, humidity, and fine dust concentration of the external environment through mobile. Each information can be obtained through DHT 11 sensor, fine dust concentration sensor, and Bluetooth connected toArduino. These can help the user's health care.