A novel wearable consumer electronics device for detecting Major Depressive Disorder (MDD) has been developed using deep learning techniques for smart healthcare. Accurate identification of MDD through individual interviews or perceiving Electroencephalogram (EEG) signals is challenging. This study presents the concept of a novel wearable smart cap named DepCap for real-time detection of depression using EEG signals. First, spectrogram images are generated from the EEG signals of depressed and healthy patients using Short-Time Fourier Transform (STFT) to extract valuable features. Then, these spectrogram images obtained from STFT are used as input to the classification model. A deep analysis is done using various neural networks consisting of Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs). RNNs are used to extract temporal data from the EEG, while CNNs are used to retrieve spatial information. Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU) are the two different kinds of RNNs evaluated in this work. The implemented combination models are (STFT+CNN), (STFT+CNN-LSTM) and (STFT+CNN-GRU). Four pre-trained models, Inception, AlexNet, VGG16, and ResNet50 are also implemented along with the combination models. The dataset for this work is a publicly accessible dataset with 33 major depressive disorders and 30 healthy subjects. The evaluation results show that the STFT+CNN-LSTM has much better performance in terms of accuracy, sensitivity, specificity, and precision of 99.9%, 100%, 99.8%, and 99.4%, respectively, than other implemented models. The proposed wearable device DepCap is based on the STFT+CNN+LSTM model and is also integrated with the Internet of Medical Things (IoMT) framework for real-time depression detection.