Many countries actively promote the benefits of sports; in particular, water sports are popular among the younger generation. However, despite the mature development of equipment in diving, it requires relevant training to avoid decompression sickness. Sometimes when divers encounter emergencies and they may fail to alert the coach or other companions for rescues. Currently, some divers wear emergency equipment when conducting the exercise; yet, the cost is relatively high, and the operation is complicated that people tend to forget the process when facing emergencies. This article aims to develop a wearable device that has a safety alarm function based on the technique of machine learning. The features of the suggested device are as follows: (1) cost-effective detectors for monitoring divers' conditions; (2) a combination of an Automatic Identification System (AIS) with a Global Positioning System (GPS) to send a safety alarm with the location of the diver; (3) utilize Bluetooth communication to detect if a diver left the safety range set by the coach; (4) the machine learning technique judges the health status of the diver; (5) the wearable device connects with swim goggles to deliver danger alarms, which enables divers to notice dangerous situations from the lights on the goggles. The approach suggested in this article primarily utilizes wearable devices to ensure divers' safety. The key feature of this device can prevent divers from sweeping away by currents or swimming into risky areas; meanwhile, the device can detect the risk of decompression sickness. The research executed an experiment to verify the design, and the results have proven the feasibility of the study. Additionally, with the cost-effective detectors installed on the device, the presented equipment has the potential to make it universal and increase the safety of divers.This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.