Figure 4.20: Breadboard prototype of the instrumentation amplifier and high- pass filter circuitry.
Figure 4.21: The input signal used to test the instrumentation and high-pass filter circuitry – 10 Hz sinusoidal signal with amplitude of±10 mV.
Figure 4.22: The output signal obtained from the instrumentation amplifier and high-pass filter circuitry – 10 Hz sinusoidal signal with amplitude of±2 V.
The second stage of the amplifier tested was the low-pass filter circuitry, for which the bread- board prototype is shown in Figure 4.23. Figure 4.24 shows the input signal used to test the second stage, which is a 10 Hz signal with an amplitude of±20 mV. This signal reflects the expected output of the instrumentation amplifier circuitry when using the true expected signal for the instrumen- tation amplifier input given by actual EEG data collection. The expected gain of this circuitry is 50 V/V, which should produce an output signal of±1 V. The oscilloscope output measured at the output of the low-pass filter circuitry shown in Figure 4.25 reflects this expected result.
Figure 4.23: Breadboard prototype of the low-pass filter circuitry.
Figure 4.24: Oscilloscope output for direct measurement of the input signal from the signal generator, showing a 20 mV signal at 10 Hz
Figure 4.25: Oscilloscope output for the measurement taken at the output of the low-pass filter circuit – 10 Hz sinusoidal signal with an amplitude of±2 V.
Following successful testing of the two stages individually, the circuits were combined to test the full amplifier. Because of the previously-mentioned limitations of the signal generator, which cannot generate signals smaller than ±10 mV, some modifications were made to the circuit to account for this. Primarily, the gain resistor on the AD623 was changed to a 100 kΩ resistor, which provides a gain value of 2 V/V. This change prevents the output of the amplifier from being clipped once it surpasses the limitations of the selected ICs and of the power supply.
The full breadboard prototype is shown in Figure 4.26. The input signal applied to the full circuit is the same as that shown in Figure 4.21 – a 10 Hz sinusoid with amplitude ±10 mV. The final output of the full circuit is shown in Figure 4.27, which shows a ±1 V sinusoidal signal at a frequency of 10 Hz. These results are promising for future work on this project, which will be discussed in Chapter 5.
Figure 4.26: Breadboard prototype of the full amplifier circuit.
Figure 4.27: Oscilloscope output for the measurement taken at the output of the full circuit – 10 Hz sinusoidal signal with an amplitude of±1 V.
Chapter 5
Future Work
As mentioned previously, these components are designed to be implemented as part of a larger system. One of the next steps in developing such a system is to create a printed circuit board for the amplifier circuitry. This PCB will contain eight amplifier circuits as outlined in Chapter 4 to provide full access to all eight available input channels on the DAQ. Eight PCB-mount 1.5 mm touch-proof safety sockets will serve as the connectors for the electrodes to the amplifiers. All eight channels will be output through a DB-25 connector, which will be used to connect the circuitry to the collection device. A preliminary version of the PCB design for the amplifier circuits is shown in Figure 5.1. In addition to the amplifier channels, the board will contain circuitry to provide power to the amplifiers via a rechargeable 7.4 V lithium polymer battery, using the design given in [2]. This circuitry is shown in Figure 5.2. The PCB design uses a six-layer board to provide separate power planes for the positive and negative DC power signals and the signal ground, as well as a separate layer to run additional traces for the main circuitry.
Following the completion of the PCB design, printing, and assembly, the group seeks to integrate these systems as part of a larger system for use in EEG-based biofeedback research. This experi- mental setup will use these systems to provide EEG data to software on the secondary computer
Figure 5.1: Preliminary PCB design of the eight-channel amplifier circuit, show- ing the 1.5mm touchproof socket inputs and the DB-25 connector output.
described in Chapter 3, which will provide data processing to control a responsive visualization which will be used to study the potential of biofeedback in neuromodulation experiments. Ultimately, the group plans to use the fully-developed system to study the use of visual biofeedback as a therapeutic supplement to pharmaceutical treatments for epilepsy.
Although this research tried to address as many previously-identified or potential challenges in these designs as possible, there is always room for more improvement, especially in terms of selection of the components used in the data collection device. This could range from selecting components with better form factors to even further reduce the size of the device to developing a single stand-alone board which provides only the functions necessary for data collection. Additionally, the amplifier circuitry could be improved by adding adjustable features which allow one to configure the gains and filters of the different stages depending upon the research parameters and targets.
Figure 5.2: Circuit design for the rechargeable lithium polymer battery as given in [2].
Chapter 6
Summary and Conclusions
The designs described in this thesis accomplish the goals defined at the beginning of this re- search project. The improvements made to the data collection device design address the challenges and limitations outlined in the original research [3]. The new design resolves many of the issues with the previous enclosure, including the instability that resulted in many of the internal components becoming disconnected. The new design also reduces the overall size of the enclosure and standard- izes the inputs and outputs. The chosen method of networking between the device and a secondary computer was changed from an ad hoc network to pre-defined WiFi connections, which uses TCP connections to transmit data.
The developed amplifier circuitry is designed to amplify signals with a magnitude of 10-100µV to the range of ±1 V, requiring a voltage gain of approximately 1000 V/V. This is accomplished using a two-stage amplifier, the first stage of which is an instrumentation amplifier. The high input impedance and high CMRR offered by the instrumentation amplifier design made it an ideal choice for this application. This implementation provides a voltage gain of 200 V/V. The second stage makes use of an active low-pass filter that provides a gain of 50 V/V to achieve the desired amplification of the signal. In addition to amplification, the circuitry provides some preliminary
filtering at each stage of the amplifier. Specifically, the circuit is designed to attenuate signals below 0.16 Hz and above 50 Hz, with additional filtering of signals close to 60 Hz provided by a notch filter. These filters help to isolate the desired signals from common noise sources that may interfere with data collection.
Although these designs perform well in controlled tests, further testing is required to test the efficacy of their use for the intended purpose of creating a full visual biofeedback system. Specifically, the amplifier circuitry needs to be tested with an input signal that is reflective of typical EEG signals, and the data collection device needs to be tested in a real-time application to ensure that all aspects of the collection and transmission of data function correctly.
Overall, this research covered a broad array of topics, including 3D CAD modeling, computer networking, circuit design, and electronic device design and testing, and provided a better under- standing of the engineering design process. In addition to these more practical aspects, this research provided an in-depth understanding of creating documentation for a device that can be used for trou- bleshooting issues. These preliminary results show promise for future developments in this project, with regard to implementing the full feedback system.
Bibliography
[1] Measurement Computing Corporation, USB-1608FS-Plus User’s Guide, 2014. Rev. 5A.
[2] Z. Allen, T. Rahmatullah, and T. Ishalaiye,Innovative Lithium Polymer Battery Powered PCB for Experimentors. University of Mississippi Department of Electrical Engineering, May 2016.
[3] S. Singh, “Portable Bio-signal Data Logger,” Thesis, University of Mississippi, May 2017.
[4] K. Vinecore, M. Aboy, J. McNames, C. Phillips, R. Agbeko, M. Peters, M. Ellenby, M. Mc- Manus, and B. Goldstein, “Design and implementation of a portable physiologic data acquisition system,”Pediatr Crit Care Med, vol. 8, no. 6, 2007.
[5] K. Akingbade, I. Alimi, and T. Oni, “Design of a data logger for biomedical signals,”Interna- tional Journal of Electronics and Electrical Engineering, vol. 3, 01 2014.
[6] L. G. Luu, N. P. Nguyen, and T. Vo Van, “Design a customizable low-cost, matlab based wire- less data acquisition system for real-time physiological signal processing,” in6th International Conference on the Development of Biomedical Engineering in Vietnam (BME6) (T. Vo Van, T. A. Nguyen Le, and T. Nguyen Duc, eds.), (Singapore), pp. 313–317, Springer Singapore, 2018.
[7] S. A. Memon, A. Waheed, T. Ba¸saklar, and Y. z. Ider Ider, “Low-cost portable 4-channel wireless eeg data acquisition system for bci applications,” in2018 Medical Technologies National Congress (TIPTEKNO), pp. 1–4, Nov 2018.
[8] Trans Cranial Technologies, Wanchai, Hong Kong,10/20 System Positioning Manual, 2012.
[9] “EEG (electroencephalogram).” https://www.mayoclinic.org/tests-procedures/eeg/
about/pac-20393875. Last Accessed: 2019-03-24.
[10] Anker Innovations Ltd.,Anker PowerCore 10000.
[11] Raspberry Pi Foundation,Raspberry Pi Documentation.
[12] Analog Devices,AD623, 2018. Rev. F.
Appendices
Python Code
server daq.py
f r o m s o c k e t i m p o r t * f r o m _ t h r e a d i m p o r t * f r o m u l d a q i m p o r t * f r o m os i m p o r t s y s t e m f r o m sys i m p o r t s t d o u t
f r o m t i m e i m p o r t sleep , t i m e _ n s i m p o r t t h r e a d i n g
p r i n t _ l o c k = t h r e a d i n g . L o c k () def t h r e a d e d ( c ) :
try :
d a q _ d e v = d a q _ s e t u p () l o w _ c h a n = 0
h i g h _ c h a n = 7 r a n g e _ i n d e x = 0 if d a q _ d e v == -1:
r a i s e E x c e p t i o n ( " E r r o r : C o u l d not f i n d DAQ d e v i c e " ) a i _ d e v = d a q _ d e v . g e t _ a i _ d e v i c e ()
if a i _ d e v is N o n e :
r a i s e E x c e p t i o n ( " E r r o r : The DAQ d e v i c e d o e s not s u p p o r t a n a l o g i n p u t " )
d e s c = d a q _ d e v . g e t _ d e s c r i p t o r ()
p r i n t ( " C o n n e c t i n g to % s - p l e a s e w a i t . " % d e s c . d e v _ s t r i n g )
a i _ i n f o = a i _ d e v . g e t _ i n f o ()
i n _ m o d e = A i I n p u t M o d e . S I N G L E _ E N D E D
n u m _ c h a n = a i _ i n f o . g e t _ n u m _ c h a n s _ b y _ m o d e ( i n _ m o d e ) if h i g h _ c h a n >= n u m _ c h a n :
h i g h _ c h a n = n u m _ c h a n -1
r a n g e s = a i _ i n f o . g e t _ r a n g e s ( i n _ m o d e ) if r a n g e _ i n d e x >= len ( r a n g e s ) :
r a n g e _ i n d e x = len ( r a n g e s ) - 1 s y s t e m ( ’ c l e a r ’ )
try :
w h i l e T r u e :
d a t a = c . r e c v ( 1 0 2 4 ) . d e c o d e () if not d a t a or d a t a == " end " :
p r i n t _ l o c k . r e l e a s e () b r e a k
out = " "
for c h a n n e l in r a n g e ( l o w _ c h a n , h i g h _ c h a n + 1) :
out += " % 0 . 6 f , " % ( a i _ d e v . a _ i n ( channel , in_mode , r a n g e s [ r a n g e _ i n d e x ] , A I n F l a g . D E F A U L T ) )
out = " % d ,% s \ n " % ( t i m e _ n s () , out ) c . s e n d ( out . e n c o d e () )
s l e e p ( 0 . 1 )
e x c e p t K e y b o a r d I n t e r r u p t : p a s s
e x c e p t E x c e p t i o n as e : p r i n t ( " \ n % s " , e )
f i n a l l y :
if d a q _ d e v :
if d a q _ d e v . i s _ c o n n e c t e d () : d a q _ d e v . d i s c o n n e c t () d a q _ d e v . r e l e a s e ()
c . c l o s e ()
i n t e r r u p t _ m a i n () r e t u r n
def d a q _ s e t u p () : d a q _ d e v = N o n e a i _ d e v = N o n e
s t a t u s = S c a n S t a t u s . I D L E d e s c _ i n d e x = 0
i n t e r f a c e _ t y p e = I n t e r f a c e T y p e . USB try :
d e v s = g e t _ d a q _ d e v i c e _ i n v e n t o r y ( i n t e r f a c e _ t y p e ) n u m _ d e v s = len ( d e v s )
if n u m _ d e v s == 0:
r a i s e E x c e p t i o n ( " E r r o r : No DAQ d e v i c e s f o u n d " ) p r i n t ( ’ F o u n d % d DAQ D e v i c e ( s ) : ’ % n u m _ d e v s )
for i in r a n g e ( n u m _ d e v s ) :
p r i n t ( " \ t % s (% s ) " % ( d e v s [ i ]. p r o d u c t _ n a m e , d e v s [ i ].
u n i q u e _ i d ) )
r e t u r n D a q D e v i c e ( d e v s [ d e s c _ i n d e x ]) e x c e p t E x c e p t i o n as e :
p r i n t ( " \ n % s " % e )
r e t u r n -1
def M a i n () :
H O S T = " 1 9 2 . 1 6 8 . 2 . 1 1 "
P O R T = 1 2 0 0 0
s = s o c k e t ( AF_INET , S O C K _ S T R E A M ) s . b i n d (( HOST , P O R T ) )
p r i n t ( " S o c k e t b o u n d to p o r t % d " % P O R T ) s . l i s t e n (1)
p r i n t ( " S o c k e t is l i s t e n i n g " ) try :
c , a d d r = s . a c c e p t () p r i n t _ l o c k . a c q u i r e ()
msg = c . r e c v ( 1 0 2 4 ) . d e c o d e () if msg == " r e a d y " :
p r i n t ( " C o n n e c t e d to : % s : % s " % ( a d d r [0] , a d d r [ 1 ] ) ) t1 = t h r e a d i n g . T h r e a d ( t a r g e t = t h r e a d e d , a r g s =( c ,) ) t1 . s t a r t ()
t1 . j o i n () e l s e :
p r i n t ( " C o u l d not e s t a b l i s h the c o n n e c t i o n " ) e x c e p t ( K e y b o a r d I n t e r r u p t , C o n n e c t i o n R e s e t E r r o r ) as e :
p r i n t ( " E n d i n g p r o g r a m " )
if _ _ n a m e _ _ == " _ _ m a i n _ _ " : M a i n ()