DIY VR HEADSET FOR $80

16,897

179

34

Introduction: DIY VR HEADSET FOR $80

About: A seasoned software architect and robotics enthusiast, who enjoys nothing more than tinkering with anything from electronics to code.

My initial goal was to do this for under $150(USD), however after shopping around and changing some parts out for alternatives I managed to get this down to around $80. So let us get started.

The parts required are:

  • Toggle Flick Switch
  • 2x LED
  • 1x resistor 150 Ohm
  • 1x Micro USB cable (at least 2 meters long)
  • 1x HDMI Cable (thin ones work best as they hinder movement less, also at least 2 meters long)
  • Some jumper wires
  • DC Adapter plug 5V 3A (Raspberry Pi compatible one works great)
  • Push Button
  • Google Cardboard Compatible VR Headset (I recommend one with a phone compartment door that opens as it gives better access than the ones which uses a tray that slides in)
  • 6DOF MPU 6050 3Axis gyroscope and accelerometer
  • Arduino Micro (can use off-brand alternative)
  • 5inch RaspberryPi LCD Screen 800×480 with HDMI interface

Supplies

  • Toggle Flick Switch
  • 2x LED
  • 1x resistor 150 Ohm
  • 1x Micro USB cable (at least 2 meters long)
  • 1x HDMI Cable (thin ones work best as they hinder movement less, also at least 2 meters long)
  • Some jumper wires
  • DC Adapter plug 5V 3A (Raspberry Pi compatible one works great)
  • Push Button
  • Google Cardboard Compatible VR Headset (I recommend one with a phone compartment door that opens as it gives better access than the ones which uses a tray that slides in)
  • 6DOF MPU 6050 3Axis gyroscope and accelerometer
  • Arduino Micro (can use off brand alternative)
  • 5inch RaspberryPi LCD Screen 800×480 with HDMI interface

Step 1: Part Costing

All of these parts can be acquired on AliExpress for about $80 ($82.78 to be precise), as can be seen in images.

Step 2: Software Required

You will also require Tridef3D or similar software (there are some free alternatives, but I have not had a chance to give them a try at present). Tridef3D is used to convert any Direct X 9/10/11 game into stereoscopic 3D. Tridef3D offers a 14-day free trial, which is plenty to give this a try. The full version of Tridef3D retails for $39.99.

Step 3: Assembly

Now that we have all the required components, let us begin with the assembly.

The assembly comprises of 3 main elements:

  1. The Arduino Micro circuit (containing the MPU 6050, push button and led)
  2. The Wiring (providing connectivity to Arduino Micro and power to Screen)
  3. Inserting the screen in the headset and connecting the micro USB cables as well as the HDMI cable.

Step 4: The Arduino Micro Circuit

The diagram illustrates how the different components need to be connected to the Arduino Micro.

The push button uses digital pin 5 and the MPU 6050 is connected to the Arduino Micro as follows:
– MPU 6050 SCL pin to Digital Pin 3 on Arduino

– MPU 6050 SDA pin to Digital Pin 2 on Arduino

– MPU 6050 VCC to 5V pin on Arduino

– MPU 6050 GND to GND pin on Arduino

Step 5: Code for Arduino

Here is the code that needs to be loaded on the Arduino.

Step 6: Gyroscope Mounting

Just note that the orientation of the MPU 6050 makes a difference to which of the axis of the gyroscope will be used. For the above code the MPU 6050 was mounted on the side of the headset as shown in the pictures.

In the event of the MPU 6050 being mounted with a different orientation, you might have to substitute between the gx, gy and gz values until the desired configuration is achieved.

For my configuration, I am rotating around the Y and Z axis.

Also the numbers associated with calculation of vx and vy might have to be tweaked to get the results (movement speed etc.) you desire.

I also added a push button, that when pressed temporarily disables the gyroscopic mouse movement. This is useful when you want to reset you point of view in games.

Step 7: Attaching Everything to Headset.

I attached all the parts of this circuit to the VR Headset using double-sided tape.

Step 8: The Wiring

In order to have as few cables as possible connecting to the VR headset I modified the USB cable so that it pulls external power from a DC power adapter (a single USB port will not be able to power both the Arduino and the 5 inch LCD) as well as splitting into 2 micro USBs on one end (one only provided power to the LCD and the other one both power and connectivity to Arduino.) the below diagram shows how the wiring is connected.

For reference a USB cables contains 4 wires:

  • Red wire – +5V DC
  • White or Yellow – Data connectivity
  • Green – Data Connectivity
  • Black – GND

I also included a switch to turn the power on and off (this is useful to turn off the mouse functionality until it is needed, otherwise it will interfere with mouse movement when it is not desired), as well as an, LED to show when the headset is powered on.

Step 9: Inserting Screen in Headset and Connecting All the Wiring

The LCD screen is held in place by the clamps in the headset used to hold a phone (it is a snug fit). Then simply connect the 2 micro USBs to the LCD and Arduino respectively (ensuring the plug with the data connections is plugged into the Arduino and that the power only micro USB is plugged into the power socket on the LCD display). Try to run the cables in the extra spaces in the Headset around the screen in order to keep them out of the way.

Lastly connect the HDMI cable to the LCD.

The assembly is now complete.

Step 10: Connecting Headset to PC and Setting Up Software

