Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Brain Controlled System

No description
by

Somaya Moustafa

on 20 September 2014

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Brain Controlled System

Project Objective
Brain Controlled System is a breakthrough technology device that give disabled people the power to control objects with their minds, allowing them to control a wheelchair or laptop.
The objective behind our project is to provide some independency to a large suffering circle of the community.
We were able to do so because of the increasing developments in Brain-Computer interface systems (BCI).


Why Brain Controlled System?!
Brain Controlled System
Graduation Project
In
Communication and Computer Engineering

Supervised by
Dr. Mohamed Khairy Shahin
Eng. Ahmed Nasser Agag

Causes of Paralysis
How Your Brain Works?
The brain is home to billions of neurons, which are nerve cells. Using electrical impulses, they send messages to and through each other.
Whenever your brain is working , all messages firing from neuron to neuron amount to an electrical current
it creates a constantly changing electric field on the scalp in the order of micro volts.

The brain performs an incredible number of tasks including the following:
It controls body temperature, blood pressure, heart rate and breathing.
It accepts a flood of information about the world around you from your various senses (seeing, hearing, smelling, tasting and touching).
It handles your physical movement when walking, talking, standing or sitting.
All of these tasks are coordinated, controlled and regulated by an organ that is about the size of a small head of cauliflower.


Project Components
The Arduino Uno can be programmed with the Arduino software called Arduino IDE (Arduino Integrated Development Environment).
The open-source Arduino environment makes it easy to write code and upload it to the i/o board.
It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing, avr-gcc, and other open source software

Arduino IDE
Why Emotiv EPOC Headset?
Emotiv EPOC headset is best BCI system available nowadays for our project. It can detect, analyze and process brain waves then it can be trained to understand different thoughts including left, right, push, etc.
Emotiv is a neuroengineering company that has brought to market affordable, consumer friendly, high-resolution, multichannel, wireless EEG systems.
A revolutionary personal interface for Brain computer interaction.
The Emotiv EPOC uses sensors to tune into electrical signals produced by the brain to detect user thoughts, feelings and expressions.




The mechanism of the BCI can be broken down into the following steps.
The user visualizes performing a specific simple task, such as moving their right hand.
The brain emits specific signals associated with the intent which in this case involves moving the right hand
This electrical activity is measured in voltage differences using an Electroencephalogram​​, or EEG technology, and is filtered and amplified
Then, a computer interprets the signal and learns the brain patterns associated with moving the right hand.
Lastly, the computer software is programmed to recognize this specific pattern so that a certain action will execute every time the user visualizes moving their right hand.

Laptop
Two DC motors
DC motors are widely used because of their small size and high energy output. They are excellent for powering the drive wheels of a wheelchair as well as powering other mechanical assemblies.  The power delivered by a motor is the product of its speed and the torque at which the speed is applied.

A typical DC motor operates at speeds that are far too high to be useful, and at torques that are far too low. 
Gear reduction is the standard method by which a motor is made useful.
The motor shaft is fitted with a gear of small radius that meshes with a gear of large radius.
The motor's gear must revolve several times into order to cause the large gear to revolve once.

Two gear box
The wheelchair is the main component in our project, we will make some modifications on it to become suitable for our aims.
Wheelchair
Hardware
Brain Controlled Wheelchair

This could be useful for people who are paralyzed , and are unable to control parts of their body enough to physically activate the joystick of an electric wheelchair.  Many people may be able to use this technology to gain some independence, and to take a break from needing an attendant to push their wheelchair so they can get some fresh air.

Brain-Computer Interface (BCI)
we can use two optocouplers to control the two relays' status. Optocouplers generate light by using a light emitting diode (LED) to generate a current which is conducted through a phototransistor. Photo couplers are mainly used as:
As a switching device to transfer pulse signals(The transistor on the output side operates as a switch).



Four Optocouplers: (two for each motor)
The Arduino Uno is a microcontroller board based on the ATmega328.
It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button.
It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started.

