Step 7: Install the Python interpreter and program

NOTE: The Puzzlebox Brainstorms software includes the console-based Python program described in this step. Strictly speaking it should not be necessary to download the Python interpreter or any of the software's dependencies (the Windows version mentioned in Step 8 is pre-compiled and packaged), but it is assumed anyone who wishes to leverage this software for a new type of wheelchair will need to know how to control everything from a source code level, so we have included these details for completeness.

Download and install the Python interpreter and download the Python program, listed in Step Two of this Instructable.

You may have some trouble configuring the program for the correct serial port of your Arduino, especially if your computer already has a serial port.

Make sure the Arduino is plugged in and run the program using the Python interpreter.  If you press direction keys such as i j k m, you will see the built-in LED on the Arduino turn on or off because it is wired (in software) to one of the output lines to the interface board.

At this point you can connect the Arduino to the interface board.  Prop the wheelchair up so its wheels are not touching the ground, or if you can (and we did) disengage the wheel clutches.  This way, when the motors turn, they don't actually cause the wheelchair to move (although it no longer is braked in place and could roll).

If you turn on the wheelchair, the lights should come on normally and indicate that the wheelchair is ready to be moved.  Moving the joystick should cause the brakes to click off and the motors to try to move the chair.

Now that the Python program is running, as in the picture below, pressing one of the movement keys will cause the program to tell the Arduino to send the wheelchair in that direction for a short time, and then tell it to stop. Pressing the 1, 2, or 3 keys will set the program to "speed" 1 2 or 3.  In speed 1, the minor transistor for each direction is activated.  In speed 2, the major transistor (the one with the lessor resistor) is activated.  In speed 3, both transistors (seen as 1 or 0 in the text display below) is activated.

(note that these speeds have nothing to do with speeds selected with the ON/OFF switches of the chair - see step 3)

When the software sets the output to 00110011 the wheelchair is told to stop.

