The Darth Vader chest box is almost finished

Introduction

The last month I’ve been working on my Darth Vader chest box. I’ve designed and built my own circuit with the Holtek HT8950A voice modulator, I create a laser cut case and designed 3D printed parts for the chest box. Since I had to learn a lot of new techniques, e.g laser cutting and 3D printing, this is by no means an easy project for me. With the project in it’s final stages now some design problems turn up that need fixing.

Soldering the board.

This week I soldered the components to the board. First I soldered the voice changer components and made sure this part of the circuit is working. Next I soldered the amplifier. I tested the total circuit and it worked the first time which is always a joyful moment. I find the Adafruit perma-protoboard very easy to work with since I’m able to copy the layout from the breadboard. Next I grouped all the buttons that operate the HT8950A on a board and soldered them to a piece perfboard. The buttons on the perfboard fit nicely into the laser cut side panel that I already made. Operating the chest box is easy with this (a major issue with my previous chest box).

Soldered perma-protoboard and breadboard side-by-side.
Close-up of the soldered board with the HT8950A voice changer chip on the right and the LM386 amplifier on the left.
Operating the voice changer with this panel should be easy.

Design issues

Last week I made 3D printed parts for the front of the chest box. Unfortunately I found that these parts didn’t look good with the laser cut box. The plastic parts just didn’t do justice to the laser cut plywood. I therefore decided to laser cut all the parts that sit on the from of the box with I think is aesthetically more pleasing.

Another problem arose with the female audio jack connector that I need to plug in the microphone. The thread of this 3.5mm connector just isn’t long enough to be fitted onto the 6mm thick plywood. I designed a container to solve this. The audio connector fits into this container and the container is screwed to the case. Hopefully this container solves the problem.

Container for the audio jack connector created with Openscad. The container, screwed to the chest box, will keep the audio connector tightly to it’s place.

Yet unsolved problems

  • I need to attach a nylon belt to the chest box. I’m thinking about popper snap fasteners attached to the belt to open or close the belt.
  • The HT8950A works fine with a proper audio signal as input but the microphone that I have, a small electret microphone, doesn’t give any audible output (except for noise). I assume that the signal is to weak and therefore needs amplification.

Designing parts for the Darth Vader chest box with OpenScad

Introduction

A new year, a new beginning. Last year I took a fair interest in technologies like laser cutting and 3D printing but I still relied on my old 20th century skills for my projects. I must admit that the investment in time to master these new technologies was holding me back to advance in both laser cutting and 3D printing. In the very last month of 2015 I took the decision to produce a case with a laser cutter. It was a revelation. A job that would normally take me a day or so was done in a matter of minutes with a precision that I can never achieve with the old saw and chisel. From that point on I decided to invest heavily, in both time and money, in these new technologies.

OpenScad

First I learned to work with Inkscape, a free 2D vector drawing program for laser cutting. I discovered that it is a good tool for illustration (e.g for web design) too. Next I needed a 3D design tool to create parts with a 3D printer. I looked at different programs such as Sketchup, 123D Design but I increasing dislike the proprietary character of these programs. Echoing the words of Richard Stallmann “the proprietary program is a system of unjust power”. On the non-proprietary side there is FreeCAD and Blender but I found the learning curve of these programs too steep. Then I discovered OpenScad when reading an article on HackaDay. It’s a free (as in free beer and free speech) program running on Windows, Linux and OSX that has a great community. Instead of using a GUI the user has to scripts his models with a simple descriptive programming language. This seems strange and cumbersome at first but it actually works for me. I found it very easy to get into. OpenScad is very lightweight. A GUI in CAD programs tends to be a burden on a PC and OpenScad lacks that GUI. Because of the script that OpenScad uses it is very apparent what is in the 3D model and what the dimensions are. Lastly the script is saved with the model. The comparison with HTML comes to mind. Therefore it is possible for anyone else to see how a model is made, learn from it and make changes to it. For now OpenScad works for me although I’m not sure what will happen if I’ll try to design more complex 3D models.

Combined elements of the front of the Darth Vader chest box made in OpenScad. Still needs some work.

Parts for the voice changer