Arduino UNO
Project Block Diagram
Why Arduino?
Usage of Arduino in our Project
The Arduino microcontroller works as intermediate stage between PC/Processing and the motors that controllers the wheelchair physical movement.
Arduino is connected to PC through the serial port by using Firmata protocol or Serial communication.
Processing takes the user state and determines which direction the user wishes to move, and then it sends the direction to the microcontroller which controls the motors pins to move in the desired direction

Headset Features
Limited edition design.
14 sensors plus 2 references offer optimal positioning for accurate spatial resolution.
Gyroscope generates optimal positional information for cursor and camera controls.
Hi-performance wireless gives users total range of motion.
Dongle is USB compatible and requires no custom drivers.
Lithium Battery provides 12 hours of continuous use.

Two (12v)batteries
Typical DC motors may operate on as few as 1.5 Volts or up to 100 Volts or more. Wheelchair often use motors that operate on 6, 12, or 24 volts because most robots are battery powered.


HardWare Components
Interface circuit
Brain Controlled System
A brain-computer interface (BCI) allows the brain to communicate with an external device. It converts the user’s thoughts into actions executed by a computer.
A brain-computer interface is a hardware and software system that provides interaction to a computer directly from the user's brain.

The idea of brain-computer interface, or interaction, exists on two proven principles: that neuron’s communicate with each other using electric signals, and that these electric signals can be read digitally.
We can make sense of these readings with the identification of distinct neural firing patterns (variations in the strength of the electromagnetic waves emitted from your brain).

Much of the previous EEG research has targeted those with physical disabilities, but the technology ought to be much simpler before we would expect user adoption. More recently a range of inexpensive devices have become available, mostly aimed at the gaming market as a novelty peripheral input. One example is the NeuroSkywith just one sensor. The Emotiv EPOC is another such device with a 14 sensors, which is comparable to the traditional devices.


Emotiv Headset
Arduino Microcontroller
Wheelchair
Laptop
Motor interface circuit


The parts of this system include:
Wheelchair.
Two DC motors.
Two gear box.
Two large gears.
Two (12v)batteries.
Laptop computer.
Arduino.
 Interface circuit.
EEG headset.
Collection of ready-made and custom software.
Any laptop will do, it only needs to have two USB ports one to connect to the Arduino, and the other for the EEG headset's Wireless receiver.

The interface circuit mainly consist of the following components
1.Four Relays: (two for each motor)we can use two SPDT relays to reverse the direction
of a DC motor.
The short principle is only one relay activated at one time, no more, no less.

Very affordable.
Easy to get started with.
Uses familiar platforms.
Flexible and versatile.
Perfect for beginners.
Perfect for advanced users.
Ready for more functionality because both the hardware and software are open-source.



Flow Chart
Why Brain Controlled System?!
Processing Output screen
Emotiv software
The Arduino programming language is an implementation of Wiring, a similar physical-computing platform, which is based on the Processing multimedia-programming environment.
The open-source Arduino environment makes it easy to write code and upload it to the i/o board.

Software Arduino
Firmata
It is a generic protocol for communicating with microcontrollers from software on a host computer. It is intended to work with any host computer software package.
establishes a protocol for talking to the Arduino from the host software.
The aim is to allow people to completely control the Arduino from software on the host computer.

Processing
Software
Cognitiv training
Mouse Emulator
Project Group
Brain-Computer Interface (BCI)
Expressiv Suite
Affectiv Suite
Cognitiv Suite
Mind your OSCs
A brain-computer interface (BCI) allows the brain to communicate with an external device. It converts the user’s thoughts into actions executed by a computer.
A brain-computer interface is a hardware and software system that provides interaction to a computer directly from the user's brain.

The idea of brain-computer interface, or interaction, exists on two proven principles: that neuron’s communicate with each other using electric signals, and that these electric signals can be read digitally.
We can make sense of these readings with the identification of distinct neural firing patterns (variations in the strength of the electromagnetic waves emitted from your brain).