At this point you should test that the Python program properly causes the wheelchair to move when a key is pressed (repeatedly) and the next step is to configure the Puzzlebox Brainstorms and EEG headset software.
<p>That is great. I feel it is usefull. That way, I also built similar it in my University. This is my thesis project. We get raw data from EPOC Headset. And then, by the methods of signal processing, we detect movements of eyes to control wheelchair.</p><p>Everyone can see it in youtube: </p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/HK3yxw6j9vw" width="500"></iframe></p><p>If you want to discuss about it, please leave a comment</p><p>Thank you!!!</p>
<p>I have a doubt bro.You had given this tutorial for Emotiv Headset.What about Neurosky mindwave headset&lt;' '&gt; .......</p>
<p>I also have the same doubt . Have you found the solution to this problem?</p>
<p>download link is not working...:(</p><p>plz help</p>
<p>I want to make an autonomous rover using wheel chair motors. Is there<br>some info on how to hook up an Arduino to the motor controller?</p>
<p>sensor data and sensor log apps et al have exact compass headings &auml;nd <br>GPS readings. please make robot that follows me 15 to 20 feet behind me.<br> My smart phone on my body and smart phone on robot wheel chair will <br>change slightly as I walk in different directions. Can use pi3, 1Sheeld <br>and arduino to compare comma delimited data so that whe&eacute;ls turn in <br>conjūnction with exact compass headings on my &szlig;martphone. GPS reading <br>comparison will tell wheelchair robot to speed up or slowdown so <br>distance between me and bot stays constant. Need bot to carry camping <br>supplies on 200 mile flat trail. Will put storage contaīner on top of <br>bot for provisions. Am no good at coding. I am retired but have old <br>extra smart phone and can buy used wheel chair. Any assistance you can <br>provide w&ocirc;uld be appreciatēd.</p>
Can you please help me to work out this project, with some photos and detailed research records.. Plz... My mail id- jomjohnygrace@gmail.com
<p>Hi,</p><p>Nice job what you have done there ^_^</p><p>Really amazing, actually if you may i have a question, we are uni students, and we are about to do our final undergraduate project, your project has inspired us and we want to know, if we use the individual license that Emotiv offers, is it going to be suitable and useful for such a project ? or we have to buy the educational license in order to apply your project? you know in order to use the applications of Emotiv and their output in controlling any external device such as the wheelchair ?</p>
<p>hey, i am ubaid from rawalpindi , i chose final year project of controlling wheelchair by brain , can you help me</p>
<p>guys for the epoc headset, do we need the raw EEG data?</p>
<p>awesome, would like to get more information about it</p>
<p>hey i liked itt.... its ardino sketch is not openingg... </p><p>wt to do now??</p>
<p>Hello Puzzlebox team</p><p>This is William from Taiwan in Asia. And I just to know you have brain controlled wheelchair.</p><p>I want to purchase this device, please let me know what parts of this suit.</p><p>Where can I purchase those device?</p><p>I'm waiting for your reply.</p><p>e-mail: avsong1@yahoo.com.tw</p>
<p>Hello,</p><p>Can you tell me the following specifications of the EPOC Headset:<br>1. Baud rate<br>2. Protocol (ttl, RS232)<br>3. Inverted or non inverted parity bitstop</p>
<p>HEY<br>I loved the concept and I am trying to make the exact same thing.<br>I'm a student in Karachi, Pakistan. I am very much interested in making this Brain-Controlled Wheelchair.<br>Will upload pictures as soon as I make some progress. :)</p>
<p>I have that joystick in hand and need to use it for control. DO you happen to have the pinout of it?</p>
Hello :) <br> <br>I am working on a similar project. Its called mind controlled mobility scooter. The problem I am facing right now is to drive the rear motor, which is 24V DC by and Arduino 2560 and a motor shield. What should I use to create the interface board in order to amplify the current ?
what is the total cost of building this project.? <br>
is the file 'WheelChair_Control.py' can work from Windows console?
Great project. Congratulations...
I am newbie to all this and would like to know if you have safety procedures one should know prior doing anything other than mentioned. for example, dealing with the wheelchair... should I be worried to be shocked from the battery or something ? <br>Thank you :)
Yes. If you complete the circuit you can get shocked with 12 volts. It will hurt. You can make sparks and set things on fire. Be careful!
Is it possible for the Arduino to directly receive values fron the EPOC? If so, could you explain how this could be done.
What's the actual purpose of python software? Is it possible to use any other coding language like c,c++ instead of python. ? <br>how does the 8 bit data from python interpreter is transferred to arduino software and at what rate? <br>
kewl I am also working on brain control. take a look at my 6 axis robot arm with epoc headset control.
Which headset is used in this project, <br> <br>is it EPOC neuroheadset which costs 299$...? <br> <br>or <br> <br>is it EEG neuroheadset which costs 750$..?
i can walk but it would be fun to control a dune buggy with your brain!!!
Or a gun turrent. Have the forward and backward controls be up and down, the left and right the same, and stop would be fire.
dude, have you ever seen the emotiv headset before? You don't need to think in terms of the wheel chair- you can make the commands anything you like, such as &quot;fire&quot; &quot;forward&quot; &quot;fire RPG&quot; or whatever. And in that case, you could make it so that you have just a person sitting in on a couch controlling it while eating chips.<br> <a href="http://www.ted.com/talks/tan_le_a_headset_that_reads_your_brainwaves.html">http://www.ted.com/talks/tan_le_a_headset_that_reads_your_brainwaves.html</a>
Do you know how many commands that thing can read? A mind controlled battle-bot would be awesome, or maybe multiple turrets.
The enthusiasm is very much appreciated, but it would probably be useful to re-read Step 9, which talks about the capabilities and limitation of the learning algorthim used with the Emotiv headset:<br> <br> <em>&quot;In our experience the Emotiv software is very good at training at least one direction direction for control, for example thinking &quot;Push&quot; to drive the wheelchair forward, and allowing that user to &quot;turn on&quot; or &quot;turn off&quot; that single command at will. However it seems that most if not all users have trouble training a second or third direction as effectively as the first. For this reason it is recommended when first using the software to &quot;cheat&quot; for left and right control by using facial muscles (which is technically EMG, not EEG) for example closing one eye to move left or right or clenching either side of the jaw.&quot;</em><br> <br> So while yes, the software will allow you to train multiple detections (actually I think you might be limited to four) which can each be used to control a different motion for driving the wheelchair or even a separate device, in reality one shouldn't expect &quot;unlimited thought control&quot; with current consumer-grade technology.<br> <br> Now that said there have been some incredible advances in the field of BCI research (including a paradigm which allows six-direction detection for fully 3D cursor control) but the physical location of the sensors has to be precise (specifically C3, Cz, and C4 according to the 10-20 system, check Wikipedia for details) and the layout of the Emotiv and Neurosky EEG headsets simply do not provide electrodes in those locations.<br> <br> This is a very exciting field of technology which is advancing quickly, but for the moment we feel it is very important to make sure expectations are being set which match the true current state of the art.<br> <br> Cheers<br> <br> Steve Castellotti<br>
Can we use The EEG shown in this site?????????please reply soon <br> <br>http://store.neurosky.com/products/mindwave-1/ <br>
Can you mail me all the programming and softwares to this id <br>johnson.romy314@gmail.com
? did you watch the vid? you can do as many commands as your computer/microprocessor can store and handle... or as many as you can imagine. <br>&quot;fire slingshot&quot; <br>&quot;cook meal&quot; <br>&quot;dig&quot; <br>You would just need to teach the program how you think each thing by example and then program the bot/buggy/whatever to do what that command implies, such as digging a hole. <br>You could probably take an exoskeleton (such as Ironman) and teach it what you think for pretending each muscle movement on your body... I'm kind of doubtful that you just happen to have just one sitting around though- 'Oh yea, I got one in 03 for Easter!'
OK, I watched it. That thing is pretty badass. Theoretically you could teach it the keys on your keyboard and use it to type by thing the letters/words.
Um... you don't need the Emotiv system for that, just a programming language. So you <em>theoretically</em>, could, yes, although that would be kind of unnecessary. (or do you mean to use an imaginary keyboard? &nbsp;In that case, you could just, 'theoretically', teach it what you think when you picture &quot;A&quot; or &quot;&quot; or &quot;&zeta;&quot; (zeta) or &quot;Д&quot; (de) or &quot;那&quot; (n&agrave;) or whatever language you speak... but why do that, when you can just imagine going forward, shooting or whatever. &nbsp;I don't really play it, but I can imagine that it would be pretty BA in COD and FPSs)
Yep, no physical keyboard.
... and quite literally &quot;as many as you can imagine&quot;
Reverse F/B control- think of the joystick like on an aircraft; Forward = down, Backward = up, Sounds like a plan in the works! Let me know what kind of motor[s] you would need. Possibilities are many.
Your right, that would work better. Some regular servos would probably work for a light-weight airsoft gun. A regular gun you could probably use heavy duty servos but a full sized turret would need hydraulics.
hello sir im interested in your project but i did not see the code for the arduino. can you post it or send it to my email if possible? this is my email &quot; want2learncoolstuff@yahoo.com &quot;
Jerkey, what a great project! People will seriously benefit from this!<br><br>One question though, I looked at Emotiv's website, and there are 2 types of EEG headsets, one is for consumer use ($299), and another one is for developer ($500). So which one are you using for this project?
Hello there, I managed the EEG side of this project.<br> <br> We did use a &quot;research&quot; version of the Emotiv headset (one step above the &quot;developer&quot;) but because we only used the Emotiv Control Panel and EmoKey utilities to interface with our own software there's no reason why you couldn't reproduce our results with just the $299 &quot;consumer&quot; headset.<br> <br> Incidentally, if you only wanted to control forward movement, you could get away with a NeuroSky MindWave which retails for $99 as there is also support for this hardware in Puzzlebox Brainstorms. The latest release allows &quot;blink control&quot; to select which direction a robot might be steered so we could do something similar for the wheelchair - that is to say, mental concentration would move the wheelchair forward, and blinking several times in a row rapidly would cycle the &quot;forward&quot; direction between left, right, or reverse.<br> <br> If you want finer levels of control however (it is difficult to start and stop &quot;concentrating&quot; on demand) you will probably want to stick with the Emotiv headset.<br> <br> Cheers<br> <br> Steve Castellott<br> <br>
I am using PSoC for my conrtoller. I need to know what is being sent by the wheelchair control panel so I can tell my PSoC what to look for. Will I need to alter the python code in anyway, How can I verify that my left from Epoc is left in puzzlebox? How does puzzlebox know I just went left with the emokey? Should i type the keystroke first or as soon as I move the box left in the emotiv control panel puzzlebox knows what left is? <br> <br>Thank you for this great product.
Hello there.<br> <br> You can find source code for Puzzlebox Brainstorms talking to our wheelchair's controller in the following two files:<br> <br> <a href="http://brainstorms.puzzlebox.info/tracker/browser/trunk/Puzzlebox/Brainstorms/Wheelchair_Control.py" rel="nofollow">Wheelchair_Control.py</a><br> <br> <a href="http://brainstorms.puzzlebox.info/tracker/browser/trunk/arduino/puzzlebox_brainstorms_wheelchair_noisebridge/puzzlebox_brainstorms_wheelchair_noisebridge.pde" rel="nofollow">puzzlebox_brainstorms_wheelchair_noisebridge.pde</a><br> <br> Our code was specific to our controller, but a similar technique to the one we used might be possible for you. I couldn't really say in more detail without knowing the specifics of your hardware.<br> <br> EmoKey is a program included by Emotiv with their EEG headset, or can be downloaded for free as part their &quot;SDK Lite&quot; package. It will you to declare a direction or detection you want to look for (such as &quot;Left&quot;) and assign that to a keyboard keystroke (such as the Left Arrow key). A good way to test EmoKey is to assign letters of the alphabet to each direction and then load and place Notepad in the foreground. It should print out keys when they are detected. You can use &quot;w&quot; &quot;a&quot; &quot;s&quot; and &quot;d&quot; to mean &quot;Forward&quot; &quot;Left&quot; &quot;Backwards&quot; and &quot;Right&quot; and those keys will work with Brainstorms as well.<br> <br> <br> Finally that said Puzzlebox is preparing to release an updated version of Puzzlebox Synapse which supports the Emotiv headset and eventually you will be able match detections there directly.<br> <br> <br> Cheers<br> <br> Steve Castellotti<br> <br> <br>
Hi, I wonder if we can control 5 relays instead of a joystick. If we modify the Arduino skatch we can pilot 5 relays that could be interfaced to a wheelchair special control module. The modern chairs has special interfaces able to connect many imput devices, please see www.pgdt.com and Omni R-NET interface. What they need is just 5 &quot;clean&quot; normally open contacts, Forward, Reverse, Right, Left, Mode selection.<br>Plese let me know your advices.<br>
hi !<br>i started working on this project recently<br>your website is really of great help!!<br>the thing is that we are trying to develop a more economic design for the indian users, all i want to know is that what are the changes we need to make with respect to your model if we use conventional eeg electrodes <br>lots of thanks !!<br>
there are many ways to control a wheelchair from eeg electrodes. If you are designing your own electrodes, you will also need to design software which interprets the signals from the electrodes. The software from Emotiv is very good at finding patterns in brain signals. If you are not using their software, you will have a big technical challenge to duplicate their work. It may be easier to use their hardware.<br><br>I do not know if the Emotiv software works with other hardware. Do you have anything specific in mind/
we are planning to use a conventional eeg cap fix electrodes then connect it to acquisition system then use filters,dsp processors, and driver circuits then connect it to the laptop then give its output signal to an interface circuit ,as suggested in your website and connect it to an electrical wheelchair.<br>what do you think? you can even suggest an corrections<br>thanks!<br>

About This Instructable




Bio: whats an engineer to do?
More by jerkey:Brain-Controlled Wheelchair Easy rechargable portable ipod/USB recharger How to make a shopping-cart sound-system for street parties 
Add instructable to: