Disruption of the flow of breathing during sleep will result in significant heart problems if
 not treated seriously. An electrocardiogram (ECG) recording is one of the most used
 methods for detecting sleep disorders early on. An ECG is a representation of electrical
 activity in the heart while it is beating. The irregularities of the morphology and the
 complexity of the recordings have clinical significance that can be used as a tool for
 diagnosing sleep disorders. This study uses engineering to obtain features from ECG
 recordings that are carried out automatically using deep learning machine learning with
 a Convolutional Neural Network (CNN) model approach. The ECG recordings were
 processed to remove noise before being used in the CNN model. Tests are carried out on
 the most optimal model to get good accuracy by applying two scenarios. The test results of
 the two scenarios show that scenario one has an accuracy of 83.03% compared to scenario
 two with an accuracy of 76.88%. Meanwhile, the precision, sensitivity, cohens kappa and
 ROC UAC levels were 81.78%, 87.78%, 65.73% and 82.68% in scenario one testing on the
 CNN model with the most optimal parameter settings, respectively