An accessible VR headset built using cardboard, Arduino, and Socket.io. The headset utilizes an Arduino gyroscope module to track head movements, which is then translated into approximate roll/pitch/yaw data for corresponding mouse movements. Socket.io is then integrated to allow computer video output to be duplicated and mirrored onto a phone in the headset, creating a VR headset compatible with any first-person experience or game (e.g., Minecraft, Valorant, Microsoft Flight Simulator, etc.)
These instructions will (hopefully) get the repo up and running on your local machine! To be transparent, this project was made over the course of a single weekend, and thus may have deprecated or obscure dependencies that are difficult to get working on different systems.
You should have some version of Python3, Node.js, and npm working and running on your local system. To check if they are installed, as well as their respective versions on your local machine, you can run:
python3 --version
node -v
npm -v
You may also want to install the Arduino IDE, as it provides the easiest environment to work with Arduino hardware.
-
Install the necessary Python libraries with
pip install pyautogui pyserial
-
Install the necessary node modules by navigating to the
video_sockets
directory, initializing the node server withnpm init
, and installing necessary dependencies withnpm i
-
You may also need to install the necessary libraries for the MPU6050 gyroscope module. This can be done through the Arduino IDE's built-in library installation tool. See here for clarification.
The following information will also be listed in the respective directories (video_sockets
and hardware
)
To run the web server to connect computer video output to your mobile device, navigate to the video_sockets
directory and run:
node server.js
cd client
npm run start
The circuitry involved for this project is just a simple circuit connecting an MPU6050 module to an Arduino UNO. Orientation of the gyroscope shouldn't matter, though cartesian components may have to be switched around in script.py
depending on how the module is placed.
Check the output port of your Arduino. This can most easily be done through the Arduino IDE. Navigate to the hardware
directory and update the Serial port and BAUD rate in script.py
to what is given by the Arduino IDE.
After powering the Arduino, script.py
can be run using python3 script.py
to grab the gyroscope data.
Note: headset will have to be stationary initially to set a reference point for all other gyroscope data
My broski Hinson (from the pic up top) made a video on the project, which can be viewed here.