DIY Raspberry Pi VR Goggles

29K4646

Intro: DIY Raspberry Pi VR Goggles

DISCLAIMER! Due to the fact that the Raspberry Pi Zero is not a very powerful computer, the frame-rate on this extremely low (Under 10 fps) which can be harmful to your eyes.

These VR goggles are built using the Raspberry Pi Zero which makes them a bit lower-cost.

You can access USB on the side, which is four ports. It uses one battery and the screen is plugged directly into the Raspberry Pi for power, which takes away a USB port.

It may look like it just has a lot of wires on the top, but I am not much of an organizer, and there are only 3 wires.

Sorry if the images aren't that great, I didn't have very good lighting when I took them.

STEP 1: Materials

Here is a list of materials I used:

A micro-SD card (8-32 gigabyte, any will work (I think)),

Some Female/Female jumper Wires (If you don't have any or don't know where to find them here is a link to Adafruit for them: Female/Female Jumper wires),

Raspberry Pi Zero: Raspberry Pi Zero W on Adafruit

Elecrow 5" TFT Screen: TFT LCD screen (It works fine for a screen without any reviews) Or any 5" TFT lcd screen should work, I just used the configuration for this screen.

5V 1A Battery pack (I don't know where to find one, I am sure you could find some specifically for the raspberry pi zero)

3-Axis Gyroscope/Accelerometer: MPU-6050 on Amazon (I know it doesn't have the best reviews, but so far it has been working fine.)

Two micro USB to USB cables. (7" long or so should work)

A powered micro USB to USB hub: LoveRPi USB hub for Raspberry Pi zero

A small mini HDMI to HDMI cable. (If you just have a mini HDMI to HDMI converter, that will work too, That is what I use, but I don't have any cables shorter than 3' or so)

Tape,

Foam Double-Sided tape,

The following items can be optional, although if you don't use them, I would recommend using a cheap VR viewer you can get for your phone. (Please read through the entire instructable before purchasing a viewer though)

Lots of non-corrugated cardboard.

I had a template from a cardboard VR viewer template and lens that was from Radoishack® and you could probably find a template on google image search. Like this template: Template

I don't know where you could find the lens but this place: DIY VR Viewer Gives a pretty detailed descripion on how to make one.

STEP 2: Tools

The tools you will need are just:

A hot glue gun,

An X-acto Knife,

And Scissors.

STEP 3: Making the Viewer.

For making the viewer, I glued the template to my cardboard (If you don't have enough cardboard, cut the template in half without cutting any of the actual lines and such). After I glued the template, I cut out the cardboard in the places the template told me to, and folded it in the places it told me to.

After I was done with that, I glued the separate pieces together were I was supposed to, and slid a phone in to test it. It worked fine with its first test.

STEP 4: Setting Up Your Raspberry Pi

You will need to download Raspbian Stretch: Stretch Image

Click Download ZIP for Stretch With Desktop.

Once the download is finished, You can follow the instructions here for installing the image:

Installing the Raspbian Image

Once that is done, plug the SD card into your Raspberry Pi Zero and boot it up!

Your Raspberry Pi should boot up into the desktop, but if it boots into the login screen :

the username is: pi

and the password is: raspberry

Once you are in, get yourself comfortable with how it works and where everything is.

Now we will move onto installing Pi3D.

STEP 5: Installing Software

You can get pi3D from here:

https://github.com/tipam/pi3d

This will give an explanation of how to install it from the command line on the Raspberry Pi.

You can install the library for the sensor by simply running:

sudo pip install mpu6050

Once they are installed, you can move onto the next step.

STEP 6: Attaching the MPU6050

The image above is a schematic of where you should attach the MPU6050 Pins to the Raspberry Pi Zeros GPIO pins.

Once you have them connected, you can move onto the programming.

STEP 7: Programming

There is a file attached that has the program for the VR goggles. Open it in Geany Programmer's Editor and press F5 to run it and to make sure it works, then test out the gyro sensor by rotating it and making sure it is aligned with the rotation of the image. To close out just press Esc on the keyboard and the terminal should show up saying "Press Enter to continue" If you did everything correctly, you should have a screen that is rotated depending on the gyro sensor!

But that's not all... I am going to show you how to make the rest of the VR goggles!

STEP 8: Putting It All Together.

These are some pictures of the different holes and boxes I cut out to make things fit.

I put the screen in the slot where a phone would go, and the battery pack went right in front if it. I used tape to attach the gyroscope, and the double-sided tape to attach the USB hub. The Raspberry Pi was attached with foam tape and the battery I just slid into the compartment I had made for it.

The head straps were not included, I fashioned those with some elastic and an old headlight band.

STEP 9: Conclusion

Now that it is done, you can test it out! Plug the screen's power into the USB hub and plug the USB hub into the Raspberry Pi Zero. If you aren't quite sure what the different ports are on a Raspberry Pi Zero, there is an image above that tells about the different ports.

Make sure the HDMI is connected between the Raspberry Pi and the screen. Plug the Raspberry Pi power into the battery and turn it on!

32 Comments

Hi,
When I tried to run the code thru Geany, I encountered the error stating ""NO MODULE NAMED MPU6050""

So I tried to install it using pip install mpu6050 and still failed

I have attached the error message below. Kindly help me clarify
The “MPU6050” isn’t a package you can install, but a physical gyroscope you have to wire into the raspberry pi
Would you be able to use it to receive input from a pc, making it a vr headset? Either a wired or BT/WIFI connection would be fine.
I am not quite sure how I would do that, it is a good idea though.
Once I get this instructable built I'm going to look into writing something to get it working with Steam VR. Might not be doable as-is on this hardware, so I might make a separate instructible to extend this to be able to do that.
The android app Riftcat might help. That said, you'll need to get android working.
What licence is this file?
I know the author says to grab the stretch image here, but I'd reccomend to instead grab the latest version of Raspberry PI OS instead. I'm sure this was their intent.
Hi,

I am wondering how people are finding the performance of the RPI Zero W? I made a headset based on the RPI4 8GIG with a SenseHat replacing the mpu6050, but I am trying to reduce the weight of the headset.
the code is generating an error:

Traceback (most recent call last):
File "/home/pi/Downloads/mpu6050-master/mpu6050/mpu6050.py", line 245, in <module>
mpu = mpu6050(0x68)
File "/home/pi/Downloads/mpu6050-master/mpu6050/mpu6050.py", line 58, in __init__
self.bus = smbus.SMBus(bus)
FileNotFoundError: [Errno 2] No such file or directory



what should I do?
Which program are you running? Is the mpu6050 program installed on your pi?
i got the same problem, mpu 6050 ,pi3d,smbus all of these pips are installed,why is the MPU_pi3d.py still unable to run?
Plz help me ~~~
So, judging by the comments from everybody else, this is a stand alone style vr system/ head set. With no connection to accessories like motion controls, or PC connection? It's an awesome build, and was hoping to be capable of putting together something that I could play several semi big title games with, one of them being beatsaber. A lot of others being art type programs. Its a great weekend project though. Got most of the items in a wish list on wish now, for much less than Amazon's asking prices.
Yes, it is a standalone vr headset. But to play games like that I would recommend using a faster processing unit. The raspberry pi zero wouldn't be able to run beatsaber from my perspective. It may be able to run art type programs, that is if a controller is connected to it. So if you are wanting to run high end games, I would recommend getting a designated virtual reality headset such as an oculus rift or htc vive.
Understandable. But if I had the funds to afford an occulus rift, or an HTC vibe, I wouldn't be looking for a work around/DIY VR headset. If there was a way to incorporate a beefier component that allowed this to run high end games, that would be most ideal.
The Pi 3 or 4 should work for lower end games, there are also a lot of other single board computers computers out there that are a lot like the Pi. (That may or may not run games better.) It is very much possible to do games on it with a PC connection though.
I'm not sure that's what the OP was actually asking for. What I think they (and I) were hoping for was basically using the RPi to manage sending motion detection data to and receiving display from a game that is running on a PC... not actually running the game itself. And really I think that's where a project like this can really take off. If you could use it in conjunction with a PC running SteamVR that would bring the cost of getting into significant VR next to nothing.
is it possible to make a version where you just have the Arduino and sensors with a bluetooth module to make this work with something like vridge and psmove service
That should be possible
More Comments