The Darth Vader chest box has a very distinctive look with lots of distinctive buttons and other parts (see images below). I modeled these parts with OpenScad beginning with the simple buttons working my way up via the coin slots to the complex rods. I’m satisfied with the result thus far. Next I’ll 3D print the parts and glue them to the plywood chest box I made earlier.

Probably the most simple parts of the chest box are the buttons at the bottom of the box. Modelled in OpenScad.
Coin slot type of parts for the Darth Vader chest box. 
Rods for the Darth Vader chest box.

Homemade Darth Vader Voice Changer 2.0 (work in progress)

Introduction

The last couple of weeks I worked on a homemade voice modulator that is easy and cheap to built. First I’d like to mimic the Darth Vader Voice Changer, but with the press of a button it can be changed to robot or helium kind of voice effects. Last week I’ve steadily continued my work. The project has two main parts, the electronics and the case.

Electronic circuit

For the project I choose the HT8950A voice modulator from Holtek as the heart of the circuit. It is cheap, versatile and easy to work with. I previously had the voice modulator working. I only had to amplify the signal which seemed simple enough. Well, that turned out to be a bit more troublesome than expected. After connecting the LM386 to the circuit and powering it up an annoying hiss was introduced. After some experimenting I figured that the breadboard was to blame and decided to copy the circuit to another breadboard. Although on the new breadboard the hiss appeared somewhat reduced but it was still at an unacceptable level. Even when I removed the input signal from the LM386 the hiss continued. I connected the HT8950A with a audio-jack to an external amp. I wanted to make sure that the hiss was coming from the LM386. With the external amp the hiss was gone. The fact that I had hiss without an input signal indicated that the supplied voltage wasn’t clean.  To clean it up I placed a small capacitor (10nF) from pin 6 (V+) to ground and voila the hiss was gone (see schematics below). It took me some time but I’m almost ready to finish this circuit and solder it to perfboard.

Two (almost identical circuits) with the Holtek HT8950A voice modulator and the LM386 amplifier. Both circuits gave a hiss which was unacceptable. Eventually a simple 10uF capacitor from pin 6 to ground did the trick for me. 
Schematics of the Darth Vader voice changer. I was able to eliminate all the hiss and noise from the LM386.

Printing the case.

I decided previously to make a T-slot plywood case for the Voice Changer but I’m not satisfied with the result. First I made a beginners mistake with the tab width. It was chosen poorly resulting in fragile edges of the case. Also I discovered that a T-slot case is not the best choice for this project. The case needs to be sturdy and the T-slot isn’t. I’m afraid it will fall apart when in use. Therefore I’ll made a regular finger joint that will be glued together. This new case was much better. Gone are the fragile edges and I’m confident that glued together it will be very sturdy.

Laser cut case made out of plywood. I first used a T-slot type of case but made a beginners mistake with the tab width and positioning. As a consequence the edges become very fragile. The front of the case has engravings for the positioning of large controls of the voice changer. These controls on the front will we dummies just to mimic the look of a Darth Vader voice changer. The actual controls will be on the side of the box.
Laser cut case with regular finger joint. This attempt is much better.

Darth Vader voice changer 2.0: designing the case

The first voice changer that I made had a handmade 1/2″ thick plywood case. Making it was very time-consuming and it’s a bit heavy. I felt I could do better. This year I got interested in laser cutting but until now I only read about it. The laser cutter isn’t as widespread as the 3D-printer. The laser optics combined with the CNC bring a whole range of possibilities when compared to creating by hand. First of all you can design with a computer and then send your file to the laser cutter greatly increasing the precision of the case. Second I can make casings that I never thought were feasible, e.g. it is possible to curve the wood by cutting in certain patterns, make complex wood joints normally the territory of professional carpenters or create detailed engravings in just minutes, just to name a few.

In the area where I live there is a FabLab that provides me the possibility to use their laser cutters for a modest fee. I’ve already been there to test the equipment.
To create a case I started with an online tool called Makercase. It’s an easy to use tool that, once you’ve entered the parameters on length, width, thickness etc, provides you with an svg-file. The svg-file can be opened and changed in Inkscape, a free vector drawing program. Adobe Illustrator and Corel Draw are fine too but they are expensive and proprietary programs. Inkscape has a learning curve so I have spend the better part of the week to get acquainted with the program. I nevertheless made good progress and hopefully I’ll be able to have the case ready this week.