To connect the headset to your PC do the following:

  1. Plug the DC adapter into mains power.
  2. Plug the USB connector into an available USB port in your PC.
  3. Connect HDMI cable into and available HDMI port on your PC graphics card (You can use a DVI port with an adapter)

Go to display settings and click on detect displays, then set Multiple displays to “Duplicate these Displays” and make sure your resolution is set to 800×480.

Open up Tridef3D and start-up a game. You might have to play around with each individual games graphical settings as well as mouse sensitivity to get the best results.

For future enhancements, I will look at getting a higher definition LCD screen and also work on head movement tracking by using infrared LEDs and a Wiimote (Wiimote used as an IR Camera).

And there you have it a DIY VR Headset for $80.

Give it a try.

Arduino Contest 2020

Participated in the
Arduino Contest 2020

Be the First to Share

    Recommendations

    • Home Cooked Speed Challenge

      Home Cooked Speed Challenge
    • Made with Math Contest

      Made with Math Contest
    • Robots Contest

      Robots Contest

    34 Comments

    0
    LeoB64
    LeoB64

    4 months ago

    Thanks! Had been looking for a way to use my DJI google on X-plane flight sim for a more realistic view of the cockpit. Compressed your design and put it in a case attached to side of Goggles and works like a charm! Used a microswitch inside the case.

    Thanks again,

    IMG_5848.jpgIMG_5847.jpg
    0
    jamesvdberg
    jamesvdberg

    Reply 4 months ago

    Awesome work!

    0
    Techyman69
    Techyman69

    1 year ago

    Am I able to use this on a MacBook Air as opposed to just a PC? If so, how?

    0
    jamesvdberg
    jamesvdberg

    Reply 1 year ago

    Hi Techyman69, from a hardware perspective the headset will work as long as you have a USB and HDMI port on the Mac, however, you will have to find software that runs on mac that converts the video out to Stereoscopic 3D.

    0
    Techyman69
    Techyman69

    Reply 1 year ago

    Great, thanks.

    0
    Techyman69
    Techyman69

    Reply 1 year ago

    What are the free alternatives?

    0
    jamesvdberg
    jamesvdberg

    Reply 1 year ago

    I see one of the comments said you can activate stereoscopic 3d via Nvidia or AMD control panels, but I have not tried that. I have not really found any free alternative that works.

    0
    Techyman69
    Techyman69

    Reply 1 year ago

    Alright. I'll try it.

    0
    NIDZEL
    NIDZEL

    1 year ago on Step 10

    do you get yaw drift with the 6050 ? what about using a MPU-9250 with magnetometer to prevent drift?

    0
    jamesvdberg
    jamesvdberg

    Reply 1 year ago

    Hi Nidzel, I have not experienced yaw drift, however, there is no reason why you couldn't use the 9250.

    0
    NicolasK11
    NicolasK11

    Question 1 year ago

    I know this is lazy but do you have the sketch as a text file or something?
    I can copy it line by line but Work smarter not harder I figured i would ask.

    0
    jamesvdberg
    jamesvdberg

    Answer 1 year ago

    Here you go:

    #include <Mouse.h>
    #include <Wire.h>
    #include <I2Cdev.h>
    #include <MPU6050.h>
    MPU6050 mpu;
    int16_t ax, ay, az, gx, gy, gz;
    int vx, vy;
    int inputPin = 5;
    bool enableMouse;
    void setup() {
    Serial.begin(9600);
    Wire.begin();
    mpu.initialize();
    enableMouse = true;
    pinMode(inputPin, INPUT);
    if (!mpu.testConnection()) {
    while (1);
    }
    Serial.println("Running...");
    }
    void loop() {
    int val = digitalRead(inputPin);
    if (val == HIGH) { // check if the input is HIGH
    //Place logic here to execute when button is pressed
    //Disables mouse movement while button is pressed, this allows you to set your view angle easily.
    enableMouse = false;
    }
    else
    {
    enableMouse = true;
    }
    if(enableMouse)
    {
    mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
    vx = -(gy)/150;
    vy = (gz+100)/150;
    Mouse.move(vx, vy);
    delay(20);
    }
    }

    0
    Zero2019
    Zero2019

    1 year ago

    This looks good. But do you have any ideas to mod it for AR support?

    0
    jamesvdberg
    jamesvdberg

    Reply 1 year ago

    Hi Zero2019, No I haven't, would need to install some form of camera and also create some custom software, but it should be possible.

    0
    Dawnee Doo
    Dawnee Doo

    Question 1 year ago

    What exactly does this do? You should tell the audience what this is because I don't have a clue.

    0
    jamesvdberg
    jamesvdberg

    Answer 1 year ago

    Hi Dawnee, it is a basic Virtual Reality Headset headset to be used with a computer.

    0
    Techyman69
    Techyman69

    Question 1 year ago

    Would you mind sending a link to your shopping cart? I'm having difficulty finding all the parts for just $80.

    0
    jamesvdberg
    jamesvdberg

    Answer 1 year ago

    Hi Techyman69, I can't find a way of sharing an Aliexpress cart directly. Attached is a screenshot of the items(or equivalent items) I put together on AliExpress today.

    screencapture-shoppingcart-aliexpress-com-shopcart-shopcartDetail-htm-1591427069564.png