Sie sind auf Seite 1von 33

1

NEUROSKY TECHNOLOGY
A
Project Seminar Report
Submitted in partial fulfillment of the
Requirements for the Project Seminar of
BACHELOR OF ENGINEERING
IN
COMPUTER SCIENCE & ENGINEERING
By
M.TEJASRI
(1602-11-733-06!
"#$%&'(#)' *+ C*($,'#&
S-.#)-# & E)/.)##&.)/
0%1%2. C*33#/# *+ E)/.)##&.)/
(A++.3.%'#4 '* O1(%).% U).2#&1.'5!
I6&%7.(6%/78 H54#&%6%4-31
2019
TABLE OF CONTENTS
2
List of i!ures""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""i#
1.I)'&*4,-'.*)""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1
1"1Brain $omputer Interface %B$I&""""""""""""""""""""""""""""""""""""""""""""""""""1
1"2'istory"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """2
1"()hat is **+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""2
1",Physical -echanisms"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""(
1".Brain eatures"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""",
1"/ Brain )a#es""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""/
2.N#,&*S:5 M.)4S#'.......................................................................7
2"1NeuroS0y 1echnolo!y 2#er#ie3"""""""""""""""""""""""""""""""""""""""""""""""""4
2"2Brain3a#es""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""4
2"( 1hin0 +ear""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""5
2",1hin0+ear 6ata 7alues""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""5
2". Poor Si!nal 8uality"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""5
2"/eSense"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""19
2":eSense -eter ; +eneral Information""""""""""""""""""""""""""""""""""""""""""""19
2"4eSense -eter ; 1echnical 6escription""""""""""""""""""""""""""""""""""""""""""11
2"5 A11*N1I2N eSense"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""11
2"19-*6I1A1I2N eSense""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""11
2"11RA) )a#e 7alue %1/;bit&""""""""""""""""""""""""""""""""""""""""""""""""""""""""""11
2"12ASI$ **+ P2)*R"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""11
2"1(Blin0 Stren!th"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""12
3.T7.): G#%& P%-:#'1.......................................................................12
("1Pac0et Structure""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1(
("2Pac0et 'eader"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1(
("(6ata Payload"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1(
(",Payload $hec0sum""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1,
9.;7%' .1 $751.-%3 -*($,'.)/<........................................................19
,"11he Arduino Platform"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1.
,"21he Arduino 'ard3are"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1.
,"(I<2 Pins"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1/;2(
,",1he Soft3are"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""2,
,".Sensors and Actuators"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""2/
,"/Neuros0y products"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""2:
,":*=amples""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""25
.C*)-3,1.*) A)4 F,',&# ;*&:.........................................................3
(
LIST OF FIGURES
1"(+eneral structure of B$I system""""""""""""""""""""""""""""""""""""""""""""""(
1".6istribution of sensors"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""".
1"/unction of brain""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""":
1":1he brain 3a#es""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""4
2"Neuros0y mindset"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""5
("(2#er#ie3 of mindset""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1,
,"(6i!ital i<o pins"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1/
,",Analo! i<o pins""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1:
,".P)- pins"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""15
,"/2ther board components"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""2(
."Arduino >no specification""""""""""""""""""""""""""""""""""""""""""""""""""""""""""2/
Brain si!nals interface"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""2:
1.I)'&*4,-'.*)
,
N#,&*S:58 I)-. is a manufacturer of Brain;$omputer Interface %B$I& technolo!ies for
consumer product applications? 3hich 3as founded in 299, in Silicon
7alley?$alifornia"1he $ompany adapts electroencephalo!raphy %**+&
and electromyo!raphy%*-+& technolo!y to fit a consumer mar0et 3ithin a number of
fields such as entertainment %toys and !ames&? education? automoti#e? and health"
NeuroS0y technolo!y allo3s for lo3;cost **+;lin0ed research and products by usin!
ine=pensi#e dry sensors@ older **+s require the application of a conducti#e !el bet3een
the sensors and the head" 1he systems also include built;in electrical AnoiseB reduction
soft3are<hard3are? and utiliCe embedded %chip le#el& solutions for si!nal processin! and
output"
Neuros0y primarily 3or0s as an ori!inal equipment manufacturer? or 2*-? collaboratin!
3ith industry partners? de#elopers? and research institutions to deploy the technolo!y into
their o3n products and systems")hen NeuroS0y has released direct;to;consumer
products? such as the -indSet and the -ind)a#e? they are typically desi!ned for
ma=imum fle=ibility of use throu!h third party and open source content"
1.1B&%.) C*($,'#& I)'#&+%-# (BCI!=
2ften called a mind;machine interface %--I& ?is a direct communication path3ay
bet3een the brain and an e=ternal de#ice" B$Is are often directed at assistin!?
au!mentin!? or repairin! human co!niti#e or sensory;motor functions" Research on B$Is
be!an in the 15:9s at the >ni#ersity of $alifornia Los An!eles %>$LA& under a !rant
from the National Science oundiation follo3ed by a contract from 6ARPA" 1he papers
published after this research also mar0 the first appearance of the e=pression brainD
computer interface in scientific literature" 1he field of B$I research and de#elopment has
since focused primarily on neuroprosthetics applications that aim at restorin! dama!ed
hearin!? si!ht and mo#ement" 1han0s to the remar0able cortical plasticity of the brain?
si!nals from implanted prostheses can? after adaptation? be handled by the brain li0e
natural sensor or effector channels" ollo3in! years of animal e=perimentation? the first
neuroprosthetic de#ices implanted in humans appeared in the mid;1559s"
1.2H.1'*&5 =
1he history of brainDcomputer interfaces %B$Is& starts 3ith 'ans Ber!erEs disco#ery of
the electrical acti#ity of the human brain and the de#elopment of electroencephalo!raphy
%**+&" In 152, Ber!er 3as the first to record human brain acti#ity by means of **+" By
analyCin! **+ traces? Ber!er 3as able to identify oscillatory acti#ity in the brain? such as
the alpha 3a#e %4D12 'C&? also 0no3n as Ber!erEs 3a#e" Ber!erEs first recordin! de#ice
3as #ery rudimentary" 'e inserted sil#er 3ires under the scalps of his patients" 1hese
3ere later replaced by sil#er foils attached to the patientsE head by rubber banda!es"
Ber!er connected these sensors to a Lippmann capillary electrometer? 3ith disappointin!
.
results" -ore sophisticated measurin! de#ices? such as the Siemens double;coil recordin!
!al#anometer? 3hich displayed electric #olta!es as small as one ten thousandth of a #olt?
led to success" Ber!er analyCed the interrelation of alternations in his **+ 3a#e dia!rams
3ith brain diseases" **+s permitted completely ne3 possibilities for the research of
human brain acti#ities"
1.3;7%' .1 EEG =
An electroencephalo!ram is a measure of the brainEs #olta!e fluctuations as detected
from scalp electrodes"It is an appro=imation of the cumulati#e electrical acti#ity of
neurons" *lectroencephalo!raphy %**+& is the most studied potential non;in#asi#e
interface? mainly due to its fine temporal resolution? ease of use? portability and lo3 set;
up cost" But as 3ell as the technolo!yEs susceptibility to noise? another substantial barrier
to usin! **+ as a brainDcomputer interface is the e=tensi#e trainin! required before users
can 3or0 the technolo!y" or e=ample? in e=periments be!innin! in the mid;1559s? Niels
Birbaumer at the>ni#ersity of 1Fbin!en in +ermany trained se#erely paralysed people to
self;re!ulate the slo3 cortical potentials in their **+ to such an e=tent that these si!nals
could be used as a binary si!nal to control a computer cursor" %Birbaumer had earlier
trained epileptics to pre#ent impendin! fits by controllin! this lo3 #olta!e 3a#e"& 1he
e=periment sa3 ten patients trained to mo#e a computer cursor by controllin! their
brain3a#es" 1he process 3as slo3? requirin! more than an hour for patients to 3rite 199
characters 3ith the cursor? 3hile trainin! often too0 many months"
/
1.9P751.-%3 M#-7%).1(1=
**+s require electrodes attached to the scalp 3ith stic0y !el " Require physical
connection to the machine"
1.E3#-'&*4# P3%-#(#)'=
-Standard A19;29 SystemB
;Spaced apart 19;29G
;Letter for re!ion
;;frontal lobe
;1;temporal lobe
;$;center
;2;occipital lobe
;Number for e=act positionH
;odd numbers%left&
;e#en numbers%ri!ht&
:
1.6B&%.) F#%',&#1=
>ser must be able to control the outputH
>se a feature of the continuous **+ output that the user can reliably modify %3a#es&? or
*#o0e an **+ response 3ith an e=ternal stimulus %e#o0ed potential&"
1.6.1 A&-7.'#-',&# *+ '7# B&%.)=
1he human brain is made up of billions of interconnected neurons@ the patterns of
interaction bet3een these neurons are represented as thou!hts and emotional states" *#ery
interaction bet3een neurons creates a minuscule electrical dischar!e@ alone these char!es
are impossible to measure from outside the s0ull" 'o3e#er? the acti#ity created by
hundreds of thousands concurrent dischar!es a!!re!ates into 3a#es 3hich can be
measured"
6ifferent brain states are the result of different patterns of neural interaction" 1hese
patterns lead to 3a#es characteriCed by different amplitudes and frequencies@ for e=ample
3a#es bet3een 12 and (9 hertC? Beta )a#es? are associated 3ith concentration 3hile
3a#es bet3een 4 and 12 hertC? Alpha )a#es? are associated 3ith rela=ation and a state of
mental calm" %1he contraction of muscles is also associated 3ith unique 3a#e patterns?
isolatin! these patterns is ho3 some NeuroS0y de#ices detect blin0s"&
4
All electrical acti#ity produces these 3a#es %e#en li!ht bulbs&? thus all electrical de#ices
create some le#el of ambient AnoiseB@ this AnoiseB interferes 3ith the 3a#es emanatin!
from the brain? this is 3hy most **+ de#ices 3ill pic0 up readin!s e#en if they are not
on a personIs head" -easurin! mental acti#ity throu!h these 3a#es is li0e tryin! to
ea#esdrop on a con#ersation at a loud concert" In the past? **+ de#ices circum#ented this
problem by measurin! these si!nals in en#ironments 3here electrical acti#ity is strictly
controlled and increasin! the si!nal stren!th of the data comin! from the brain throu!h
the application of a conducti#e solution
$ontrary to popular simpliJcations? the brain is not a !eneral;purpose computer 3ith a
uniJed central processor" Rather? it is a comple= assembla!e of competin! sub;systems?
each hi!hly specialiCed for particular tas0s %$arey 2992&" By studyin! the effects of brain
injuries and? more recently? by usin! ne3 brain ima!in! technolo!ies? neuroscientists
ha#e built detailed topo!raphical maps associatin! different parts of the physical brain
3ith distinct co!niti#e functions" 1he brain can be rou!hly di#ided into t3o main partsH
the cerebral corte= and sub;cortical re!ions" Sub;cortical re!ions are phylo!enetically
older and include a areas associated 3ith controllin! basic functions includin! #ital
functions such as respiration? heart rate? and temperature re!ulation? basic emotional and
instincti#e responses such as fear and re3ard? reKe=es? as 3ell as learnin! and memory"
1he cerebral corte= is e#olutionarily much ne3er"Since this is the lar!est and most
comple= part of the brain in the human? this is usually the part of the brain people notice
in pictures" 1he corte= supports most sensory and motor processin! as 3ell as Ahi!herB
le#el functions includin! reasonin!? plannin!? lan!ua!e processin!? and pattern
reco!nition" 1his is the re!ion that current B$I 3or0 has lar!ely focused on"
1.7B&%.) ;%2#1=
G#)#&%335 /&*,$#4 65 +&#>,#)-5= (%($3.',4#1 %&# %6*,' 100?0 (%@!.
5
19
2.NEUROSKY MIN"SET=
1he
NeuroS0y -indSet is a brain3a#e sensin! headset 3hich uses a Lmedical !radeI probe to
capture brain patterns and translate them into stuff you can do 3ith a computer"
'o3e#er? most people donIt ha#e rooms in their house de#oid of electronic de#ices nor
do they 3ant to apply a conducti#e liquid to their head e#ery time they use a B$I de#ice"
NeuroS0y has de#eloped comple= al!orithms built into their products 3hich filter out this
AnoiseB" %?only in reference to the noise bit&
11
NeuroS0yIs 3hite paper claims the 1hin0 +ear technolo!y has been tested at 5/G as
accurate as that 3ithin research !rade **+s"
NeuroS0y is also sellin! non;contact sensors to research institutions" 1hese are
dry electrodes that can measure brain3a#es millimeters from the scalp and thus can easily
be 3orn o#er hair"1hese sensors are a si!nificant technolo!ical brea0throu!h in that they
are the only non;contact **+ sensors e#er de#eloped
2.1N#,&*S:5 T#-7)*3*/5 O2#&2.#A=
B&%.)A%2#1=
1he last century of neuroscience research has !reatly increased our 0no3led!e about the
brain and particularly? the electrical si!nals emitted by neurons firin! in the brain" the
patterns and frequencies of these electrical si!nals can be measured by placin! a sensor
on the scalp" the -indSet contains NeuroS0y thin0+earM technolo!y? 3hich measures
the analo! electrical si!nals? commonly referred to as brain3a#es? and processes them
into di!ital si!nals to ma0e the measurements a#ailable to !ames and applications" the
table belo3 !i#es a !eneral synopsis of some of the commonly;reco!niCed frequencies
that tend to be !enerated by different types of acti#ity in the brainH
12
2.2T7.):G#%&=
1hin0+ear is the technolo!y inside e#ery NeuroS0y product or partner product that
enables a de#ice to interface 3ith the 3earersI brain3a#es" It includes the sensor that
touches the forehead? the contact and reference points located on the ear pad? and the on;
board chip that processes all of the data" Both the ra3 brain3a#es and the eSense -eters
%Attention and -editation& are calculated on the thin0 +ear chip"
1hin0 +ear 6ata 7aluesH
2.3P**& 1./)%3 >,%3.'5=
this unsi!ned one;byte inte!er #alue describes ho3 poor the si!nal measured by the thin0
+ear is" It ran!es in #alue from 9 to 299" Any non;Cero #alue indicates that some sort of
noise contamination is detected" the hi!her the number? the more noise is detected" A
#alue of 299 has a special meanin!? specifically that the thin0 +ear contacts are not
touchin! the userEs s0in" this #alue is typically output e#ery second? and indicates the
poorness of the most recent measurements" Poor si!nal may be caused by a number of
different thin!s" In order of se#erity? they areH
N Sensor? !round? or reference contacts not bein! on a personEs head %i"e" 3hen nobody is
3earin! the thin0 +ear&"
N Poor contact of the sensor?!round ? or reference contacts to a personEs s0in %i"e" hair in
the 3ay? or headset 3hich does not properly fit a personEs head? or headset not properly
placed on the head"&
N *=cessi#e motion of the 3earer %i"e" mo#in! head or body e=cessi#ely? jostlin! the
headset&"
N *=cessi#e en#ironmental electrostatic noise %some en#ironments ha#e stron! electric
si!nals or static electricity buildup in the person 3earin! the sensor&"
N *=cessi#e non;**+ biometric noise %i"e" *-+? *O+<*$+? *2+? etc& A certain amount
of noise is una#oidable in normal usa!e of in0 +ear? and both Neuro S0yEs filterin!
technolo!y and eSense al!orithm ha#e been desi!ned to detect? correct? compensate for?
account for? and tolerate many types of non;**+ noise"
-ost typical users 3ho are only interested in usin! the eSense #alues? such as Attention
and -editation? do not need to 3orry too much about the poor si!nal quality #alue?
e=cept to note that the Attention and -editation #alues 3ill not be updated 3hile poor
si!nal is detected" the poor si!nal quality #alue is more useful to some applications 3hich
need to be more sensiti#e to noise %such as some medical or research applications&? or
applications 3hich need to 0no3 ri!ht a3ay 3hen there is e#en minor noise detected" By
default? output of this 6ata 7alue is enabled" It is typically output once a second"
2.9#S#)1#=
eSenseM is a NeuroS0yEs proprietary al!orithm for characteriCin! mental states" 1o
calculate eSense? the NeuroS0y thin0+ear technolo!y amplifies the ra3 brain3a#e si!nal
and remo#es the ambient noise and muscle mo#ement" the eSense al!orithm is then
applied to the remainin! si!nal? resultin! in the interpreted eSense meter #alues" Please
note that eSense meter #alues do not describe an e=act number? but instead describe
ran!es of acti#ity
eSense -eter ; +eneral InformationH
1(
the eSense meters are a 3ay to sho3 ho3 effecti#ely the user is en!a!in! Attention
%similar to concentration& or -editation %similar to rela=ation&" Li0e e=ercisin! an
unfamiliar muscle? it may ta0e some time to !ain full proficiency 3ith each of the
eSenseM meters" In many cases? people tend to be better at one eSense than the other
3hen they first be!in" )e recommend tryin! different tactics until you are successful
3ith one" 2nce you see a reaction on the screen from your efforts? you 3ill be able to
duplicate the action more easily 3ith additional practice" +enerally? Attention can be
controlled throu!h a #isual focus" ocus on a sin!ular idea" 1ry to AfunnelB your
concentration and focus your train of thou!ht to3ards pushin! up the meter" 2ther
su!!estions include pic0in! a point on the screen to stare at or ima!inin! the action you
are tryin! to accomplish happenin!" or e=ample? loo0 at the Attention eSense meter and
ima!ine the dial mo#in! to3ards hi!her numbers"
or -editation? it typically helps to try to rela= yourself" $onnect to a sense of peace and
calm by clearin! your mind of thou!hts and distractions" If you are ha#in! difficulty
en!a!in! -editation? close your eyes? 3ait a number of seconds? and then open your eyes
to see ho3 the meter has responded" If you ha#e trouble at first in controllin! your eSense
meter le#els? be patient" 1ry different techniques and practice" Also be sure to read and try
to understand the 1echnical 6escription in order to !et a better idea about ho3 eSense
actually 3or0s under the hood"
2.#S#)1# M#'#& - T#-7).-%3 "#1-&.$'.*)=
or each different type of eSense %i"e" Attention? -editation&? the meter #alue is reported
on a relati#e eSense scale of 1 to 199" 2n this scale? a #alue bet3een ,9 to /9 at any
!i#en moment in time is considered AneutralB and is similar in notion to AbaselinesB that
are established in con#entional brain3a#e measurement techniques %thou!h the method
for determinin! a thin0+ear baseline is proprietary and may differ from con#entional
brain3a#es&" A #alue from /9 to 49 is considered Asli!htly ele#atedB? and may be
interpreted as le#els tendin! to be hi!her than normal %le#els of Attention or -editation
that may be hi!her than normal for a !i#en person&" 7alues from 49 to 199 are considered
Aele#atedB? meanin! they are stron!ly indicati#e of hei!htened le#els of that eSense"
Similarly? on the other end of the scale? a #alue bet3een 29 to ,9 indicates AreducedB
le#els of the eSense? 3hile a #alue bet3een 1 to 29 indicates Astron!ly lo3eredB le#els of
the eSense" these le#els may indicate states of distraction? a!itation? or abnormality?
accordin! to the opposite of each eSense" the reason for the some3hat 3ide ran!es for
each interpretation is that some parts of the eSense al!orithm are dynamically learnin!
and at times employ some Aslo3;adapti#eB al!orithms to adjust to natural fluctuations
and trends of each user? accountin! for and compensatin! for the fact that brain3a#es in
the human brain are subject to normal ran!es of #ariance and fluctuation" this is part of
the reason 3hy thin0+ear sensors are able to operate on a 3ide ran!e of indi#iduals under
an e=tremely 3ide ran!e of personal and en#ironmental conditions? 3hile still !i#in!
!ood accuracy and reliability"
2.6A''#)'.*) #1#)1#=
1he eSense Attention meter indicates the intensity of a userEs le#el of mental AfocusB or
AattentionB? such as that 3hich occurs durin! intense concentration and directed %but
1,
stable& mental acti#ity" Its #alue ran!es from 9 to 199" 6istractions? 3anderin! thou!hts?
lac0 of focus? or an=iety may lo3er the Attention meter le#el"
2.7M#4.'%'.*) #1#)1#=
1he eSense -editation meter indicates the le#el of a userEs mental AcalmnessB or
Arela=ationB" Its #alue ran!es from 9 to 199" Note that -editation is a measure of a
personEs mental states? not physical le#els? so simply rela=in! all the muscles of the body
may not immediately result in a hei!htened -editation le#el" 'o3e#er? for most people
in most normal circumstances? rela=in! the body often helps the mind to rela= as 3ell"
-editation is related to reduced acti#ity by the acti#e mental processes in the brain" It has
lon! been an obser#ed effect that closin! oneEs eyes turns off the mental acti#ities 3hich
process ima!es from the eyes" So closin! the eyes is often an effecti#e method for
increasin! the -editation meter le#el" 6istractions? 3anderin! thou!hts? an=iety?
a!itation? and sensory stimuli may lo3er the -editation meter le#els"
2.BRA; ;%2# 0%3,# (16-6.'!=
this 6ata 7alue consists of t3o bytes? and represents a sin!le ra3 3a#e sample" Its #alue
is a si!ned 1/;bit inte!er that ran!es from ;(2:/4 to (2:/:" the first byte of the 7alue
represents the hi!h;order bits of the t3os;compliment #alue? 3hile the second byte
represents the lo3;order bits" 1o reconstruct the full ra3 3a#e #alue? simply shift the first
byte left by 4 bits? and bit3ise;or 3ith the second byteH short ra3 P %7alueQ9RSS4& T
7alueQ1R@ 3here 7alueQ9R is the hi!h;order byte? and 7alueQ1R is the lo3;order byte" In
systems or lan!ua!es 3here bit operations are incon#enient? the follo3in! arithmetic
operations may be substituted insteadH ra3 P 7alueQ9RU2./ V 7alueQ1R@ if% ra3 WP (2:/4 &
ra3 P ra3 ; /..(/@ 3here ra3 is of any si!ned number type in the lan!ua!e that can
represent all the numbers from ;(2:/4 to (2:/:"
*ach thin0+ear model reports its ra3 3a#e information in only certain areas of the full ;
(2:/4 to (2:/: ran!e" or e=ample? -indSet reports ra3 3a#es that fall bet3een
appro=imately ;29,4 to 29,:" By default? output of this 6ata 7alue is enabled? and is
outputed .12 times a second? or appro=imately once e#ery 2ms"
2.CASICDEEGDPO;ER=
this 6ata 7alue represents the current ma!nitude of 4 commonly;reco!niCed types of
**+ %brain3a#es&" this 6ata 7alue is output as a series of ei!ht (;byte unsi!ned inte!ers
in little;endian format" the ei!ht **+ po3ers are output in the follo3in! orderH delta %9".
; 2":.'C&? theta %(". ; /":.'C&? lo3;alpha %:". ; 5"2.'C&? hi!h;alpha %19 ; 11":.'C&? lo3;
beta %1( ; 1/":.'C&? hi!h;beta %14 ; 25":.'C&? lo3;!amma %(1 ; (5":.'C&? and mid;
!amma %,1 ; ,5":.'C&" these #alues ha#e no units and therefore are only meanin!ful
compared to each other and to themsel#es? to consider relati#e quantity and temporal
fluctuations" By default? output of this 6ata 7alue is enabled? and is typically output once
a second" Blin0 Stren!thH this unsi!ned one byte #alue reports the intensity of the userEs
most recent eye blin0" Its #alue ran!es from 1 to 2.. and it is reported 3hene#er an eye
blin0 is detected" the #alue indicates the relati#e intensity of the blin0? and has no units"
1.
3.T7.):G#%& P%-:#'1=
1hin0 +ear components deli#er their di!ital data as an asynchronous serial stream of
bytes" the serial stream must be parsed and interpreted as thin0+ear Pac0ets in order to
properly e=tract and interpret the thin0+ear 6ata 7alues described in the chapter abo#e" A
thin0+ear Pac0et is a pac0et format consistin! of ( partsH
1" Pac0et 'eader
2" Pac0et Payload
(" Payload $hec0sum
1hin0 +ear Pac0ets are used to deli#er 6ata 7alues %described in the pre#ious chapter&
from a thin0 +ear module to an arbitrary recei#er %a P$? another microprocessor? or any
other de#ice that can recei#e a serial stream of bytes&" Since serial I<2 pro!rammin! APIs
are different on e#ery platform? operatin! system? and lan!ua!e? it is outside the scope of
this document %see your platformEs documentation for serial I<2 pro!rammin!&" this
chapter 3ill only co#er ho3 to interpret the serial stream of bytes into thin0 +ear Pac0ets?
Payloads? and finally into the meanin!ful 6ata 7alues described in the pre#ious chapter"
the Pac0et format is desi!ned primarily to be robust and fle=ibleH $ombined? the 'eader
and $hec0sum pro#ide data stream synchroniCation and data inte!rity chec0s? 3hile the
format of the 6ata Payload ensures that ne3 data fields can be added to %or e=istin! data
fields remo#ed from& the Pac0et in the future 3ithout brea0in! any Pac0et parsers in any
e=istin! applications<de#ices" this means that any application that implements a thin0
+ear Pac0et parser properly 3ill be able to use ne3er models of thin0 +ear modules most
li0ely 3ithout ha#in! to chan!e their parsers or application at all? e#en if the ne3er thin0
+ear hard3are includes ne3 data fields or rearran!es the order of the data fields"
3.1P%-:#' S'&,-',&#=
Pac0ets are sent as an asynchronous serial stream of bytes" the transport medium may be
>AR1? serial $2-? >SB? bluetooth? file? or any other mechanism 3hich can stream
bytes" *ach Pac0et be!ins 3ith its 'eader? follo3ed by its 6ata Payload? and ends 3ith
the PayloadEs $hec0sum Byte? as follo3sH
QSXN$R QSXN$R QPL*N+1'R QPAXL2A6"""R Q$'OS>-Rand the QPAXL2A6YR
section is allo3ed to be up to 1/5 bytes lon!? 3hile each of QSXN$R? QPL*N+1'R? and
Q$'OS>-R are a sin!le byte each" this means that a complete? #alid Pac0et is a
minimum of , bytes lon! %possible if the 6ata Payload is Cero bytes lon!? i"e" empty& and
a ma=imum of 1:( bytes lon! %possible if the 6ata Payload is the ma=imum 1/5 bytes
lon!&
3.2P%-:#' H#%4#&=
the 'eader of a Pac0et consists of ( bytesH t3o synchroniCation QSXN$R bytes %9=AA
9=AA&? follo3ed by a QPL*N+1'R %Payload len!th& byteH QSXN$R QSXN$R QPL*N+1'R
the t3o QSXN$R bytes are used to si!nal the be!innin! of a ne3 arri#in! Pac0et and are
bytes 3ith the #alue 9=AA %decimal 1:9&" SynchroniCation is t3o bytes lon!? instead of
only one? to reduce the chance that QSXN$R %9=AA& bytes occurrin! 3ithin the Pac0et
could be mista0en for the be!innin! of a Pac0et" Althou!h it is still possible for t3o
1/
consecuti#e QSXN$R bytes to appear 3ithin a Pac0et %leadin! to a parser attemptin! to
be!in parsin! the middle of a Pac0et as the be!innin! of a Pac0et& the QPL*N+1'R and
Q$'OS>-R combined ensure that such a Zmis;syncEd Pac0etZ 3ill ne#er be accidentally
interpreted as a #alid pac0et %see Payload $hec0sum belo3 for more details&" the
QPL*N+1'R byte indicates the len!th? in bytes? of the Pac0etEs 6ata Payload
QPAXL2A6YR section? and may be any #alue from 9 up to 1/5" Any hi!her #alue
indicates an error %PL*N+1' 122 LAR+*&" Be sure to note that QPL*N+1'R is the
len!th of the Pac0etEs 6ata Payload? N21 of the entire Pac0et" the Pac0etEs complete
len!th 3ill al3ays be QPL*N+1'R V ,"
6ata PayloadH
the 6ata Payload of a Pac0et is simply a series of bytes" the number of 6ata Payload
bytes in the Pac0et is !i#en by the QPL*N+1'R byte from the Pac0et 'eader" the
interpretation of the 6ata Payload bytes into the thin0 +ear 6ata 7alues is defined in
detail in the 6ata Payload Structure section belo3" Note that parsin! of the 6ata Payload
typically should not e#en be attempted until after the Payload $hec0sum Byte
Q$'OS>-R is #erified as described in the follo3in! section"
3.3P%53*%4 C7#-:1,(=
1he Q$'OS>-R Byte must be used to #erify the inte!rity of the Pac0etEs 6ata Payload"
the PayloadEs $hec0sum is defined asH
1" summin! all the bytes of the Pac0etEs 6ata Payload
2" ta0in! the lo3est 4 bits of the sum
(" performin! the bit in#erse %oneEs compliment in#erse& on those lo3est 4 bits A recei#er
recei#in! a Pac0et must use those ( steps to calculate the chec0sum for the 6ata Payload
they recei#ed? and then compare it to the Q$'OS>-R $hec0sum Byte recei#ed 3ith the
Pac0et" If the calculated payload chec0sum and recei#ed Q$'OS>-R #alues do not
match? the entire Pac0et should be discarded as in#alid" If they do match? then the
recei#er may procede to parse the 6ata Payload as described in the Z6ata Payload
StructureZ section belo3"
1:
9.;7%' I1 P751.-%3 C*($,'.)/<
Physical $omputin! uses electronics to prototype ne3 materials for desi!ners and artists"
It in#ol#es the desi!n of interacti#e objects that can communicate 3ith humans usin!
sensors and actuators controlled by a beha#iour implemented as soft3are runnin! inside a
microcontroller %a small computer on a sin!le chip&" In the past? usin! electronics meant
ha#in! to deal 3ith en!ineers all the time? and buildin! circuits one small component at
the time@ these issues 0ept creati#e people from playin! around 3ith the medium directly"
-ost of the tools 3ere meant for en!ineers and required e=tensi#e 0no3led!e" In recent
years? microcontrollers ha#e become cheaper and easier to use? allo3in! the creation of
better tools" 1he pro!ress that 3e ha#e made 3ith Arduino is to brin! these tools one step
closer to the no#ice? allo3in! people to start buildin! stuff after only t3o or three days of
a 3or0shop" )ith Arduino? a desi!ner or artist can !et to 0no3 the basics of electronics
and sensors #ery quic0ly and can start buildin! prototypes 3ith #ery little in#estment"

9.1T7# A&4,.)* P3%'+*&(
14
Arduino is composed of t3o major partsH
1& Arduino board? 3hich is the piece of hard3are you 3or0 on 3hen you build your
objects"
2& Arduino I6*? the piece of soft3are you run on your computer" Xou use the I6* to
create a s0etch %a little computer pro!ram& that you upload to the Arduino board"
1he s0etch tells the board 3hat to do Not too lon! a!o? 3or0in! on hard3are meant
buildin! circuits from scratch? usin! hundreds of different components 3ith stran!e
names li0e resistor? capacitor? inductor? transistor? and so on" *#ery circuit 3as A3iredB to
do one specific application? and ma0in! chan!es required you to cut 3ires? solder
connections? and more" )ith the appearance of di!ital technolo!ies and microprocessors?
these functions? 3hich 3ere once implemented 3ith 3ires? 3ere replaced by soft3are
pro!rams Soft3are is easier to modify than hard3are" )ith a fe3 0eypresses? you can
radically chan!e the lo!ic of a de#ice and try t3o or three #ersions in the same amount of
time that it 3ould ta0e you to solder a couple of resistors"
9.2 T7# A&4,.)* H%&4A%&#=
1he Arduino board is a small microcontroller board?% 3hich is a small circuit&" %the board
that contains a 3hole computer on a small chip the microcontroller& 1his computer is at
least a thousand times less po3erful than the -acBoo0 IIm usin! to 3rite this? but itIs a
lot cheaper and #ery useful to build interestin! de#ices" Loo0 at the Arduino boardH youIll
see a blac0 chip 3ith 24 Ale!sB[ that chip is the A1me!a(24? the heart of your board"
)e %the Arduino team& ha#e placed on this board all the components that are required for
this microcontroller to 3or0 properly and to communicate 3ith your computer" 1here are
many #ersions of this board@ the one 3eIll use throu!hout this boo0 is the Arduino >no?
3hich is the simplest one to use and the best one for learnin! on" " In those illustrations?
you see the Arduino board" At first? all those connectors mi!ht be a little confusin!" 'ere
is an e=planation of 3hat e#ery element of the board doesH
9.3"IGITAL IEO=
15
NInput<2utpu
t %I<2& is
done throu!h
pins"
NInput P read
physical
3orld data"
N2utput P
3rite data to
the physical
3orld"
NXou insert a
3ire into a
pin and
connect it to
somethin!
else"
N)e can
pro!ram a
pin to be
input 2R
output"
N6i!ital pins
ha#e t3o
#aluesH hi!h
%. 7olts& or lo3
%9 7olt&"

29
ANALOG IEO=
NAnalo! I<2 has a ran!e of numbers"
N2utput H 9 """ 2.. %2./ #olta!e steps from 9 to .7&"
NInputH 9 """ 192( %192, #olta!e steps from 9 to .7&"
NAnalo! input pinH 3e can use it for e=ample to determine the distance of an object #ia
infra;red sensor"
NAnalo! output pinH 3e can use it for e=ample to set speed of a motor or the bri!htness of
a L*6
P,31# ;.4'7 M*4,3%'.*)=
NSom
e
di!ital ports can be pro!rammed to output analo! si!nals"
21
N)e enable those ports for output 3ith pulse 3idth modulation %P)-&"
NP)- is obtained by #aryin! bet3een 'I+' and L2) at the appropriate inter#al of
time"
O'7#& B*%&4 C*($*)#)'1=
22
A&4,.)* U)* 1$#-.+.-%'.*)=
2(

N7IN ;
Xou
may
2,
pro#ide a re!ulated input #olta!e to the Arduino board as opposed to . #olts from the
>SB connection or other re!ulated po3er source"
N.7 ; )hen po3er is pro#ided to the board? this pin has .7 %reference to +N6 pin&
N(7( ; A ("( #olt supply !enerated by the on;board re!ulator %reference to +N6 pin&"
-a=imum current dra3 is .9 mA"
N6i
!it
al
Pin
2
and ( can be used as e=ternal interrupts %tri!!er an interrupt on a lo3 #alue? a risin! or
fallin! ed!e? or a chan!e in #alue&"
NAR* ; Reference #olta!e for the analo! inputs"
NReset ; Brin! this line L2) to reset the microcontroller"
POLYFUSE=
2.
NIts a resettable polyfuse that protects your computerEs >SB ports from shorts and
o#ercurrent" If more than .99 mA is applied to the >SB port? the fuse 3ill automatically
brea0 the connection"
9.9T7# S*+'A%&# (I"E!
1he I6* %Inte!rated 6e#elopment *n#ironment& is a special pro!ram runnin! on your
computer that allo3s you to 3rite s0etches for the Arduino board in a simple lan!ua!e
modeled after the Processin! %333"processin!"or! & lan!ua!e" 1he ma!ic happens 3hen
you press the button that uploads the s0etch to the boardH the code that you ha#e 3ritten is
translated into the $ lan!ua!e %3hich is !enerally quite hard for a be!inner to use&? and is
passed to the a#r;!cc compiler? an important piece of open source soft3are that ma0es the
2/
final translation into the lan!ua!e understood by the microcontroller" 1his last step is
quite important? because itIs 3here Arduino ma0es your life simple by hidin! a3ay as
much as possible of the comple=ities of pro!rammin! microcontrollers"
F#%',&#1 *+ '7# A&4,.)* (I"E! =
N Simple to use
N 2pen Source %ree&
N Pro!rammin! style similar to $
N Xou can do3nload it from 333"arduino"cc
2:
I)1'%33.)/ A&4,.)* *) Y*,& C*($,'#&
1o pro!ram the Arduino board H you must first do3nload the de#elopment en#ironment
%the I6*& from hereH333"arduino"cc<en<-ain<Soft3are"$hoose the ri!ht #ersion for your
operatin! system"6o3nload the file and double;clic0 on it to open it @ on )indo3s or
Linu=? this creates a folder named arduino;Q#ersionR? such as arduino;1"9" 6ra! the folder
to 3here#er you 3ant itH your des0top? your Pro!ram iles folder %on )indo3s&? etc" 2n
the -ac? double;clic0in! it 3ill open a dis0 ima!e 3ith an Arduino application %dra! it to
your Applications folder&" No3 3hene#er you 3ant to run the Arduino I6*? youIll open
24
up the arduino %)indo3s and Linu=& or Applications folder %-ac&? and double;clic0 the
Arduino icon" 6onIt do this yet? thou!h@ there is one more step"No3 you must install the
dri#ers that allo3 your computer to tal0 to your board throu!h the >SB port"
I)1'%33.)/ "&.2#&1= M%-.)'*17
1he Arduino >no on a -ac uses the dri#ers pro#ided by the operatin! system? so
the procedure is quite simple" Plu! the board into your computer"1he P)R li!ht on the
board should come on and the yello3 L*6 labelled ALB should start blin0in!"Xou mi!ht
see a popup 3indo3 tellin! you that a ne3 net3or0 interface has been detected"If that
happens? $lic0 ANet3or0 Preferences"""B? and 3hen it opens?clic0 AApplyB" 1he
>no 3ill sho3 up as ANot $onfi!uredB? but itIs 3or0in! properly"8uit System
Preferences" If you ha#e an older Arduino board? loo0 for instructions hereH
333"arduino"cc<en<+uide<-ac2S\"
9.S#)1*&1 %)4 A-',%'*&1=
Sensors and actuators are electronic components that allo3 a piece of electronics to
interact 3ith the 3orld" As the microcontroller is a #ery simple computer? it can process
only electric si!nals %a bit li0e the electric pulses that are sent bet3een neurons in our
brains&" or it to sense li!ht? temperature? or other physical quantities? it needs somethin!
that can con#ert them into electricity" In our body? for e=ample? the eye con#erts li!ht into
si!nals that !et sent to the brain usin! ner#es" In electronics? 3e can use a simple de#ice
called a li!ht;dependent resistor %an L6R or photoresistor& that can measure the amount
of li!ht that hits it and report it as a si!nal that can be understood by the microcontroller"
2nce the sensors ha#e been read? the de#ice has the information needed to decide ho3 to
react" 1he decision;ma0in! process is handled by the microcontroller? and the reaction is
performed by actuators" In our bodies? for e=ample? muscles recei#e electric si!nals from
the brain and con#ert them into a mo#ement" In the electronic 3orld? these functions
could be performed by a li!ht or an electric motor" In the follo3in! sections? you 3ill
learn ho3 to read sensors of different types and control different 0inds of actuators"
9.6N#,&*1:5 $&*4,-'1=
M.)4;%2#= 1he -ind)a#e is a NeuroS0y product released in 2919 in $hina and 2911
in the >S and the *>" It costs ]55 >S ma0in! it the least e=pensi#e **+ de#ice to e#er
be produced"1he -ind)a#e has been mar0eted as both an education and entertainment
de#ice"1he -ind)a#e 3on the +uinness Boo0 of )orld Records a3ard for A'ea#iest
machine mo#ed usin! a brain control interfaceB"
R#1#%&-7 P&*4,-'1= Neuros0y has produced a number of research products %!enerally
#ery similar to their direct to consumer products &" 1hese products ha#e been 3idely
adopted due to positi#e re#ie3s by early adopters 3ith Richard Reilly Ph"6"? professor at
1rinity $olle!e in 6ublin statin! that? A)e ha#e been impressed 3ith the quality of data
from the -indOit Pro? compared to our !old;standard **+ acquisitions system" It has
25
opened ne3 possibilities for the remote monitorin! patientsI acti#ity a !reat benefit in
patient care"B
M.)4 K.' & M.)4 S#'= 1he -ind Set %referred to as the -ind Oit in early press releases&
3as NeuroS0yIs first direct to consumer product" )ith a number of prototypes sold in
299:"1he -ind Set 3as the first direct to consumer B$I product under ]1999 e#er made"
1he -indSet consisted of headphones 3ith three sensors on one ear piece and another on
a fle=ible arm comin! off of the headphones that sat on the forehead" 1he headphones had
a 3ireless Bluetooth connection and came 3ith a small Bluetooth don!le" 1he first non;
prototype models 3ere sold for ]155"
N*)-C*)'%-' S#)1*&1= NeuroS0y is currently sellin! a Non;$ontact system to research
institutions" 1his system is based on se#en dry electrodes that can measure brain3a#es
millimeters from the scalp and thus can easily be 3orn o#er hair"1hese sensors are a
si!nificant technolo!ical brea0throu!h in that they are the only non;contact **+ sensors
e#er de#eloped" 1hese sensors ha#e been effecti#ely used 3ith SS*7P %steady;state
#isually e#o0ed potential& allo3in! a de#ice incorporatin! them to tell 3hich object? out
of a set !roup of objects? the 3earer is loo0in! at"NeuroS0y has not released any
consumer products usin! these sensors nor has it announced that it is intendin! to"
P&# M.)4K.'= In early press releases at least four different pre;-indOit de#ices can be
seen? none of these 3ere sold to the public and none of the articles mention names for the
models"
9.7E@%($3#1=
M.)4+3#@= 1he -indle= 3as produced in conjunction 3ith -attel and released for the
2995 $hristmas season" It is a !ame in 3hich players lift a ball by concentratin! and
mo#e it throu!h a maCe" 1he concentration le#els are measured by a headset usin!
NeuroS0y technolo!y 3hich 3irelessly interfaces 3ith a platform that floats the ball
throu!h the use of a fan 3hich 3as mo#ed around the course in a circle by a dial@%this
platform 3as based on a pre#ious -attel toy? the A'arry Potter SorcererEs Stone
*lectronic Le#itatin! $hallen!e Board +ameB&"1he -indle= allo3ed the player to
modify the course by stic0in! plastic obstacles in pe! holes at different locations and 3as
prepro!rammed 3ith . !ames as 3ell as multiplayer options"1he !ame 3as a
Aphenomenal successBand one of the best sellers of the $hristmas season@in fact? -attel
sold out its entire stoc0 fi#e 3ee0s after launch"
S'%& ;%&1 F*&-# T&%.)#&= 1he Star )ars orce 1rainer 3as produced in conjunction
3ith >ncle -ilton inc" and released for the 2995 $hristmas season %it 3as released for
pre;sale midni!ht ^uly 2(? 2995&"It is a !ame in 3hich players lift a ball by concentratin!"
(9
1he ball is le#itated by a fan and concentration is measured usin! NeuroS0y technolo!y"
1he ball is desi!ned to loo0 li0e the ball Lu0e trained 3ith to learn ho3 to control the
orce in the first Star )ars"1he toy 3as a commercial success"
NEUROSKY 0ISUALISATION=
(1
EFAMPLES=
i!:" An **+ recordin! net" QiiiR
(2
1his is a mind set !ame
called as M.)4 F3#@
'ere there is a race
!oin! on 3here the
players are
controllin! the speed
of the carts by usin!
the neuro mind set"
((
.C*)-3,1.*) %)4 +,',&# A*&:H
I) '7# #4,-%'.*)%3 ,1#1=
In this project 3e can use a #oice reco!nition to send the function of mo#ement by
speech and use Neruos0y to control the speed"
>se the *moti#e *Boo0 to control the directions of the robot by usin! malty sensors to
ma0e all the directions and the speed by the brain si!nals "
>se the brain computer interface to control the robotic Arm by Neruos0y or *moti#e
*Boo0"
I) '7# #)'#&'%.)(#)' ,1#1=
-a0e an intelli!ence #ideo !ames By usin! malty sensors you can ma0e a brain bro3ser"