Vous êtes sur la page 1sur 40

Project: Brain Computer Interface using EEG

Introduction
Mind control is no longer a mystical practice. In recent years scientists, doctors and engineers have been investigating the use of brain, and muscle tissue electrical signals to control computers. In Electroencephalogram (EEG) and electromyography (EMG), waves read of the brain and muscle tissue respectively, can be amplified and digitized to be analyzed and processed by a personal computer. Technology to acquire such signals requires low noise operation and careful design. In this project by using a standard EEG wave generated with 3 leads (G1, G2, GND) we can control LEDs. It is possible by two ways: 1. By generating alpha waves with lead connection at the Occipital lobe. 2. By eye blinking with lead connection at Prefrontal lobe. Design specifications were agreed upon after considerable research was done on existing state of the art EEG/EMG data acquisition systems. The bandwidth of alpha waves is approximately between 8Hz-12Hz. But for this project in hardware model we are generating a bandwidth of 5Hz-31Hz which is filtered by software developed in java. This report discusses the design and approach taken to undertake such a task. Furthermore, other amplification components were researched to fully be convinced of the correct approach.

PCB DESINING
PCB stands for PRINTED CIRCUIT BOARD. Printed circuit board (PCB) provides both the physical structure for mounting and holding the components as well as the electrical interconnection between the components. That means a PCB = PWB (printed wiring board) is the platform upon which electronic components such as integrated circuit chips and other components are mounted. A PCB consists of a non-conducting substrate (typically fiber glass with epoxy as resin) upon which the conductive pattern or circuitry is formed. Copper is the most prevalent conductor although nickel, silver and tin are also used in some cases.

Types of PCB
PCB may be of different types:1) Single-sided 2) Double-sided 3) Multilayer

Single sided PCBs: - As the name suggest in these designs the conductive pattern is only at in
one side. And also the size is large in these case but these are cheap.

Double sided PCBs: - These are the PCBs on which the conductive pattern is in on both sides.
The size of board is small in this case but it is costlier than that of above.

Multilayer PCBs: - In this case the board consists of alternating layers of conducting pattern and
insulating material. The conductive material is connected across the layers through plated through holes. The size of this PCB is smaller than that of double sided PCB but it is very costly. PCBs may also be either rigid, flexible, or the combination of two (rigid-flex). When the electronic components have been mounted on the PCB, the combination of PCB and components is an electronic assembly, also called PRINTED CIRCUIT ASSEMBLY. This assembly is the basic building block for all the electronic appliances such as television, computer and other goods.

FUNCTIONS OF PCB
Printed circuited boards are dielectric substrates with metallic circuitry formed on that. They are sometimes referred to as the base line in electronic packaging. Electronic packaging is fundamentally an inter connection technology and the PCB is the baseline building block of this technology.

TECHNIQUE USED FOR PCB DESIGN


There mainly two techniques which are used for the PCB designs. 1. Hand Taping 2. Computer Aided Design

1. PCB Designing using Hand Taping:


i. PCB design using hand taping is the process of technical drawing. ii. In hand taping method layout should be prepared on grid paper. iii. In hand taping, components pads can be prepared by using black pads. iv. Routing of the board can be done by tapes with different widths.

Disadvantages of Using Hand Tapping:


i. Each layer has to be designed separately. ii. Difficult to modify the design in the designing process or after designing. iii. Difficult to get good design overview.

2. PCB Designing Using CAD:


All the above difficulties can be removed by using CAD system.

CAD system for PCB designing requires following:

A computer system. PCB design software like OrCad, CADSTAR, Protel, TANGO, Mentor etc. A photo plotter for art work generation.
There are many enhanced features in electronic design automation tools which not possible in the hand taping. The main advantages are given below:

Auto placement Auto routing After routing, optimization of tracks can be done. Provides physical design reuse modules Electrical rule check (ERC) All the layers are generated from the same design by giving different options. Bill of material can be generated which contains number of different components used. We can draw conductors as an arc, semi-circular at different angles. Design Rule Check Advanced CAD systems have high speed analysis.

