OpenEEG

doc / circuits / debugging / building

Schematics: Amplifier / Digital


Programming cable

2 x 220 ohm
DB 25 (centronics)

Serial Cable

The serial cable is a plain, 9-pin serial extension cable, sold by computer stores. 
On the ModularEEG, it should be connected to a 9-pin female D-sub connector, with solder-cups.

Programming the MicroController sp12 sp12.txt

Board to Board Cable

The board-to-board cable is a 34-lead ribbon cable. You can make one from an old floppy-disk cable.

Software

ElectricGuru (windows)

eegmir

ttysnoop

Notes

Power

If PWR = +5, replace D103 and IC107 (7805) with wires across thier inputs and outputs and mount D104. If PWR >= +7V, mount D103 and IC107 as intended, but do not mount D104

TMV0505S

Channel select
Electrode connection

Grounding

Each EEG channel inputs consists of two leads, and shielding.

The shielding can be connected to VGND, and the layout is designed for this setup in mind.

However, a device which connects the cable shields to the DRL output has been built. It has some advantages, such as possibly more stable DRL operation. In that device, the amplifier board itself is placed in a metal box which is attached to VGND, while the cable-shields are attached to the DRL. There is no direct electrical connection between VGND and the DRL output in this setup (or any other for that matter). Keep this in mind when you choose connectors.


Testing and trimming the Amplifiers

Setup

  1. Verify that you do not have any short circuits between the positive power rail, VGND and the negative power rail. VGND can be found on any ground via, or on pin 1 in the socket for IC201. Since we don't want to charge the electrolytic capacitors backwards, connect the COM lead (black cable) of your ohmmeter to VGND. The positive and negative power rails are then found on pin 8 and 4 respectively of IC201.
  2. Insert the amplifier ICs and connect the amplifier board to the digital board.
  3. Connect the ModularEEG to the computer and run ElectricGuru.
  4. Turn on the power and make sure the LED goes on. If it does not, switch off immediately and troubleshoot.
First test

Start ElectricGuru by clicking on the green stoplight button. Unless you have mounted the amplifier board inside a metal box, you should see lots and lots of 50/60Hz hum on both channels. If you have mounted the amplifiers inside a metal box, you are more likely to see a noise signal which resembles EEG (but isn't).

Coarse trimming

  1. Power down the ModularEEG
  2. Connect the U_cal and Cal_GND outputs to the inputs of one EEG channel. You find U_cal and Cal_GND in the upper right corner of the analog board. You can either use a shielded cable (shield goes to VGND) or two pieces of plain coupling wire. If you opt for the coupling wire, it is important that you do not touch the leads, or wave your hands near them, or you will se a lot of unwanted mains hum.
  3. Start ElectricGuru with the green stoplight button. You should now see a square wave being drawn on one channel.
  4. Adjust trimpot P202 or P203 depending on which channel you chose. until the wave is slightly less than half scale.
  5. Maximize the ElectricGuru window and open the traces-dialog from the preferences menu.
  6. Adjust the window height so that the traces become as large as possible and set the y-axis limits to 262 and 762.
  7. Close the dialog and adjust the gain with the trimpot until the square wave just touches the top and bottom of the graph window. If the graph is slightly off center, trim down the amplitude so that you see both the top and the bottom of the square wave.

Fine Trimming

Ideally, the test signal is 5 volts / 20,000 = 250uV peak to peak. This corresponds to a square wave alternating between the sample values 262 and 762. In reality, the amplitude depends on the supply voltage (referred to as U), which probably is not exactly 5 volts.

The actual amplitude of the square wave then becomes U / 20,000 volts peak to peak. Expressed in sample values, the upper level is M + U * 50 and the lower is M - U * 50.

Important: Notice that the square wave test signal may have little bumps right after its rising and falling edges. You should not look at them when you set the gain. You get best accuracy if you look at the amplitude where the wave is flat.

The y-axis limits found in the traces-dialog will be referred to as Ymin, and Ymax.

  1. First, measure the supply voltage U between any point on the +5V/3 net (basically the digital VCC) and GND.
  2. Open the traces-dialog again
  3. If the square wave is slightly off center from the coarse trimming, adjust the Ymin or Ymax value until the whole wave is perfectly centered in the graph window.
  4. Calculate M, from M = (Ymin + Ymax) / 2.
  5. Set Ymin = M - U * 50 and Ymax = M + U * 50. The ideal is Ymin = 262 and Ymax = 762, but your number will be different.
  6. Adjust the trimpot until the the square wave reaches the top and bottom edges of the graph window.
  7. Done. Restore Ymin to 0 and Ymax to 1023 and repeat the trimming procedure with the next channel.

Trimming the DRL

  1. Power down the ModularEEG and connect the DRL output to all (four) electrode inputs.
  2. Connect a (preferably digital) voltmeter to the DRL output and VGND. Set it to its lowest range setting so that you can measure millivolts.
  3. Power up the ModularEEG and trim P201 until the voltmeter shows zero volts. You should not be more than a few millvolts off.

Note: Most people will want to use INA114 instrumentation amplifiers and can therefore skip trimming if they replace P201 with a wire going from the wiper (connected to pin 5 on IC201B) to VGND. P201 is only required for other types of instrumentation amplifiers, e.g AD620.

Of course, if you mount P201, you will have to trim it, regardless of instrumentation amplifier type.


sparkfun analog sparkfun digital Online Metals Mailing list