Image of the by Makecase generated svg-file. I choose the T-slot design and a thickness 1/4″. This is half the thickness that I used for the earlier version of the Darth Vader voice changer.

Darth Vader voice changer 2.0 (HT8950A)

Introduction

Last June I wrote about a Darth Vader voice changer that I made. Back then I used the Velleman MK171 kit as the electronic part of the voice changer. Although it worked pretty well I felt that some area’s needed improvement. First, I couldn’t get the pushbuttons mounted on the housing to work making it hard to switch the voice effect. Second, I didn’t like the limitations that obviously come with such a kit; you’re more or less bound to the design as intended by Velleman.

The HT8950A chip

For this project I wanted to deviate from Velleman’s MK171 design and experiment with the HT8950A chip, the heart of the kit. The HT8950A chip from Holtek is a voice modulator that provides two special effects, Vibrato and Robot (pin 2 and 5 respectively). It also provides frequency level shifting enabling the user to shift the frequency up or down (pin 3 and 4 respectively). This is perceived as a higher or lower pitched sound resulting in a ‘Darth Vader’ type of sound when the frequency is shifted two steps lower. More detail on this can be found in the datasheet of the HT8950A. An external LED connected to the LAMP pin (pin 11) changes it’s brightness when the input voice signal changes. Pin 12, the AUDIO, provides the resulting sound that can be amplified.

Breadboard with in the middle the HT8950A. For this chip relatively few components are needed to get te voice modulation to work.

The chip can be acquired by buying the MK171 kit from Velleman. This kit also provides you with a LM386 amplifier however it is cheaper to buy the HT8950A without the other (generic) components from eBay or Aliexpress. If you do so make sure that your supplier of your choice has sufficient positive feedback.

Building it on the breadboard

On the datasheet of the HT8950A (page 5 onward) schematics can be found how to connect the chip. The amplifier of  the schematic on page 5 or 7 can easily be exchanged for another one of your liking. I’ll probably use the LM386 because it’s cheap and I have several on stock. In order to operate the HT8950A one only needs a couple of generic components (7 resistors, 5 capacitors, an LED and a zener diode) so building it is not too complicated.

First I built the circuit on the breadboard without an amplifier. The HT8950A actually has it’s own built-in amplifier consequently connecting a small speaker to AUDIO (pin 12) is sufficient to give an audible sound, though barely. Alternatively a headphone can be used. This is especially useful if your roommates start complaining about the weird noise. Later I also connected a homemade amplifier to the circuit (to my roommates despair). The Robot mode sounds good but while testing the frequency level shifting mode a lot of noise became apparent. Placing a capacitor over pin 8 and 9 (AO and AIN respectively) reduces this noise considerably. Optionally a 25K potentiometer can be placed between the 33K resistor and pin 8 to tune the sensitivity of the microphone or any other sound input.

Although I’m rather pleased with the result. I would like to take this experiment a little further. Next I’ll try to further optimize the sound, add the LM386 amplifier and solder the circuit to a perf board. Then I’ll either use the plywood housing that I made for the original version or make a lighter one.

Overview of the circuit. The Audio in is coming from an old FM radio (top-left). I’m using a headphone to listen to the modulated sound while keeping my roommates happy.

Schematics of the experiment. The capacitor between AO and AIN varied between 47nF an 220nF to reduce the noise. I found that the 47nF gave the best results.

Ancient laptop with Puppy Linux

The burglar that “visited” our house a couple of weeks ago took our laptops and tablets. Luckily our desktops were left alone (probably to heavy). Also a very old IBM Thinkpad T40 was left behind. The burglar probably thought it didn’t have any value. That was a bit of luck for me because with a little effort this 12 year old laptop is still very usable. After all these years the only thing that failed in this laptop was the battery. Everything else is still in excellent condition. These Thinkpads were (are?) very sturdy. On top of that they are very modular. Almost every component is easy accessible with just a screw driver. Very different from modern laptops that are almost impossible to open without special equipment.

The twelve years old IBM Thinkpad T40. Is it worth reviving it?