Basic Design Steps In CAD- System


The following design steps are very common while designing a PCB in CAD:

Entry the schematic diagram. Net list file creation. Placement of components manually or automatically. Routing of the board using manual routing tools or auto router Design rule check physical and electrical. Artwork generation.

A TRADITIONAL DESIGN FLOW IN CAD- SYSTEM

Capture

Gerber tools

Gerber and plotter drawing

Libraries Layout Footprint libraries

Gerber and drill files

PCB Design Softwares


There many soft wares which are used for PCB designs. Some of them are given below:-

OrCad CADSTAR Protel TANGO Mentor


The most commonly software which are used for PCB design in India are Protel and OrCad

OrCad Design Environment


OrCad has a long history of providing individuals and teams with a complete set of technologies that offer unprecedented productivity, seamless tool integration, and exceptional value. 10.5 releases continue that tradition. Today's lower cost and yet highly sophisticated electronic design automation systems have created a unique challenge to nearly every engineering department. Therefore the use of EDA tools has become increasingly important as product lifecycles have become shorter and shorter. Modern electronic design automation (EDA) tools are beginning to support a more efficient and integrated approach to electronic. OrCad Capture design entry is the most widely used schematic entry system in electronic design today for one simple reason: fast and universal design entry. Whether you're designing a new analog circuit, revising schematic diagram for an existing PCB, or designing a digital block diagram with an HDL module, OrCad Capture provides simple schematic commands you need to enter, modify and verify the design for PCB. OrCad Layout offers PCB designers and PCB design teams the power and flexibility to create and share PCB data and constraints across the design flow. OrCad Layout delivers all the capabilities to designers need from net list to place and route, to final output. The ease-of use and intuitive capabilities of OrCad Layout provides for quick startup and rapid learning right out of the box.

PCB DESIGN STEPS IN OrCad 10.5 Entry of Schematic Diagram


Schematic diagram provides the functional flow and the graphical representation of an electronic circuit. The entry of schematic diagram is the first step in PCB design using OrCad.

A schematic diagram consists of:-

Electrical connections(nets) Junctions Integrated circuits symbols Discrete components symbols like resistors, capacitors etc. Input / output connectors Power and ground symbols Buses No connection symbols Components reference names Text

The Schematic Page Editor:


The schematic page editor is used to display and edit schematic pages. So that one can parts; wires; buses and draw graphics. The schematic page editor has a tool palette that you can use to draw and place everything you need to create a schematic page. One can print from within the schematic page editor, or from the project window.

The Part editor:


The part editor is used to create and edit parts. From the view menu of the part editor you can choose either part or package. In part view one can:-

Create and edit parts and symbols, then store in new or existing libraries. Create and edit power and ground symbols, off-page connector symbols, and title block Use the tool palettes electrical tools to place pins on parts, and its drawing tools to
draw parts and symbols.

The Session Log:


The session log lists the events that have occurred during the current Capture session, includes message resulting from using captures tools. To display context-sensitive

help for an error message, put the cursor in the error message line in the session log press F1. The ruler along the top appears in either inches or mill meters, depending on which measurement system is selected in the window panel. Your tab setting are saved and used each time you start capture.

One can search for information in the session log using the find command on the Edit menu. You can also save the contents of the of the session log to a file, which is useful when working with Orcads technical support to solve technical problems. The default filename is SESSION.TXT.

The Toolbar:
Captures toolbar is dock able (that means you can select and drag the toolbar to new location) as well as resizable, and displays tool tips for each tool; by choosing a tool button you can quickly perform a task. If tool button is dimmed, you cant perform that task in the current situation.

Some of the tools operate only on what you have selected, while others give you a choice of either operating on what is selected or expanding the scope to entire project. You can hide the toolbar, then display it again when u need it. For hiding select from the schematic page editors view menu, choose TOOLBAR.

The Tool Palette:


