  The electrocardiogram (ECG) signal is one of the most vital signals that can
be used to investigate the performance of heart. Based on the ECG graph, we can
identify different disorders and diseases. Therefore, monitoring this signal is
of great importance. Many electrodes (usually 12) are employed to acquire this
signal in clinics and hospitals; therefore, a nurse must install them on the
body of the patient to record the signal. In this project, we built a device
that can acquire the real-time ECG signal and display it on the mobile screen
with the least number of electrodes (three electrodes) without requiring a
nurse to install the electrodes using the simplest and cheapest type of ICs and
transmitters including STM32F030F4P6 microcontroller, AD620 instrumentation
amplifier, TL084 amplifier, TC7660 voltage converter, LM1117 regulator, and
HC-05 Bluetooth module. Moreover, the device was designed in a way that could
operate using a single 9V battery or power adaptor. First, to amplify the
signal and remove a part of its noise, the ECG signal is given to the primary
analog circuit. Then, in the digital section, using a microcontroller, the
signal is discretized, processed, and finally transmitted to a mobile phone for
final processing, information extraction, and displaying. In the mobile-written
application, we developed a mathematical algorithm based on Pan-Tompkins
algorithm to calculate the heartbeat rate, in which the signal peaks are
determined after several processing steps using a threshold. In this regard,
the ECG signals of 10 subjects were recorded and analyzed to calculate the
optimum threshold. Finally, the power spectral density (PSD) and input referred
noise were calculated and plotted to check the output signal quality. Based on
the PSD and input referred noise amplitudes, we achieved a signal-to-noise
ratio of 50dB.
