Usb Dux

Hardware: USB-DUX

Software: Comedi, Bio-Music OpenSoundControl Namespace

=====

For brainwaves to be measured, they have to be massively amplified on the order of thousands to millions of times. EEG measured on the scalp is typically around 2-20 microvolts, which needs to be in the range of .5 - 5 volts to be accurately measured using standard Data Acquisition (DAQ) hardware with good precision.

We are working on an open-source combination of biosignal amplifier and data acquisition device.

Biosignal amplifier

The open-source biosignal amplifier is designed to work with the USB-DUX data capture device, both designed by Bernd Porr. The amplifier is provided only in schematic form and cannot be bought pre-built.

USB-DUX

The USB-DUX is an open-source hardware project originated at the University of Stirling by Bernd Porr. Its goal is to make an inexpensive, flexible, DAQ which uses USB for data transfer. The USB-DUX was recommended by Peter Carss of i-DAT at the University of Plymouth and was planned to be used there for a large-scale installation.

It can sample fro 4-16 channels simultaneously with ?? bit precision and ??? sampling rate. It has many interesting features including multi-channel simultaneous sampling and opto-isolation which are necessary for bio-signal work. Similar instruments from industry leader National Instruments have prices beginning around $2000.

The USB-DUX uses the open-source Comedi drivers on the host computer to configure, control and capture data from the device. The versions of the USB-DUX which tried include the D which has up to 8 channels of sampling over a USB 1.1 interface, and the Fast, which has up to 16 channels over a USB 2.0 interface. The USB-DUX D has the advantage of being able to be directly connected to the open-source biosignal amplifier.

The device uses USB not only for data transport but also as a power source. It is possible to piggyback the biosignal amp onto the same USB power source, but, for obvious reasons of safety we chose not to do this and opted for battery power for the amp. It is feasible, however unlikely, that a power surge could pass down the USB bus and into the biosignal amp circuit and consequently to the human subject.

Isolation

It is important that there never be any - even possible - direct circuit path from mains current into measurement equipment which is directly connected to a human subject. Optically isolating the data path is the most commonly used way of breaking this link: electrical signals are converted to light, usually as PCM encoded sampled signals, an LED then emits these signals which are then picked up by a corresponding light sensor and then re-converted to electrical signals. This method usually involves very little loss of signal fidelity.

Problems with Biosignal Amplifiers

1. Soldering the biosignal amplifiers boards proved to be challenging. They are using microelectronic surface-mount components (SMC) which are certainly widely used in electronics manufacture for many good reasons today. These components are however designed to be soldered by automatic achines and generally not by humans. We had on board built by a professional electronics technician (Christian Kinon) and built one ourselves (Mitchel Benovoy). The board built under ideal conditions by the electronics technician did seem to function properly when tested but the second one did not seem to function. We have components for another 4 boards so we plan to ask Christian Kinon to build them for us. These boards can be varied in sensitivity at the input via a suitable resistor which can be changed via a switch and thus allows us to measure a range of signals from weak ones such as EEG to much higher amplitude ones such as EMG or EKG. It is thus possible to make a general purpose biosignal amp using one of these boards.

Problems with Comedi Drivers

A significant amount of time was spent in trying to get the open-source Comedi drivers to work with the USB-DUX boxes. THe Comedi project drivers support a wide variety of DAQ hardware including devices from National Instruments etc. They run only under Linux, and are then quite finicky about kernel versions and different Linux distributions. It seems that the Comedi drivers for the USB-DUX are developed using jDebian Linux with kernel version 2.6.x. It was claimed by the developer, Bernd Porr, that the packaged installers for theses would work on the latest version of Ubuntu Linux with the 2.6.x kernel but we could never get them to work. Additionally, the driver mechanism for Linux has recently changed from ‘hotplug’ to ‘udev’. We used the newer udev mechanism but Bernd Porr indicated to me that he felt the older mechanism might be more reliable.

The only way I could get the drivers to work reliably was to download the driver source code and manually compile and install them. Below is the series of commands you will need to perform in the Unix terminal (Bash shell) to accomplish this:

Starting with a clean install of the latest version of Ubuntu Feisty (7.04 desktop from http://www.ubuntu.com/)

0. Apply all available upgrades to the system.

1. Install the neccessary developer tools:

apt-get install build-essential

2. Get source code for Comedi and Comedilib

wget http://www.linux-usb-daq.co.uk/drivers2/comedi.tar.gz
wget http://www.linux-usb-daq.co.uk/drivers2/comedilib.tar.gz

3. Unpack the source files (and put them in a suitable place)

tar zxvf comedi.tar.gz
tar zxvf comedilib.tar.gz

4. Compile and install the drivers

cd comedi
./configure —disable-pcmcia
make
sudo make install
sudo depmod -a

5. Compile and install the libraries

cd comedilib
./configure —with-udev-hotplug=/lib —sysconfdir=/etc
make
su make dev
make install

You should now be able to plug in the USB-DUX and have it recognised, configured and attached to the system. To ensure that the DUX is properly recognized, open up a terminal and type the following which will enable to see system messages which will indicate this:
tail -f /var/log/syslog

When the USB-DUX is plugged in, you should eventually see the a message similar to the following:

comedi0: successfully attached to usbdux.

Note that the USB-DUX Fast can only operate over USB 2, which, we found to our great surprise,is not universal on even newer computers in all cases.

Once comedi and comedilib have been compiled, install and verified, you will find some command-line tools in the /demo directory which can be used to test the basic functionality of the unit. There are also a number of measurement and display applications which can talk to comedi in order to capture and display data from the unit.

The eventual goal, as noted elsewhere, is to write a server application which can talk to comedi, capture the sampled data and immediately send it using OSC over UDP multicast to the local network. Largely because of the problems we had just with the driver software, this task remains to be completed.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License