使用树莓派制作谷歌眼镜

By

About: Currently attending UCSD. L'Chaim.

HDMI Ribbon CableHello, this is my first instructable, so feedback is greatly appreciated.

Abstract:

This project streams live video from a fish-eye camera onto a wearable heads-up display. The result is a wider field of view within a smaller area (the display is comparable to a 4" screen 12" away from your eye and outputs at 720p). The primary purpose is to provide more spacial awareness to those with Retinitis Pigmentosa (abbreviated as RP), a degenerative eye disease that results in tunnel vision (it is comparable to looking through a toilet paper roll all the time). That being said, because the project is based off an RPi, there is a huge range of possible applications (some of which will be discussed at the end).

Materials List:

Total Cost: ~265 USD (depends on what you already have and how much you pay for shipping)

Tools List:

  • Wire Cutters

  • Wire Strippers (for wire sizes of about 26 awg)

  • Hot-Glue Gun (and glue stick for said hot-glue gun)

  • Keyboard

  • Screen (must be HDMI capable, but again, with good enough eyesight, Vufine can be used as a monitor)

  • Soldering Iron (and solder)

  • X-Acto Knife

Personal Note:

This project was inspired by my grandmother. She was diagnosed with RP a long time ago and her eyesight has been deteriorating over the years. Recently, she decided to give up her seeing-eye dog, Ventura (nicknamed Seymour, pun intended), because of age. Though this may have made life easier in some aspects, I'm sure it has made other things more trivial (such as walking through a mall). I had already been looking into making a device like this for a while, but there were no readily available (reasonably priced) screens. That changed when I found Vufine. It's a great company with a great product, and no, I'm not being paid to say this; it's a genuinely good company. As for my grandmother, she has reported that this device has just about doubled her field of view (in terms of diameter, not area).

Update:

I built this with a Vufine module configured for the left eye (my grandmother is completely blind in her right eye), so there may be some issues for those building this for the right eye (nothing big, just a change of orientation for a few parts). That being said, Vufine has been kind enough to send me a module for the right eye so I can continue this project and fix those issues. As soon as I do, I will further update this instructable.

Teacher Notes

Teachers! Did you use this instructable in your classroom?

Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Setting Up the Raspberry Pi

Setting up the Pi's Hardware:

Note: If you have a Raspberry Pi other than an RPi Zero (W or regular), you can make the necessary software edits using that Pi and transfer the SD card to the Pi Zero.

Second note: I didn't actually buy some of the hardware that connects to the Pi; I have a convenient hat instead. That being said, the picture above is what your set up should look like. It is not mine and was taken from here.

First, we will plug in the keyboard. Since your keyboard has a type A USB connector (the ubiquitous rectangular one) and the Pi Zero doesn't, we will have to use the USB adapter. Plug the USB adapter into the USB port closest to the middle of the board. Then plug the keyboard into the USB adapter. The other USB port will be used for power. The top two cables in the picture are USB cables with the very top cable providing power.

Second, plug the HDMI cable into the mini HDMI port on the Pi and the HDMI port on your screen (if you chose to use the Vufine display as your screen, use the HDMI ribbon cable).

Setting up the Pi's Software:

This process is documented everywhere, but the official guide is here. It is important to note several things: you will be using the micro SD card that you bought (the one I chose has an adapter so you can flash it with a regular computer), you will be installing Raspbian, and you should enable the camera in the Raspberry Pi configuration menu. Additionally, DO NOT follow the tutorial in executing "startx". If you did, no biggy, but you will need a mouse now. Go to the command line (should look like a black window in your taskbar) and use that (the "pi@raspberry ~ $" should appear within that window). Now we will turn off the Raspberry Pi by executing:

sudo shutdown -h now

Step 2: Installing the Camera

Physical Connections:

First, let me explain how the ribbon cable connections work. To connect and disconnect ribbon cables, one must first lift the tabs on the side (for the Pi Zero, this is an outward direction), which will allow the connector to fold in and out to some degree, thus allowing the ribbon cable to come in and out. To secure the ribbon cable in place (and thus complete the connection process), you must press the folding piece of the connector flat against the cable and reinsert the tabs. The cable should now be secured within the connector. To see an official video on how this is done, click here.

It is important to note that the white cable that comes with the camera will not fit for the Pi Zero; make sure to replace it with one of the golden ribbon cables. Additionally, make sure the exposed side of the cable is facing downward, into the Pi and the camera boards.

Software:

The camera's setup is relatively easy on the software side. To stream video directly from the camera to the HDMI, simply execute the following line in terminal:

raspivid -t 0 -rot 0