With a 1.4GHz Pentium M inside the T40 is, I suspect, hardly faster than the Raspberry Pi 2. I therefore needed an Operating System that isn’t a burden for this hardware. Since Windows XP isn’t an option anymore I looked at Linux and decided to give Puppy Linux 5.7 Slacko a spin.

Puppy Linux is very small and it loads into the ramdisk and is therefore very zippy , even on old machines. Installing it on the Thinkpad T40 was easy. It recognized all hardware even the wifi (which can be a problem with other distro’s). Unfortunately I can’t use the wifi chip inside the T40 because the WPA2 security protocol that I use in my network is unknown to this chip. This was easily solved with a wifi USB-stick.

Now I’m typing this blog from the T40. Firefox (version 17 ESR) works fine. I can access Google+, Youtube and other sites without problems although the rendering of some sites isn’t perfect. With Geany I can create html/css pages and code Python. Wordprocessing is done with Abiword and spreadsheets with Gnumeric.

Do I want my laptops and tablets back? Of course but in the mean time I thank Barry Kauler and Co for this wonderful distro.

Puppy Linux Slacko 5.7 runs fine on this very old laptop.

Typing my blog on the T40 without a problem.

Plywood housing for the homemade surveillance camera

In the last two weeks I have built a Raspberry Pi surveillance camera. For the time being I used a crude housing made out of MDF. This was ok for testing purposes but now I wanted something more permanent. Something that I could attach to my window frame and that is able to pan and tilt to get the best angle at my backyard. I could buy of camera housing such as the ModMyPi Nwazet Pi Camera or buy a dummy camera and build the surveillance camera in it. However building it myself would be more fun. I decided on a housing made out of plywood since it is cheap, strong and durable.

The Raspberry Pi surveillance camera keeping an eye on my backyard.

The housing is rectangular box that nevertheless looks like a camera due to the round placeholder of the camera. I used 1/2 inch thick plywood for the body of the housing and 1/4 inch thick plywood for the lid and bottom plate. The camera module is placed between two pieces of plywood, that keep it in place. The two pieces are tight together with two machine screws. I used spacers to prevent the module from being squeezed when tightening the machine screws.

Housing of the surveillance camera
The front of the housing lifted showing the Raspbery Pi B mounted on the 1/4 inch plywood bottom.  
The camera module is easily removed from the front.

I left an opening in the camera housing to have easy access to the micro-USB connector and the SD-card.
the Raspberry Pi camera module between two pieces of 1/4 inch plywood kept together with two machine screws.

The camera housing is connected to a plywood frame that enables me to pan and tilt it. The frame is also made out of 1/2 inch thick plywood. The three pieces are glued together and two 1/4 inch machine screws (one on the top of the housing and one on the bottom) connect the frame with the housing. Two wing nuts are used to tighten the camera enabling the camera to pan. The frame is connected to the wall with cylindrical piece of wood (from a broom stick). Two pieces of plywood at the end of this pieces of wood enable the camera to tilt (see image below).

The finished surveillance camera. The mount will be fitted to our window frame. The camera can be panned and tilted to get the best view of my backyard.

With the housing and mount complete my Raspberry Pi surveillance camera is finished. Motion has been very stable on the Pi. I haven’t had a crash or malfunction in three weeks. And thanks to crontab the camera doesn’t need a lot of maintenance. Is there something left to be desired? Yes. The camera is not usable at night (I need the NoIr camera and IR lights for that) and I have false positives e.g. when it rains (the raindrops on the window are causing this) other than that I’m pleased with the result.

Raspberry Pi security camera, first experience

Introduction

Last week I wrote about the Raspberry Pi, the camera module and Motion acting as a surveillance camera. I’ve been testing my Raspberry Pi surveillance camera for a week now and the results are satisfying although there are also some problems. I think much of the succes of the camera comes down to finding the best settings of the /etc/motion.conf file of Motion for a given scenario. The motion.conf file enables you to setup the Motion program. Everything from camera settings to motion detection can be changed in this file.

Image from a motion video. If someone (in this case my son) is entering our backyard it is perfectly recorded by Motion.

Threshold