Much of the previous EEG research has targeted those with physical disabilities, but the technology ought to be much simpler before we would expect user adoption. More recently a range of inexpensive devices have become available, mostly aimed at the gaming market as a novelty peripheral input. One example is the NeuroSkywith just one sensor. The Emotiv EPOC is another such device with a 14 sensors, which is comparable to the traditional devices.


Also called EPOC Control Panel.
This provides a few built-in brainwave processing suites including Expressiv, which detects movement of facial features; Affectiv, giving a measure of five subjective emotions; and Cognitiv, where users can train the system to detect specific thoughts.
The Cognitiv system can be trained on specific thoughts, after which the engine will continually process the brain-waves and match them to the patterns of thought trained.
To be able to detect thoughts the system must first sample the EEG while the user is in a relatively relaxed state.
After this the user can train the system to detect different actions depending on what the user is thinking.

Java-based computer programming language for novices, artists, and designers, based on metaphor of electronic sketchbook (programs are called "sketches").
Processing has promoted software literacy within the visual arts and visual literacy within technology.
Initially created to serve as a software sketchbook and to teach computer programming fundamentals within a visual context.
Processing evolved into a development tool for professionals. It requires oscP5 library for reading OSC messages from Mind Your OSCs.

Free and open-source app that converts EPOC data to Open Sound Control (OSC) messages.
It sends data from the Emotiv EPOC to any software which takes in OSC packets.
Open Sound Control is a protocol for communication among computers, sound synthesizers, and other multimedia devices that is optimized for modern networking technology and has been used in many application areas.
OscP5 is an OSC implementation for the programming environment processing. OSC is the acronym for Open Sound Control, a network protocol developed at cnmat, UC Berkeley.

The Mouse Emulator Tab in the EPOC Control Panel allows you to activate the Neuroheadset’s gyroscope and link it to the control of your computer’s mouse cursor.
The left side of the Mouse Emulator Tab provides a visual representation of the gyroscope’s relative position.
The right side of the Mouse Emulator Tab provides the controls to activate and deactivate this feature along with a slider bar to make sensitivity adjustments.

The Code
/**
* Final Year Project
* Brain Controlled System
* Communication & Electronics Dep.
* Faculty of Engineering
* Suez Canal University
*/
import processing.serial.*;
import cc.arduino.*;
import oscP5.*;

// Define the Variables
OscP5 oscP5;
Arduino arduino;



// variables hold the value incoming from EPOC
float Left = 0;
float Right = 0;
float Forward = 0;
float Backward = 0;

float f;
float b;
float l;
float r;

// MOTOR1 connected to Arduino pins 9, 10
int M1_1= 9;
int M1_2= 10;

// MOTOR2 connected to Arduino pins 11, 12
int M2_1= 11;
int M2_2= 12;

void setup() {
size (500,400);
//start oscP5, listening for incoming messages on port 7400
oscP5 = new OscP5(this, 7400);
println(Arduino.list()); // look for available Arduino boards
// start Arduino communication at 57,600 baud
arduino = new Arduino(this, Arduino.list()[0], 57600);
// set MOTORS PINS as output pins
arduino.pinMode(M1_1, arduino.OUTPUT);
arduino.pinMode(M1_2, arduino.OUTPUT);
arduino.pinMode(M2_1, arduino.OUTPUT);
arduino.pinMode(M2_2, arduino.OUTPUT);
}


