ECG board

An ECG board with an Arduino that sends samples over serial to a Processing monitor. I soldered and tested the board, connected the probes, and wrote the monitor, which draws a scrolling trace and estimates heart rate from the time between threshold crossings.

Hardware
Ninetales board and an Arduino
Software
An Arduino sketch and a Processing monitor
Context
A classroom monitor
Explore details

BME 2081C, University of Cincinnati · Summer 2026

ECG board

A soldered board, an Arduino and a Processing monitor, followed from the skin to a beat flag on screen.

Move the probe Where the numbers come from

I soldered
and tested the Ninetales board and connected the ECG probes
I adapted
the Arduino sketch from the course example
I wrote
the Processing monitor: trace, beat flag and rate estimate

Educational prototype. It is not a diagnostic or clinically validated monitor, and the trace on the scope is synthetic.

The signal chain, probe point by probe point

Signal scope synthetic trace

The scope screen shows a thin, jittery green trace with a slow drift. Small beat spikes are buried in the noise.
Probe at
Electrode leads
Screen
Raw analog voltage
Signal
weak

Threshold 450. Moving it sends the probe to the beat detector.

  1. The electrodes

    Three electrodes on the skin pick up the heart signal. At this point it is small, noisy and drifting.

    No code runs at the electrodes. The Arduino sketch starts at pin A1.

  2. The Ninetales board

    I soldered and tested this board. It amplifies and filters the electrode signal, then puts it on header pin A1.

    Code for this point: Which pin. The explorer below has it.

  3. Arduino pin A1

    analogRead turns the voltage on the pin into a whole number from 0 to 1023, a count.

    Code for this point: analogRead. The explorer below has it.

  4. The sampling loop

    loop() reads, sends, then waits delay(10). That is about 100 samples a second, nominal. I did not measure the real rate.

    Code for this point: delay(10). The explorer below has it.

  5. Serial at 9600 baud

    Each reading leaves as text: its digits, then a line break. Both programs have to use 9600 baud.

    Code for this point: println, begin 9600, Open the port, serialEvent. The explorer below has it.

  6. The Processing monitor

    serialEvent stores the newest number. draw() maps 300 to 600 onto the window height and plots one point per frame.

    Code for this point: Trace line, Erase bar, serialEvent. The explorer below has it.

  7. The beat detector

    A reading at or above the threshold sets a flag, then the detector re-arms 20 counts below. Gaps from 300 to 2000 ms give the rate.

    Code for this point: Beat and rate, Flash, Readout. The explorer below has it.

Source values

Nominal sampling rate from a 10 ms loop delay
about 100 HzNominal: the 10 ms delay plus conversion and serial time. I did not measure the actual rate. Source sketch
Analog input used on the Ninetales board
A1 Source sketch
Serial speed between Arduino and Processing
9600 baud Source sketch
Beat-detection threshold in the Processing monitor
450A raw ADC count hard-coded in the source: a fixed threshold with no adaptive detection. Source sketch

The 100 Hz is nominal; I did not measure the real rate. The threshold is a fixed constant, and the heart-rate figure is an estimate from the gap between detected peaks.

No schematic or parts list is published, because none is cleared for release.