I want my surveillance camera to record anyone entering my backyard but this sounds easier than it is. If the threshold parameter in motion.conf is too low all kinds of events are recorded that are completely irrelevant. E.g. on a rainy day raindrops falling on the window are recorded. With higher threshold values I might miss something relevant. After experimenting with different values of the threshold I found that a value of 1500 works best in my case.

Lens flare

On a sunny day bright sunlight can fall onto the camera lens causing lens flare. This reduced contrast and color saturation (see image below). More importantly the Motion program detect changes in lens flare as motion and records them. I think problem can easily be solved with some kind of lens hood.

Lens flare caused by sunlight reducing contrast and color saturation.

Night

A whole different problem is motion detection at night. My camera, the regular Raspberry Pi camera module, is just not up to this task. For detection at night I’ll need the NoIR Pi camera. This camera has no infrared filter. As a consequence colours at daylight look odd but you’re able to record at night, but only with infrared light illuminating the subjects. Several add-on boards for the NoIR Pi camera are on the market that do just that. These boards fit right over the camera module.

The regular Raspberry Pi camera module is useless at night.

Proper file permissions

I created a directory /home/pi/Camera on the Raspberry Pi. I want all my video files to be stored in this place however before Motion is able to do this I had to change the permissions. Motion (the Program) creates it’s own user motion so this user needs proper permission in the home/pi/Camera folder (that is created by the user pi). To do this I first changed the group ownership of the folder:

chgrp motion /home/pi/Camera

And next give the group the proper permission:

chmod g+rwx /home/pi/Camera 

Scheduled tasks

The number of motion video’s that are stored on the Pi increase rapidly over the days. My backyard is quiet but not that quiet (not to mention the false positive that I described above). Since the Raspberry Pi stores the files on an SD card I will easily run out of storage space. So I need a method to remove the files automatically e.g after five days. Cron is perfect for this since it let me schedule commands or scripts periodically. I wrote a shell script that removes avi files created by Motion older than five days and added this to my crontab file to be executed daily. The key command in this script is:

find /home/pi/Camera -mtime +5 -name “*.avi” -exec rm {} ;

Copying files to a PC

Whenever I want to check the motion files (e.g after one day) I copy them to my iMac using scp from the OSX terminal and then created a playlist in VLC by dragging all the files into it. The harvest of that one day is then displayed.

