Brain Controlled Wheelchair

by parker jones in Circuits > Arduino

242 Views, 5 Favorites, 0 Comments

Brain Controlled Wheelchair

IMG_0229.jpeg

I made an EEG/EMG-controlled car/wheelchair that runs using Python, Arduino, and OpenBCI GUI/Headset. If you want to know more about how I made this, please email me at eeg.projects.parker.jones@gmail.com. Special thanks to OpenBCI for sponsoring this project through their Discovery Program. If you want to view my license for this project, please visit my GitHub.

Supplies

Assembling and Wiring

IMG_8976.jpg
IMG_8977.jpg

First we need to assemble and wire the car to the arduino.

  1. Asemble the car so it looks like the image above
  2. Wire arduino and motors to L298n motor controller.
  3. Right side motor (from back of car):
  4. Black wire to Out 4 of L298n
  5. Red wire to Out 3 of L298n
  6. Left side motor:
  7. Black wire to Out 1 of L298n
  8. Red wire to Out 2 of L298n
  9. Arduino:
  10. Pin 5 to IN4 of L298n
  11. Pin 4 to IN3 of L298n
  12. Pin 3 to IN1 of L298n
  13. Pin 2 to IN2 of L298n
  14. 5v to +12v of L298n
  15. GND to GND of L298n

Coding Arduino

This is the code I used, very simple to run over BLE, and easily editable.

Downloads

Coding and Testing Python

This is the code that I used for my Python backend, you need to replace the BLE device characteristics, and I would recomend testing and then changing the EMG thresholds.

Downloads

How to Run Python and Arduino Code With GUI

  1. Open up the GUI and chose cyton from dongle, selcet auto connect and your good. However, if it says that it fails to start sesion or the GUI freezes when trying to auto connect, instead chose manual>select your dongles serial port>select overide dongle> and 20.
  2. Set your view to the regular time plot on the left, EMG on the top right and networking on the botom right.
  3. Set the networking type to LSL.
  4. Turn off all channels except 1 and 2 in time plot and EMG.
  5. Click start data stream.
  6. Click start LSL stream.
  7. Turn on Arduino by plugging it in.
  8. Run Python code through terminal:
  9. For Mac:
  10. open terminal
  11. cd desktop (or whoever you have the python script saved)
  12. python3.10 backend.py
  13. If you get any errors, install anything such as asyncio, pylsl, time, and bleak using python3.10 -m pip install blank.
  14. For Windows:
  15. open command prompt
  16. cd %USERPROFILE%\Desktop
  17. python3.10 backend.py
  18. If you get any errors, install anything such as asyncio, pylsl, time, and bleak using python3.10 -m pip install blank.
  19. Use your eyebrows to drive the car. (note, there may be some input delay due to the amount of time it takes to recive data and send it in python.)