void draw() {
background(0);

if(Forward >= 0.5) {
arduino.digitalWrite(M1_1, arduino.HIGH);
arduino.digitalWrite(M1_2, arduino.LOW);
arduino.digitalWrite(M2_1, arduino.HIGH);
arduino.digitalWrite(M2_2, arduino.LOW);
}
else if(Backward >= 0.5) {
arduino.digitalWrite(M1_1, arduino.LOW);
arduino.digitalWrite(M1_2, arduino.HIGH);
arduino.digitalWrite(M2_1, arduino.LOW);
arduino.digitalWrite(M2_2, arduino.HIGH);
}

else if(Left >= 0.5) {
arduino.digitalWrite(M1_1, arduino.LOW);
arduino.digitalWrite(M1_2, arduino.LOW);
arduino.digitalWrite(M2_1, arduino.HIGH);
arduino.digitalWrite(M2_2, arduino.LOW);
}
else if(Right >= 0.5) {
arduino.digitalWrite(M1_1, arduino.HIGH);
arduino.digitalWrite(M1_2, arduino.LOW);
arduino.digitalWrite(M2_1, arduino.LOW);
arduino.digitalWrite(M2_2, arduino.LOW);
}
else {
arduino.digitalWrite(M1_1, arduino.LOW);
arduino.digitalWrite(M1_2, arduino.LOW);
arduino.digitalWrite(M2_1, arduino.LOW);
arduino.digitalWrite(M2_2, arduino.LOW);
}

// start drawing current states
fill (255);
stroke (0);
triangle (100,75,75,125,125,125);
triangle (175,75,225,75,200,125);
triangle (275,100,325,75,325,125);
triangle (375,75,375,125,425,100);
for (int i=0 ; i<=10 ; i++)
{
stroke (255,255,255,255-20*i);
line (50,200+10*i,450,200+10*i);
}
textSize(24);
text("COGNITIV VALUES", 150, 350);
fill (45,170,214);
text("F", 100, 50);
text("B", 200, 50);
text("L", 300, 50);
text("R", 400, 50);


f = Forward*100;
b = Backward*100;
l = Left*100;
r = Right*100;

if (f<50) {
noStroke();
fill (255,0,0,150);
rect (80,300,40,-f);
}
else {
noStroke();
fill (0,255,0,150);
rect (80,300,40,-f);
stroke (255.0,0,125);
fill (240,188,58,200);
triangle (100,75,75,125,125,125);
}

if (b<50) {
noStroke();
fill (255,0,0,150);
rect (180,300,40,-b);
}
else {
noStroke();
fill (0,255,0,150);
rect (180,300,40,-b);
stroke (255.0,0,125);
fill (240,188,58,200);
triangle (175,75,225,75,200,125);
}

if (l<50) {
noStroke();
fill (255,0,0,150);
rect (280,300,40,-l);
}

else {
noStroke();
fill (0,255,0,150);
rect (280,300,40,-l);
stroke (255.0,0,125);
fill (240,188,58,200);
triangle (275,100,325,75,325,125);
}

if (r<50) {
noStroke();
fill (255,0,0,150);
rect (380,300,40,-r);
}
else {
noStroke();
fill (0,255,0,150);
rect (380,300,40,-r);
stroke (255.0,0,125);
fill (240,188,58,200);
triangle (375,75,375,125,425,100);
}
}

void oscEvent(OscMessage theOscMessage) {
// get the cognitiv suite from OSC messages to save into variables
if(theOscMessage.checkAddrPattern("/COG/LEFT") == true) {
Left = theOscMessage.get(0).floatValue();
}
else if (theOscMessage.checkAddrPattern("/COG/RIGHT") == true) {
Right = theOscMessage.get(0).floatValue();
}
else if (theOscMessage.checkAddrPattern("/COG/PUSH") == true) {
Forward = theOscMessage.get(0).floatValue();
}
else if (theOscMessage.checkAddrPattern("/COG/PULL") == true) {
Backward = theOscMessage.get(0).floatValue();
}
}

Thank You
Somaya Moustafa Abd El-Mawgoud
Hoda Mohamed Bahaa EL-Din
Hanaa Fathy Abd El-Ellah
Hanaa Ahmed Ismaiel
Dena Khaled Hussein
Aya Salem Hassan

Full transcript