scp pi@192.168.178.27:Camera/*.avi to/destination/folder

What’s next

Next I’ll test the surveillance camera further until I’m satisfied with the settings and build a proper housing for the camera. Possibly I will switch from the regular camera module to the NoIR camera.

Homemade security camera with a Raspberry Pi

One week ago we’ve had a burglar in our house. Of course I immediately started improving the security of our home. After improving the usual stuff I felt the need for some kind of surveillance camera. This camera could provide me a good view of the backyard which is a very quiet place and therefore preferred by burglars. Because I like to make things myself I thought it was a good idea to use a Raspberry Pi and it’s camera module. I used them in the past for timelapse video’s of scenery but I hadn’t used it much lately.

The goal that I had set was a camera that detects and records motion and that I could access through our local network preferably a browser. I also wanted the camera to give decent images by day and night.


Hardware.

The heart of the system is a Raspberry Pi B with the Raspberry camera module. Furthermore I use an Edimax dongle for my wifi connection and a micro-USB power supply (1A). Initially I use an MDF case that I made to fit the camera and the Pi. It isn’t pretty but it protects both the camera and the Pi. If everything works as planned I probably built it into a dummy camera such as this one or may make a wooden enclosure myself.

Initially I had some problems connecting to the Pi through SSH. I discovered that this was caused by the Edimax dongle (8192cu wifi chip) that apparently goes into sleep mode after a period of inactivity. This was solved with a command line fix that disables power saving (see here on page 17 how to fix this).

Raspberry Pi B and camera module in an MDF enclosure.

Software

On top of Raspbian I installed Motion. Motion is a Linux program that monitors the video signal from camera’s and, very important to me, is able to detect motion. Motion is widely used and there is plenty of good information on it on the internet. A simple tutorial how to install Motion specifically on the Raspberry Pi and get it to work with the Raspberry camera module can be found on here (go to step 7 for software installation). However Motion has far more possibilities and it is worthwhile to explore these once you start using it.

Configuring and testing the system

Motion can support multiple camera’s but I’ll stick to one camera for now. Configuration of Motion for the Raspberry Pi and it’s camera module is done in the /etc/motion.conf file (not in the /etc/motion/motion.conf file). There is a very good YouTube tutorial on configuring Motion for Linux here and here. At this point I made only a few changes to the motion.conf file such as camera width and height, directory where the video is stored on the Pi and some camera specific variables.

The camera works great. The image quality is good and the system appears to be stable. I can open a stream of the surveillance camera in my browser by entering the url of the Raspberry Pi and the selected port (default 8081). My motion files are stored as avi’s on the Raspberry Pi. I can play them with VLC media player on my iMac. Next I’ll experiment with the settings of Motion (e.g. sensitivity of motion detection, resolution of the camera), test in under different circumstances (indoor, outdoor, night and day) and build a proper housing for the surveillance camera.

It doesn’t look pretty but the surveillance camera works great.

Building a robot cart (Experiment 32 of Make:Electronics) finished

In my previous post about the robot cart I described how I finished the cart and tested the circuit on the breadboard. I only had to solder the circuit to the perf board and mount the board on the cart. Simple, right. Unfortunately it wasn’t that simple. After soldering I tested the board and discovered that there was a problem. The motor would spin and when I pushed the button it would reverse as intended however it never reverted to the original direction. I replaced several components such as the 555 chip but that didn’t help. When measuring the voltage on the pins of the 555 chip I found that it worked exactly as intended. I was mystified and beginning to feel desperate but then I recalled that there was an errata page on the book Make:Electronics.  On this page I found someone describing the same problem that I had. Charles Platt the author of the book acknowledges the problem and possible solutions are offered. Searching on the internet for 555 timer relay I found a comparable schematic on cdelectronics.com. It basically adds two diodes to the schematic of the book (figure 5-98). One diode from the output of the 555 timer to the relay (to energise the coil) and a second across the coil.

The result of this experiment. A finished, although somewhat improvised, robot cart. The electronics work great but the cart is susceptible to failure due to the alligator clips. It also runs way to fast damaging the switches while running into a wall.

I added the two diodes to my board and tested it. I found that it works on 6V DC but barely. Due to the voltage drop on the first diode just 3.8V remains over the coil, just enough to energise it (for this specific relay: SRC-S-06VDC). If the battery voltage drops below 6V the coil is no longer energised. I therefore decided to use 9V DC block battery instead of 6V. This should provide a wide margin for operation without damaging the relay.

NOTE: I found that other people such as +Virgil Machine were having good results with just a diode across the coil. Here is a link to his blog page. That didn’t work for me possibly to due the relay that I use.

Next I’ll mounted the perf board (I used the handy half-size perma protoboard from Adafruit for this which I picked up for 4.95 euro) and the battery on the cart. I connected the the motor, battery and switches to the perf board. Then it was time to test the cart. The first test went miserably because the cart didn’t react to the switches. I then connected my bench power supply to the cart and it worked fine. I figured that the capacity of one block battery is insufficient to power the cart. I solved this by placing two block batteries in parallel which doubles the capacity of the power source.

Testing the nearly finished cart with two block batteries in parallel. The block batteries are connected with alligator clips. The higher capacity was needed to power the circuit and the motor (which is very power hungry).

With the power problem solved I made the last additions to the cart. I added an on/off switch and a glued a piece of plywood with velcro on it to the back of the cart. I attached the two block batteries to the velcro. Lastly I glued rubber to the front wheel to get more grip.

While testing the cart I noted that it runs way to fast. I already damaged a sensor when cart hit a closet. Also the alligator clips come loose when the cart hits something. Nevertheless I feel I have nearly completed this experiment. I’ll probably replace the motor for one with lower RPM (and a less power hungry one).

The perf board attached to the top of the cart with two bolts and nuts. Note the two diode are added to the circuit.
It doesn’t look pretty with all those wires but it works. The batteries are attached to the cart with velcro.
Side view of the robot cart. A piece of plywood is added to the back of the cart to accommodate the batteries. I glued rubber to the front wheel of the cart to increase traction.
The other side of the finished robot cart.