Capture has two tool palettes: one for the schematic page editor and one for the part editor. Both tool palettes are dock able and resizable. They can also display tool tips that identify each tool. The drawing tools on the two tool palettes are identical, however, each tool palette has different electrical tools after you choose a tool, and you press the right mouse button to display a context- sensitive pop-up menu.

The schematic page editor tool palette:


The first group of tools on the tool palette is electrical tools, used to place electrical connectivity objects. The second group of tools is Drawing tools, used to create graphical objects without electrical connectivity.

The part editor tool palette:


The first group of tools on the part palette is electrical tools, used to place pins and symbols. They have been already explained above within the schematic page editor tools. The second group of tools is drawing tools, used to create graphical objects without objects any electrical connectivity and is described:

Pin Tools: Place pins on part Pin Array: Place multiple pins on part

Selecting and deselecting of objects


Once one selects an object, one can perform operations on it, include moving, copying, cutting, mirroring, rotating, resizing, or editing. One can also select multiple, objects and edit them, or group them in to a single object. Grouping objects maintain relationship among them while one moves them to another location.

Creating Net list File


Net-list file is a document file which contains information about the logical interconnections between signals and pins. Before one create a net list file, be sure ones project is completed, annotated and it is free from electrical rule violations. A net list file consists of nets, components, connectors, junctions, no connection symbol, power and ground symbols.

Creation of net list in capture:


Select your design in the project manager. From the tools, choose create net list. The net list dialog box displays. Choose a net list format tab.

If necessary, set the part value and PCB foot print combined property strings to reflect
the information you want in the net list.

Click ok to create the net list. In the net list file text box, enter a name for the output file. If the selected format creates
an additional file, enter its file name in the second text box.

Placement of Layout Plus What is Layout Plus?


Layout plus is one part for the PCB design in which we place as well as route the components an set unit of measurement, grids, and spacing in OrCad. Within other soft wares you also have to place and route the components in similar way. For the placement and routing of the components we normally use auto-placement and auto-routing. Unfortunately, in a lot of soft wares some critical signals have to be routed manually before auto-routing. In layout plus we also define the layer stacks, pad stacks and via's.

Steps for board design:


At first, we have created a net list from our schematic diagram by using capture. Layout plus includes design rules in order to guide logical placement and routing. That
means, load the net list into layout to create the board. At the same time you have to specify the board parameters.

Specify board parameters: Specifying global setting for the board, including nits of
measurements, grid, and spacing

Place components: Use the components tool in order to place manually the components
which are fixed by the system designer on the board or otherwise use auto-placement.

Route the board: Use different routing technologies to route the board and take
advantage of push and shove (a routing technology), which moves track you are currently routing as well as you can also auto route the board.

Provide finishing of the board: Layout supplies an ordered progression of commands


on the auto menu for finishing your design. These commands include design rule check, clean-up design, rename components, back annotate, run post processor, and create reports.

The design window:


The design window provides a graphical display of printed circuit board, it is primary window you use when designing your board. It also provides tools to facilitate the design process such as to update components and design rule violation.

Main window

Method to create a board with Layout Plus:


Ensure that net list with all footprints and necessary information has been created. Create a directory in which the schematic design, net list, and boar will co-exit and put
the schematic design and net list. OrCad provides a directory for this purpose.

From the layout session frames file menu, choose New. The load template file in the
dialog box displayed.

Design window

Select the technology template (.TCH), then choose the open button and load the net
list in other box.

Then apply the auto ECO. If necessary, respond to link footprints to component dialog. Draw the board outline by using the obstacle tool in the tool bar.

Setting board parameters:


There is some parameter which should be set before placing the components on board. They are as follows:-

Set Datum Create a board outline Set units of measurements Set system grid Add mount holes

Creating of board outline:


Board outline is the graphical representation of the size of the actual PCB board. So it is the main step in layout, to draw the board outline of the actual size of PCB board.