The camera should now be streaming to your screen. Now, stop the stream by pressing ctrl+c. Now we will be executing the same command, but if you bought a standard Vufine module (configured for the right eye) change the 0 after "-rot" to 90. Likewise, if you bought a Vufine display configured for the left eye change the 0 after "-rot" to 270.

Now, if you hold the camera against the Vufine display in a manner similar to the way it's shown in the photograph, you should see an upright image (on your screen, not necessarily in the Vufine). If your image is upside down, try the other number (270 if you did 90 before and 90 if you did 270 before; you still need to press ctrl+c to get out of the stream).

Once you have the camera's stream correctly oriented (via software), we'll want to make sure it starts whenever the Raspberry Pi is turned on. The first step is to execute:

sudo nano /etc/rc.local

Now, type out a command similar to what you executed earlier ("/usr/bin/raspivid -t 0 -rot 90/270") in the lines between "fi" and "exit 0"(keep it on one line as seen in the picture).If you would like a lower resolution image with a higher frame rate, use "/usr/bin/raspivid -t 0 -rot 90/270 -md 6" instead. After typing this out, you should save it by pressing ctrl+x, entering y (yes, you would like to save it), and then pressing enter to save it under the same name. You should now be back at the command line ("pi@raspberry ~ $"). Finally, you can test to make sure everything works by rebooting the Raspberry Pi with:

sudo reboot

If everything works, you should see the camera streaming video to the HDMI output at the end of the boot process.

Notes:

  • After all of the above has been completed, you may want to consider applying a small amount of hot glue to the ribbon cable/connector on both the camera and the Pi to make sure it stays in place. This is purely optional and is something I haven't actually done.

  • If you have a Vufine display configured for the right eye and you choose to orient it differently (it's more convenient if the Pi's USB ports are on the bottom), the camera's top side will be on the left when you're wearing it.

  • The camera in the picture is already mounted. We'll get to that in a later step.

  • I wanted to post a picture of the camera connector on the Pi, but I don't want to take the Pi off if I can't put it back on and I lost all of my zip ties (which you'll see are necessary for mounting it in a later step) and I'm not sure when I'll next be able to go buy some more, so I've decided to just upload now and update later.

Step 3: Charging the Vufine Display

The Vufine display has a battery of its own, but it lasts only 90 minutes, and while this may be enough for the Vufine's intended usage, it's insufficient for our purposes. That being said, we can charge the Vufine while it's being used, and thus extend its battery life. However, regular USB cables are rather large and since we want to minimize the weight, we will have to modify one (making it smaller and lighter in the process); we will strip a USB cable down to the very minimum.

Note: The rest of this step details how to get the connector from a USB wire. That being said, I was made aware of these cheap (in cost) USB connectors. Using them would allow you to skip the dangerous part of removing the connector from the wire. I have no experience with them, but I'll update this instructable on how to use them once I do.

Preparing the USB Cable

Note: This is, by far, the most dangerous part of the build. Extreme caution should be exercised around sharp knives

The first step in "minimizing" the USB cable is to cut it about 5 inches (I would say about 7 for a right eye configuration) up from the micro USB end. Continue by stripping the wire all the way down to the USB micro end.

Now, for the dangerous part, you'll have to cut the plastic encasing off using the X-Acto knife. I suggest using a set of pliers or a table vice to hold the plug while you cut it to minimize the risk of cutting yourself. The best way to cut it off is to cut along the seams on the side (they look like lines) as seen in the picture. You should be using a decent amount of force to dig the knife into the casing. After a while, one side may be able to "swivel" outward, and depending on how free it is, you may choose to use a pair of pliers to rip the rest off rather than cut it off.

Finalizing the USB Piece

Once you are left with just the metal piece, you should remove the two middle wires (the non red and black ones). You can do this by either cutting them off or using a soldering iron to desolder their connections and simply take them off (I suggest desoldering if you have enough experience). Next, put some hot glue on the base of the wires (where they meet the Micro USB plug) to provide an insulator and to keep it secure. When you're done, the image should look something like the USB in the picture (we haven't connected it to the Pi yet, though).

Connecting it to the Pi

This step is rather simple. All you have to do is solder the red wire to the 5v port and the black wire to the ground (GND) pin on the RPi. To see exactly what ports, see the image with the red rectangle on the Pi. To see a video on basic soldering, click here. I suggest you use some hot glue on both sides of the Pi (where you soldered) to secure the wires and to provide an insulator.

Step 4: Connecting It All.

3 More Images

Securing the Pi

At this point, place the Pi against the Vufine module with the camera port near the front and the USB connectors (installed on the Pi) facing downwards and inward. Secure it using the two pairs (one pair for each side) of zip ties. Do this by putting a zip tie through one of the top corner holes on the pie, wrapping it around the Vufine (downward), and putting it through the bottom corner hole on the same side of the Pi. Then take another zip tie and lock it on to the first. Tighten it so the Pi is pulled close to the Vufine. Cut off the remaining zip tie body for both zip ties (all for the second, and the part that sticks out of the second zip tie for the first). Repeat this step on the other side of the Pi.

