This repository contains:
- The MATLAB code for signal acquisition and pre-processing - by Alexander Zwegers (@AlexZ51);
- The C++ code for signal processing, feature extraction, and classification - by Salvatore Logozzo (@bigsaso);
- The Python code used for training the model, achieving an accuracy of 93% - by Ibrahim Butt (@ibz101);
- The Arduino code for controlling the robot - By Annas Ghani (@AnnazG).
This README provides step-by-step instructions for setting up a Raspberry Pi and configuring the C++ project for the eeg wheelchair.
- Raspberry Pi Setup
- Installing C++ and Setting Up CMake
- Installing FFTW Library and Configuring for C++ Project
- References
- Insert an 8GB or larger microSD card into your computer.
- Download, install, and run Raspberry Pi Imager.
- Click "Choose OS" and select Raspberry Pi OS (32-bit or 64-bit based on your Pi model).
- Click "Choose Storage" and select your microSD card.
- Access the settings menu (CTRL + Shift + X) and enable SSH. Set a hostname, username, and password.
- Enter your Wi-Fi network's SSID, password, and country code.
- Click "Write" to write the OS to the card.
- Download and install Putty, an SSH client for Windows.
- Enter the hostname you selected in step 5(a) above in Putty and click "Open."
- Accept any security warnings and enter your username and password to connect.
- After SSH connection, enter
sudo raspi-config
at the command prompt. - Select "Interfacing Options" and then choose "VNC."
- Confirm by selecting "Yes" to enable the VNC server.
- On your PC, download, install, and launch VNC Viewer.
- Create a new connection and enter the hostname you selected in step 5(a).
- Connect and enter the Pi's username and password when prompted.
- C/C++ are included in Raspberry Pi OS, and some common libraries (like GPIO and camera) are pre-installed as well.
- Install essential build tools and libraries:
sudo apt-get install build-essential libssl-dev
- Download and install CMake:
cd /tmp
wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0.tar.gz
tar -zxvf cmake-3.20.0.tar.gz
cd cmake-3.20.0
./bootstrap
make (or gmake on RPi)
sudo make install
- Verify the installation:
cmake --version
- Download FFTW Library:
wget https://www.fftw.org/fftw-3.3.10.tar.gz
tar xf fftw-3.3.10.tar.gz
cd fftw-3.3.10
- Configure and install:
./configure
make
sudo make install
- Set the correct FFTW directory in the CMakeLists.txt file.
- Compile your C++ source file:
mkdir build && cd build
cmake -DEXECUTABLE_NAME=udp_live_data_final .. OR cmake -DEXECUTABLE_NAME=udp_live_data_final
make
- Run the code
./udp_live_data_final
[1] How to set up a headless Raspberry Pi, without ever attaching a monitor - A. Piltch, Tom’s Hardware, accessed Oct. 22, 2023.