Spring 2016 A-TeChToP Seizure Detection Methodology

By: Rose Leidenfrost (Electronics Engineer)

Overview

This post covers the methodology, hardware, software of the seizure detection circuit using the Arduino Pro Mini.

Table of Contents

Methodology

Combined data from an accelerometer and electrodermal activity sensor can accurately detect grand mal seizures as accurately as an EEG [1]. The two sensors are to be integrated with a microcontroller in the proposed wrist worn device with electrodes placed on the planar side of the distal forearm. The electrodermal activity sensor applies a current density of less than 10 uA/Cm^2 across the two electrodes to properly measure skin conductance. The output voltage of the sensor is read in to the ADC of the microprocessor with a 10 bit resolution and then converted into the skin conductance value measured in uS (micro Siemens). The 3-axis accelerometer is used to measure acceleration and is connected to the microcontroller via I2C. The 3-axis data from the accelerometer will be converted to a magnitude acceleration value measured in g’s. Both signals are filtered for noise reduction and removal of artifacts. The seizure detection algorithm determines if both the skin conductance and acceleration are over threshold values determined by studies from [1] and then activates a seizure alert which is modeled by an LED. This device satisfies the following level 1 and 2 requirements.

Requirements

Level 1:

  1. “The device shall accurately measure electrodermal activity such that the detection of grand mal seizures will match that of a traditional electroencephalogram.”

Level 2:

  1. “The sensor shall measure the exosomatic EDA (skin conductance) by injecting a constant current of less than 10 uA/Cm^2 into the two electrodes and measuring the potential difference between the two.”
  2. “A 3-axis accelerometer with a sampling frequency of 32 Hz, 8-bit resolution, and a range of +/-2g shall be implemented to measure acceleration.”
  3. “A machine algorithm shall be designed to detect the rhythmic patterns of a seizure and combine it with the data from the EDA sensor, and automatically send an alert if both indicate a seizure.”
  4. “For ergonomic purposes, the electrodermal activity sensor electrodes shall be placed on the ventral side of the distal forearm, of the non-dominant hand, so that the signal is far less susceptible to motion artifacts.”

Hardware

EDAHard

Fig. 1, The breadboard implementation of the seizure detection circuit.

Components

5V Arduino Pro Mini

ITG3200/ADXL345 Six degrees of freedom combination accelerometer and gyroscope*

BITalino EDA sensor

(2) Disposable electrodes

LM358 Operational Amplifier

Red LED

(5) 1uF Capacitors

(3) 0.1 uF Capacitors

(1) 220 ohm Resistor**

(1) 510 ohm Resistor**

(2) 1k ohm Resistors**

(1) 20k ohm Resistors**

(1) 30k ohm Resistor**

(1) 200k ohm Resistor**

(3) 100k ohm Resistor**

* Only the accelerometer functionality is used

** Many of the resistors are connected in series to achieve desired resistance

The BITalino EDA sensor has two input pins which are connected to the two electrodes which are placed 1 cm apart on the planar distal forearm. The remaining pins are Vcc connected to a 3.3V source obtained by using a buffered voltage divider, GND, reference voltage which is also created by a buffered reference voltage and the output voltage. The output voltage is connected to A0 on the Arduino Pro Mini. The buffered voltage is required because the Arduino Pro Mini supplies 5V from Vcc and both sensors require 3.3V for normal operation. A voltage divider is designed to reduce 5V to 3V, using R1 = 51.5 k ohm and R2 = 100k ohm and the following relationship vout = (r2/(r1+r2))*vin . A similar approach is also used to reduce the 3.3 V source to 1.65 V which is required for the reference voltage of the EDA sensor using R1 = 200k ohm and R2 = 200k ohm since the desired voltage is exactly half. Both voltage references use a LM358 op amp as a buffer with the small value capacitors connected to the output to reduce noise.

The ITG3200/ADXL345 signal is read into the Pro Mini using I2C serial communication. The sensor has pins for SCL, SDA, Vcc and GND. SCL is connected to A5 and SDA is connected to A4 which are the default pins for I2C. Vcc is connected to the buffered 3.3 V source.

A red LED is connected to digital pin 2 to serve as the seizure_event indicator.

Software

Software was written for the Pro Mini in the Arduino IDE and adapted from [2] and division manager Jeff Cool’s IIR filter functions.

Electrodermal  activity is read using AnalogRead  () passed through a 2nd order Butterworth low pass filter with cutoff frequency of 4Hz. This filtered value is then converted into a resistance value using the transfer function obtained from the datasheet of the sensor and the resolution of the ADC [3]. Skin conductance is then calculated by taking the inverse of the resistance and output to the serial plotter.

Accelerometer code was adapted from [2] which handles the sampling and serial communication. The acceleration from each x, y and z direction is obtained in g’s. From the three directions a magnitude value is calculated and filtered using an IIR derivative filter to smooth the signal. This filtered magnitude value is then also displayed by the serial plotter.

EDAOUT

Fig. 2, The output from the serial plotter in Arduino IDE, with skin conductance (uS) in blue in the range of 1.00 uS to ~15uS and the acceleration magnitude (g’s) in the range of 0 to ~800 g’s .

The seizure detection algorithm is performed by a nested if statement where if both the skin conductance and acceleration magnitude rise above threshold values a seizure event is detected and the LED connected to digital pin 2 goes high. Appropriate threshold values are realized from [1], the accelerometer threshold is equal to 650 g’s and the skin conductance threshold is equal to 10 uS. For testing the algorithm the conductance threshold value is lowered to a value that may be achieved by experimental sympathetic nervous system stimulation.

The complete Arduino code is available in the resources section of the Project summary blog.

Experimental Results

In order to simulate a seizure, a significant electrodermal activity response was simulated as well as an increase in acceleration. A response in skin conductance is related to the activity of the central nervous system which may be simulated by hyperventilation. The accelerometer movement was simulated by a vigorous shaking of the wrist which is a component of grand mal seizures. The test subject hyperventilated and shook for approximately 30 seconds in order to trip the seizure_event alarm.*

* The threshold value for skin conductance was reduced in order to be simulated by non-seizure sympathetic nervous system activity.

EDALI

Fig. 3, The red LED connected to digital pin 2 of the Pro Mini is high which corresponds to detection of a seizure event.

References

[1] R. Picard. (2012). EPIBAND: Electrodermal and Seizure Event Alert [Online]. Available: http://www.epilepsy.com/sites/core/files/atoms/files/ST-5-Picard.pdf

[2] Stable Orientation – Digital IMU 6 DOF + Arduino, (2012) [Online] Available: http://bildr.org/2012/03/stable-orientation-digital-imu-6dof-arduino/

[3] Electrodermal Activity Sensor Datasheet [Online] Available: http://bitalino.com/datasheets/EDA_Sensor_Datasheet.pdf