RaspberryPI HAL9000
If you want to build your own voice controlled HAL9000 for a ~$100, you came to the right place.
We will use a Raspberry PI computer with some of-the-shelf computer components, and a custom acrylic box to create this iconic computer from Stanley Kubrick's 2001: A Space Odyssey, so perfectly portrayed by the voice of Douglas Rain.
This is what we'll build:
What We'll Need
We will need:
- Raspberry PI 2 Model B ($25)
- Raspberry PI Power Cord ($5)
- WiFi USB with Antenna for Raspberry Pi ($9)
- Used Titanium Super Wide Lens 0.42x AF (~$4)
- Metallic Spray Paint (~$4)
- Generic 7.1 Channel USB External Sound Card (~$4)
- Used Insten USB Digital 6 LED Webcam (~$4)
- Wireless Portable Mini Speaker ($10)
- 3mm(1/8") Cast Acrylic Sheet - black - A3 Size (2 x $10 = $20)
I also had to pay for:
- Laser cutting service ($10)
- Shipping and postage ($5)
Which is a total of $100. You can probably go cheaper than that, if you find/have any used components.
You can check out the Bill Of Materials document here.
Cutting the Acrylic (Plexiglass) Case
Use the supplied plans to cut the acrylic/plexiglass.
I've used a 3mm thick cast black acrylic. Once you peel off the protective layers (NOTE: don't peel them off until you've assembled the box), it is actually 2.9mm thick, and the box plans were constructed using that thickness, and it turned out really nice.
The diameter of the lens that I've used (Titanium Super Wide Lens 0.42x AF) is 56.8mm, but the diameter in the plans is actually 56.7mm to compensate for the width of the laser beam and the acrylic that melts around it. In my original design I've used 56.55mm and the fitting was too tight, I had to sand off 1/10th of a millimeter in order to fit the lens through.
To open .dxf and .dwg files you would need AutoCAD, but you can also use DraftSight - which is a great, free, alternative.
Spray Paint the Metallic Parts
The thin frame on the front and the perforated bottom part of the front face should appear metallic. Use an exacto knife to separate the acrylic protective layer of the perforated bottom part and peel it off before you spray-paint it, so that only the bottom layer gets painted in metallic, and the top part doesn't since it'll still have the protective layer on.
TIPS:
- Shake the spray can really well.
- Keep the nozzle at least 1 foot away from the object that you are painting
- Paint always in the same direction
- For the best results, paint with the fine mist, in several layers
- Wait for 20mins before applying another layer
Hack the Camera
Unscrew the safety screws and open up the webcam, exposing the bare electronics.
I used a red marker to paint the LEDs red, and I super glued it to the back disk screw of the camera lens, which I previously disassembled.
If you don't know how to disassemble a camera lens, there are dozen of youtube videos that will help you with that, like this one:
TIP: If you don't have the special tools (the one that looks like compasses) you can use scissors, which is what I did.
Prepare the Front Face
Fit the camera lens into the opening on the front face of the box, and peel off the acrylic protective layer, which doubled as a masking tape during the spray-painting step.
The front part of the camera lens can also be unscrewed. It took some muscle, but I was eventually able to remove it. You will need to remove it in order to fit the lens through the opening in the front face. Once it's fitted, you can put the glass parts of the lens back in, and screw the metal ring back on top.
Now sit back, and enjoy your work for a minute, it's starting to come together nicely :)
Assemble the Box
Take the front, top, bottom, left, and right face, and form them into a box. But do not glue them together directly! Assemble everything using the sellotape first, and once everything is in place, superglue it from the inside.
I used regular super glue, but you can use special glue for plexiglass/acrylic if you want to.
Use the sellotape on the outside of the box, and apply the glue from the inside to prevent the glue from leaking outside the seams, and ruin the visible parts of your box.
TIP: If the superglue does get through to the visible parts of the box, it will turn white, which looks really bad on the nice black acrylic. In order to remove it, you can use any plexiglass polishing paste. If you don't have any handy, any abrasive paste will do. I used regular tooth-paste, cotton pads, and a lot of rubbing and patience to remove the superglue from several regions, and the results were great.
Back of the Box
The back of the box is (only slightly) more complex, because of the sliding door. We will create a canal for the sliding door to go through.
First, glue the two small rectangular pieces onto the top and the bottom face, inside the box. These will be used to carry the inside frame of the sliding canal.
Put the inside frame (the smaller of the two rectangle frames) inside the box on top of the two carriers that you glued-in in the previous step. BUT! Before you do, you will notice that the bottom face has a little half-circle opening which is used to let the power cord through, so place the power cord through the opening before gluing the inside frame. (Or you can split the inside frame at the bottom. The only reason why it wasn't pre cut is that if it were cut, the whole frame could warp a little during the laser cutting process).
Once the inside frame is in place, you can glue the outside frame (the bigger of the two rectangle frames) on top of the box. Leaving enough space for the sliding door to slide in and out.
Try if the door will slide smoothly, before gluing the top frame.
The Guts and Brains of HAL9000
Originally, I had a bunch of compartments, distancers and spacers precut to make the inside of the box a bit more tidy, but... I haven't really used them.
I used a dishwashing sponge to keep the bluetooth speaker in place at the bottom, the lens was fit tightly in the opening, and it didn't need any support, and the Raspberry PI and the cables... well... they're a mess, with or the without compartments :)
Connecting the guts to the Raspberry PI should be easy:
- Attach the power cord to the Raspberry PI.
- Plug in the USB squid HUB into the Raspberry PI.
- Plug in the USB cable from the speakers into the squid.
- Screw in the webcam onto the lens and put its microphone into the little hole on the front face
- Plug in the camera USB cable into the squid.
- Plug in the WiFi into the squid
- Plug in the USB sound card into the squid
- Plug in the camera microphone cable into the sound card
- Plug in the speaker into the sound card output jack.
And that's it. Easy peasy.
Now, making everything fit inside the box, well, that's a bit harder. But I'm sure you'll manage :)
Notes:
- The hole for the Wi-Fi antenna on the right face was a bit too loose, so I've used some duct tape to make it a better fit
- The webcam has a little potentiometer wheel to regulate the brightness of the LEDs, and I've left a rectangle hole on the right face, so you can access it from the outside the box, and you can easily squeeze it in between the box and the lens, and it will not bulge.
- The USB squid HUB is really handy since you can rearrange the cables easily and use the
Complete the Box
Glue the thin metallic frame on top of the front face, slide the back door in, gently peel off any remaining protective layers from the acrylic, and admire your work.
While doing so, print out the HAL9000 logo, and glue it onto the front face and you are set!
Wait, But It Doesn't Do Anything!
Okay, okay, we've skipped an important step - the mind of the HAL9000.
Playing wavs
If you just want your HAL to play sounds from the movie, find the HAL sounds on the web (i.e. http://sounds.stoutman.com/sounds.php) copy them onto your Raspberry PI, SSH into your Raspberry PI and play them using aplay.
Recording wavs from the microphone
You can save audio from the microphone by saving this script to /home/pi/microphone.sh and running it on your PI
Saving webcam screenshots
You can grab webcam screenshots by saving this script to /home/pi/webcam.sh and running it on your PI, but I didn't get any decent results with a cheap webcam, and the camera lens distortion, but you might get lucky.
Talking to your HAL
If you are up for a challenge, though, and want to do something more advanced, like this:
You should check out Jasper, an awesome open-source project that will turn your RaspberryPI into a voice controlled computer.
Installing Jasper deserves its own tutorial, and it is not for the faint of heart, but oh boy, it makes this whole project 10 times more awesome!
Try it!
Jasper Modules
I've written a couple of Jasper modules for you guys to try out:
- Jasper MQTT Module - Publish simple MQTT events to fuel your home Internet of Things (IoT) hive, and control MQTT enabled devices with your voice!
- Jasper Selfie Module - Say "selfie" or "cheese" or "take photo" and HAL9000 will take a picture from the webcam and send it to your email! Instant photo booth!
- Jasper Wav Play Module - Play a random WAV file from a pre-configured directory.
- Jasper Shutdown Module - Shutdown your Raspberry PI with your voice
- Jasper Reboot Module - Reboot your Raspberry PI with your voice
Stay tuned for more.
Trivia
-
It is often conjectured that the name HAL was based on a one-letter shift from the name IBM, but that has never been confirmed by neither Clarke nor Kubrick.
-
HAL stands for Heuristically programmed ALgorithmic computer.
-
Have you ever wondered why HAL sang "Daisy Bell" when Dave was removing his memory boards?