Using radiographic changes of COVID-19 in the medical images, artificial intelligence techniques such as deep learning are used to extract some graphical features of COVID-19 and present a Covid-19 diagnostic tool. Differently from previous works that focus on using deep learning to analyze CT scans or X-ray images, this paper uses deep learning to scan electro diagram (ECG) images to diagnose Covid-19. Covid-19 patients with heart disease are the most people exposed to violent symptoms of Covid-19 and death. This shows that there is a special, unclear relation (until now) and parameters between covid-19 and heart disease. So, as previous works, using a general diagnostic model to detect covid-19 from all patients, based on the same rules, is not accurate as we prove later in the practical section of our paper because the model faces dispersion in the data during the training process. So, this paper aims to propose a novel model that focuses on diagnosing accurately Covid-19 for heart patients only to increase the accuracy and to reduce the waiting time of a heart patient to perform a covid-19 diagnosis. Also, we handle the only one existed dataset that contains ECGs of Covid-19 patients and produce a new version, with the help of a heart diseases expert, which consists of two classes: ECGs of heart patients with positive Covid-19 and ECGs of heart patients with negative Covid-19 cases. This dataset will help medical experts and data scientists to study the relation between Covid-19 and heart patients. We achieve overall accuracy, sensitivity and specificity 99.1%, 99% and 100%, respectively.Supplementary InformationThe online version contains supplementary material available at 10.1007/s11760-023-02561-8.