Plugging Stuff in

这可能是整个构建中最简单的步骤。将焊接在USB上的USB电缆插入Vufine显示屏。

热胶连接器

磁性对接站中的磁铁对我们的用途来说不够强大,因此我们将添加一些热胶以加强连接。将Vufine模块连接到磁性扩展坞,它带有(不是加)带的带(如图所示)。确保它与实际Vufine平行(您仍然可以通过在眼镜上移动带子来调整显示器的位置)。在顶部和底部涂抹适量的热胶。让它冷却然后继续前进,确保它在凝固之前不会挤到一个奇怪的位置。

塞进东西,续

虽然这个部分并不像第一个插入的东西那么容易,但你不应该太过挣扎。只需将HDMI带状电缆插入Vufine和Pi(挣扎比心理上更加心理;你可以做到。我相信你)。

连接相机

左眼配置:

这是一个简单的部分,但相机的定位使得难以用文字描述。基本上,您将连接相机,使其侧面与带状电缆环在其下面。看图片看看我的意思。将其按在Vufine屏幕上并通过在顶部和底部涂抹热胶将其固定在此位置。我不会把任何东西放在两侧,因为它只是在顶部和底部就足以固定它并且在侧面做它可能会阻止任何侧面调整色带和Vufine屏幕。

右眼配置:

我之前没有做过右眼配置(一旦我做完就会回来编辑),但基本上你需要确保摄像头是侧面的并且位于屏幕顶部的合理位置。顶部(与连接器相对的一侧)应朝向左侧(当您佩戴时左侧)。使用热胶将相机连接到Vufine模块上的屏幕。此外,您可以使用热胶(或拉链)确保任何多余的带状电缆固定(为可调节性提供一些背离,并尽量不要折叠色带,因为它不能承受高度旋转) 。如果由于物理位置发生变化而需要重新配置摄像机流,也可以返回步骤2:安装摄像机

第五步:鳍。

打开它

要打开它,只需按下背面的灰色按钮即可打开Vufine模块。它应该开始闪烁蓝色。接下来,使用最右边的USB端口插入Pi Zero(在外面并标记为PWR IN)。除了Vufine模块上闪烁的蓝色LED之外,您现在应该看到开启的红灯常亮。这意味着Vufine正在充电。此外,屏幕应该开始,您应该看到Pi完成其启动过程,最后会出现相机流。屏幕出现后,Vufine按钮上闪烁的蓝灯应变为稳定。

注意:如果您先打开Pi(然后是Vufine),您的屏幕可能会变得奇怪。要解决此问题,请关闭Pi,然后重新打开。

把它关掉

通过拔下为其提供电源的USB来关闭RPi。要关闭Vufine,您可以让它自动关闭(在短时间内没有收到信号后会这样做)或者您可以按住Vufine上的灰色按钮(带蓝色LED)直到蓝色LED熄灭。我更喜欢让它自己关闭,但你做到了。

进一步改进

正如摘要中所述,由于该项目基于Raspberry Pi,该项目具有巨大的发展能力。首先,我有一些想法:

  • 您可以将它连接到无线键盘,以方便用作单挑Linux计算机。我会用一个键盘(和鼠标)像这样,我也把它挂在类似的过程

    • 添加像这样的基于手部动作的界面也很酷。

  • 在侧面添加按钮以保存图片和视频以及放大和缩小

  • 添加本机电源开关(我说是原生的,因为有些USB电缆内置了开关)

  • 为所有东西制作3D打印盒。

  • 添加音频输出

  • 添加电池附件

    • 将它放在眼镜的另一侧将是添加平衡物的便利方式(眼镜上的重量目前有点不平衡)。

  • 使用TTS(文本到语音)输出创建CNN(卷积神经网络),以获得一个环境的音频描述。这种神经网络可以在Movidius神经计算棒上运行,以获得更高的计算能力。

注意:

我稍后可能会添加更多图片。如果你想要特别的照片,请告诉我,我会尽我所能。这同样适用于解释; 如果你想让我更详细地了解一些事情让我知道,我会尽力完成它。

谢谢

  • 我从这个社区学到了很多东西; 希望这有助于其他人,因为这里有很多人帮助了我。

  • 再次,这是我的第一个指导,任何和所有的反馈将非常感激。如果有人对此做了什么,请告诉我; 我很想知道社区在哪里这么做。

未经允许不得转载:球盖网 » 使用树莓派制作谷歌眼镜

赞 (0) 打赏

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