Placement of components:
Placement of components means that to place the components in designed box. A designer should follow the following steps before going for it:-

Optimize the board for component placement. Load the placement strategy file. Place components on the board. Optimize placement using various placements

Components can be placed by using two techniques:1) Manual placement of components 2) Auto placement of components

Choose the components tool bar button. From the pop up men, choose the queue for placement. The components selection criteria dialog box appears. Enter the reference designator of the components that you want to place in the appropriate text box, and click ok. Drag the components to desired location, place it there.

Conductor Routing in Layout:After placing all the components the other main step is to route the board from the electrical connections between the components. One may route board manually or automatically by auto router. 100% auto routing can be achieved only when components are placed in the order of functional flow of electronic circuit. The main routing tool available in OrCad is as flow:-

Add/edit route mode Edit segment mode Shove track mode


Auto path route mode

Design Rule Check:In manual designs everything was checked as a possible source of error. Components sizes, hole sizes, conductor widths and clearance, land-to-hole-ratio, board areas to be free of components, clearance to the edges, positional accuracy and of course electrical interconnections had tad to be personally reviewed with a great deal of care. After completing the design of printed circuit board with the help of an EDA-Tool, a designer has again to verify the PCB in order to find out errors. Such type of verifications/design rule check contains beside the general verifications commonly two types:-

Physical verification Electrical verification

Post processing:Post processing can be done once the design is completed in all aspects. The common way is still a process to generate GERBER data and NCD files which can be used for photo plotting and for steps of CNC manufacturing and PCB- drilling.

Components used:
1. Microcontroller AT89C51 2. ADC 0804 3. NPD5566 4. LM7805 5. LM7812 6. LM7912 7. LM324 8. LF351 9. POT 10. Diodes 11. Resistors 12. Capacitors 13. LEDs 14. Connectors 15. Transformers 16. Electrodes

Details of Components:
Voltage regulator:
The voltage regulator is used for the voltage regulation purpose. We use IC 7805, IC 7912 and IC 7812 voltage regulator. The IC number has a specific significance. The number 78 and 79 represents the series while 05 and 12 represent the output voltage generated by the IC.

Resistors:
A resistor is a passive two-terminal electrical component that implements electrical resistance as a circuit element. Resistors are common elements of electrical networks and electronic circuits and are ubiquitous in electronic equipment. Practical resistors can be made of various compounds and films, as well as resistance wire (wire made of a highresistivity alloy, such as nickel-chrome). Resistors are also implemented within integrated circuits, particularly analog devices, and can also be integrated into hybrid and printed circuits.

Capacitors:
A capacitor (originally known as condenser) is a passive two-terminal electrical component used to store energy in an electric field. The forms of practical capacitors vary widely, but all contain at least two electrical conductors separated by a dielectric (insulator); for example, one common construction consists of metal foils separated by a thin layer of insulating film. Capacitors are widely used as parts of electrical circuits in many common electrical devices.

Potentiometer:
Potentiometers, sometimes called pots, are relatively simple devices. One terminal of the potentiometer is connected to a power source, and another is hooked up to a ground a point with no voltage or resistance and which serves as a neutral reference point. The third terminal slides across a strip of resistive material. This resistive strip generally has a low resistance at one end, and its resistance gradually increases to a maximum resistance at the other end. The third terminal serves as the connection between the power source and ground, and it usually is operated by the user through the use of a knob or lever.

The user can adjust the position of the third terminal along the resistive strip to manually increase or decrease resistance. The amount of resistance determines how much current

flows through a circuit. When used to regulate current, the potentiometer is limited by the maximum resistivity of the strip.

Transformer:
We employ a 230V primary to 12V Secondary transformer. A transformer makes use of Faraday's law and the ferromagnetic properties of an iron core to efficiently raise or lower AC voltages. It of course cannot increase power so that if the voltage is raised, the current is proportionally lowered and vice versa.

Light emitting diode:


We employ a light emitting diode for testing the functionality of the power supply circuit. Here we use a 5 volts LED which is connected in series with the power supply circuit it

