ECG machine with arduino Mega 2560

Electrocardiogram machine


Design

A/D converter

This block was implemented using a analog pin in the Arduino Uno. This unit runs on battery (9V) and the firmware has a interrupt of 1000 Microsecond. So that in every 1 millisecond the analog input takes value which is a 10 bit floating number. This part is not connected to ground.

Digital to serial

This block was implemented in the Arduino Uno board. the digital value of the analog input pin is converted into two bytes (High byte and Low Byte) and then transferred into the Serial to USB part through an isolator. This process is done along with the A/D converting so it runs in every 1 millisecond . Each time it runs it sends data to the serial connection at 115200 baud rate adn data is 2 bytes. This block also has several digital ports that can be turned on or off by Serial to USB block.

Isolator

This part was done using two opto-isolators IL710. These are one way high speed isolators. One is used for Rx port and another is for Tx port for the serial communication. One side is connected with Digital to serial block (Arduino Uno) and other side is connected to Serial to USB block (Arduino Mega)

Serial to USB

This part is very important as this connects with Digital to serial block, PC software through USB and D/A converter. Arduino Mega 2560 was selected for this block. This board has several serial ports. Serial port1 was used for connecting to A/D converter at 115200 baud rate. The Rx and Tx lines are connected to the isolator. data comes from the A/D converter at each millisecond and this runs the Serial to USB block. Each time it receives data from A/D , it sends them to PC through normal serial communication at 115200 baud rate and also sends it to the D/A module . For identification of the COM port ‘#’ is used so that when the software sends a signal ‘9’ , the block sends back a ‘#’. after that these commands runs the serial to usb block through software:

1 - Start sending data2 - Stop sending data3 - Low gain4 - High gain5 - Notch on6 - Notch off7 - Overload on8 - Overload off9 - Arduino identifier

The D/A converter chip is connected to the mega 2560 by serial peripheral SPI bus .

D/A module

This block has following sections-

variable DC offset, signal adder , D/A converter low pass filter.

The variable DC offset was done by an op amp . The input was 5v and with gain -2.5V was created .

The signal adder was implemented by an op amp which has an unity gain . This section adds offset with the D/A signal.

The D/A conversion is done by a DAC IC (MCP4911) which has 10 bit resolution and runs every 1 millisecond.

The signal then goes into a low pass filter with a pole at 150 hz. This is a normal op amp RC filter . The R value is 10.610 k ohm and Capacitor is .1uF . The output is sent to the scope.

Schematic