AIM: Autonomic nervous system (ANS) activities during different types of stress could affect the electrocardiogram (ECG) signal. This study aimed to recognize the types of stress by using different ECG signals in order to prevent its actual physiological effects on the heart signal. METHOD: The ECG signal recorded by portable wrist bracelets from 20 students in during seven phases which incorporated three different types of stress and four relaxation phases. After different forms of windowing the signal, we used linear and non-linear features such as detrended fl uctuation analysis (DFA), Poincaré plot, approximate and sample entropy, correlation dimension, and recurrence plot to extract various features of the heart rate variability (HRV). Then, different classifi ers were used to identify the types of stress. RESULTS: The results showed a decrease in NN50, RMSSD, pNN50, and recurrence plot features, and an increase in the DFA method during stress stages, which show the effect of stress on heart rate. Also, by using the convolutional neural network (CNN), an average classifi cation rate of 98 % was obtained in association with cognitive stress and that of 94.5 % in association with emotional stress. CONCLUSION: This paper showed that features extracted from HRV can detect the stress and non-stress stages with high signifi cance. Also, the accuracy of this paper proved that the proposed method is successful in preventing the dangerous effects of different types of stress on the heart (Tab.