verifies the functioning of the power supply and 8 each LEDs. LEDs are also employed in other areas for many purposes. The following are the advantages of using LEDs. It helps us while troubleshooting the device i.e. when the device is mal-functioning it would be easy to detect where the actual problem is raised. LED employed with microcontroller verifies whether data entered is correct bus number or not. It verifies the functionality of the power supply.

Microcontroller AT89C51:

The AT89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmels high-density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set and pinout. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microcomputer which provides a highly-flexible and cost-effective solution to many embedded control applications.

ADC0804:

The ADC080X family are CMOS 8-Bit, successive approximation A/D converters which use a modified potentiometric ladder and are designed to operate with the 8080A control bus via three-state outputs. These converters appear to the processor as memory locations or I/O ports, and hence no interfacing logic is required. The differential analog voltage input has good common mode rejection and permits offsetting the analog zero-input voltage value. In addition, the voltage reference input can be adjusted to allow encoding any smaller analog voltage span to the full 8 bits of resolution.

LF351:

The LF351 is JFET input operational amplifier with an internally compensated input offset voltage. The JFET input device provides wide bandwidth, low input bias currents and offset currents.

LM324:

The LM124 series consists of four independent, high gain, internally frequency compensated operational amplifiers which were designed specifically to operate from a

single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. Application areas include transducer amplifiers, DC gain blocks and all the conventional op amp circuits which now can be more easily implemented in single power supply systems. For example, the LM124 series can be directly operated off of the standard +5V power supply voltage which is used in digital systems and will easily provide the required interface electronics without requiring the additional 15V power supplies.

LCD:

The LCD2S-162YHY is a Serial LCD Character Display Module with a high speed serial bus. The LCD display is a 2x16 character green display with a green LED backlight, and is RoHS compliant. Its name is HD44780.

Crystal Oscillator:

Crystal oscillator is kept in metal housing with two pins where you have written down the frequency at which crystal oscillates. One ceramic capacitor of 30pF whose other end is connected to the ground needs to be connected with each pin. Oscillator and capacitors can be packed in joint case with three pins. Such element is called ceramic resonator. A center

pin of the element is the ground, while end pins are connected with OSC1 and OSC2 pins on the microcontroller. When designing a device, the rule is to place an oscillator nearer a microcontroller, so as to avoid any interference on lines on which microcontroller is receiving a clock.

Electrodes:
Two types of electrodes are used: 1. EEG disc electrodes (Reusable silver/silver chloride)

2. Electrode Disposable (Centre Snap)

Circuit Schematic:

Circuit Layout

Top Layer

Bottom Layer

Program for Testing:


ORG 00H MOV A,#38H ACALL COM ACALL DELAY MOV A,#0EH ACALL COM ACALL DELAY MOV A,#01H ACALL COM ACALL DELAY MOV A,#06H ACALL COM ACALL DELAY MOV A,#84H ACALL COM ACALL DELAY MOV A,#'V' ACALL DATAWR ACALL DELAY MOV A,#'O' ACALL DATAWR ACALL DELAY MOV A,#'L' ACALL DATAWR ACALL DELAY MOV A,#':' ACALL DATAWR ACALL DELAY MOV P1,#0FFH

SETB P3.3 BACK: CLR P3.5 SETB P3.5 H1: JB P3.3,H1 CLR P3.4 MOV A,P1 MOV R0,A ANL A,0FH MOV R1,#30 ADD A,R1 ACALL DATAWR ACALL DELAY MOV A,R0 ANL A,0F0H RR A RR A RR A RR A ADD A,R1 ACALL DATAWR ACALL DELAY SETB P3.4 SJMP BACK COM: MOV P0,A CLR P3.0 CLR P3.1 SETB P3.2 ACALL DELAY CLR P3.2 RET DATAWR:MOV P0,A

SETB P3.0 CLR P3.1 SETB P3.2 ACALL DELAY CLR P3.2 RET DELAY: MOV R3,#50 HE2: MOV R4,#255 HE: DJNZ R4,HE DJNZ R3,HE2 RET END

Here ADC0804 is connected with port 1 of 8051 and LCD is connected to port 3(3.0, 3.1, 3.2) and port 0 of 8051 microcontroller.

Construction:
1. The schematic design is done through Cadence orcad Capture CIS ver. 10.5 2. The PCB design is done using Cadence Orcad Layout ver. 10.5. 3. Then the output gerber file was given to the PCB printing factory where it was printed. 4. The components were then placed on the card and soldered with a 25 watt soldering iron. 5. The calibration of the potentiometers was done with the use of DSO (Digital Storage Oscilloscope) by connecting the input with a function generator with an output of 150uV sine wave with 10 Hz frequency. 6. Then the program for testing of the threshold level was burned on the microcontroller 8051 using LTP flash utility and EFYs 8051 programming kit. 7. After the threshold voltage was found the program for led blinking was used to check with eye blinking as well as alpha generation.

Development of Threshold Voltage:


During testing of project the threshold voltage for normal eeg and eeg during eye blinking was observed. It was observed for about 30 seconds on myself and the details are mentioned below: Normal voltage level: 30 uV to 100 uV Voltage during Eye blinking: 120uV to 250uV Voltage during Alpha: 80uV to 150uV

Voltage at O1-Ref and O2-Ref during eye blinking

So after further amplification the input analog voltage to ADC0804 was between 1V to 5V. The level during eye blinking was more than 3.5V and that was chosen as a threshold to glow LED.

Program for Eye Blinking:


ORG 00H MOV P2,#0FFH MOV A,#00H MOV P2,A MOV A,#38H ACALL COM ACALL DELAY MOV A,#0EH ACALL COM ACALL DELAY MOV A,#01H ACALL COM ACALL DELAY MOV A,#06H ACALL COM ACALL DELAY MOV A,#84H ACALL COM ACALL DELAY MOV A,#'V' ACALL DATAWR ACALL DELAY MOV A,#'O' ACALL DATAWR ACALL DELAY MOV A,#'L'

ACALL DATAWR ACALL DELAY MOV A,#':' ACALL DATAWR ACALL DELAY MOV P1,#0FFH SETB P3.3 BACK: CLR P3.5 SETB P3.5 H1: JB P3.3,H1 CLR P3.4 MOV A,P1 MOV R1,#03H CMP R1,A JNC D1 MOV R1,A MOV A,P1 CPL A ACALL DELAY MOV P1,A D1: MOV R0,A ANL A,0FH MOV R1,#30H ADD A,R1 ACALL DATAWR ACALL DELAY MOV A,R0 ANL A,#0F0H RR A RR A RR A

RR A ADD A,R1 ACALL DATAWR ACALL DELAY SETB P3.4 SJMP BACK COM: MOV P0,A CLR P3.0 CLR P3.1 SETB P3.2 ACALL DELAY CLR P3.2 RET DATAWR:MOV P0,A SETB P3.0 CLR P3.1 SETB P3.2 ACALL DELAY CLR P3.2 RET DELAY: MOV R3,#50 HE2: MOV R4,#255 HE: DJNZ R4,HE DJNZ R3,HE2 RET END Here ADC0804 is connected with port 1 of 8051 and LCD is connected to port 3(3.0, 3.1, 3.2) and port 0 of 8051 microcontroller. Leds are connected to port 2 of microcontroller 8051.

Further Use of the Project:


1. This project can be used to control an automobile by use of Alpha frequency waves. 2. A DSP can be used to make the waves more precise and accurate and it can be interfaced with a Personal Computer to filter out the frequency of different ranges and individually work on them. 3. It can be used with automobiles to check the sanity level of a person before driving. 4. It can be used to play different games by use of brain. Studies are being done worldwide to use BCI as an alternative for hands while playing games.

Vous aimerez peut-être aussi