Saturday, April 3, 2010

Converting an EyeClops Bionic Eye to a Workbench Magnifier

I had wanted to build myself an electronic magnifier for quite some time. An opportunity arrived when a very good friend introduced me to the EyeClops Bionic Eye: an inexpensive electronic toy microscope designed for kids.

Figure 1: A fully converted EyeClops Bionic Eye

The Bionic Eye has optical elements capable of magnifying objects a hundred times or more. Images are captured by a CCD sensor and then converted by on-board electronics to a video stream accessible through a video cable which can be plugged into a TV or a computer equipped with a video capture device. It is a neat little toy but its being a hand held device with high magnification lenses means that it must be placed very close to the subject and that staying focus is very difficult to achieve.

I picked up a multi-zoom Bionic Eye from a local discount store for about $20. After playing with it for a while and taking it apart, I was convinced that it would serve a better purpose being a workbench magnifier i.e. a much less capable microscope that does not need to be glued to the subject being examined. All I thought I needed to do was to replace the existing optics with a suitable lens and focus directly on the CCD sensor. Well, I was almost right.

I went with my Canon EF (35-105mm) lens mostly because it had been left untouched for many years thanks to the popularity of digital cameras. However, the use of bayonet mount in all EF lenses makes re-purposing such a lens difficult: there are no known and inexpensive ways to mount an EF lens in a custom project.

Figure 2: My EF lens mount to a macro extension tube

After some intense online searches, I came across the inexpensive (around $10 a piece) macro extension tubes. A macro extension tube contains no optical elements but has a bayonet mount on one end to attach to an EF lens and another bayonet mount on the other end to attach to the camera body; it is designed to move the lens further away from the camera body thereby allowing the camera to move closer to the subject. Using a macro extension tube provided housing for the small CCD circuit board from the Bionic Eye. To seal off the other end of the tube so as to provide a mounting surface for the CCD circuit, I used a (~56 mm wide) cap from a CVS pill bottle. The cap had 6 square bulges along its inner edge. These bulges were in the correct positions but were a bit too tall to fully engage the bayonet mount on the camera side of the extension tube. Trimming them down a bit carefully with a DREAMEL allowed the cap to screw on the extension tube nicely.

The rest of the design is better described in the schematics below. Since I had no access to a CAD program, I was really hoping to use Google's SketchUp to create these drawings. Unfortunately, SketchUp runs properly only on OS X and Windows and I use neither of these operating systems at home. So I decided to learn Blender and use it to model the key components instead. It wasn't an easy task but I enjoyed the learning process and I think the results are quite nice. All parts displayed below are proportional and physically accurate. Shown below is the assembly that accommodates the video and power cable, line filter and CCD circuit board:

Figure 3: The video and power cable, line filter and CCD circuit assembly

Click on the image above to get an enlarged view. The parts are numbered and listed as follows:
  1. A round piece of 5/8" thick wood made with a 2" hole saw. It has a cylindrical cavity of 20 mm wide and 13 mm deep on one side and a rectangular hole of 6 mm x 3 mm on the other. It is split symmetrically into two halves to allow the video/power cable to pass through without desoldering. The cavity provides sufficient space to accommodate the line filter while the rectangular hole clamps tightly onto the cable stopper to prevent snagging.
  2. Two thin pieces of wood fillers measured 19.5 mm  x 19.2 mm x 1 mm each.
  3. 3/8" flat head wood screws. 
  4. 2" PVC fitting.
  5. 1 3/8" flat head wood screws.
  6. A round piece of 5/8" thick wood made with a 2" hole saw. It has a 20 mm wide hole through its center.
  7. A large CVS pill bottle cap with a 20 mm wide hole at its center.
  8. Camera side mount ring from the macro extension tube.
  9. A round piece of 5/8" thick wood made with a 2" hole saw and sanded to fit inside the mount ring. It has a 20 mm wide hole through its center.
  10. Original mounting bracket for the CCD circuit board from the Bionic Eye. The base of the bracket is cut and made round to fit inside the mount ring.
  11. CCD circuit board from the Bionic Eye.
  12. Original mounting screws from the Bionic Eye.
  13. A round piece of black card board with a 13 mm wide hole at its center to fit over the infrared filter attached to the CCD circuit board. It is used to prevent light from reflecting off screws and electronic components inside the extension tube.
Replacing the original optics with a Canon EF lens was a step in the right direction but not sufficient to turn the Bionic Eye into a usable workbench magnifier. The newly converted Bionic Eye still suffered from hand shake. Acquiring a steady video of a subject was difficult. Clearly, the Bionic Eye had to be mount on a stand or some sort for stabilization. For high accessibility, it would be ideal to mount the Bionic Eye on a LCD monitor arm if not because the cost of purchasing one was too high for this project. Fortunately, I had in storage a broken fluorescent desk lamp which came with a flexible arm sturdy enough to support the Bionic Eye. Once the lamp was separated from the arm, I came up with the design depicted below to secure the Bionic Eye:

Figure 4: Front view of the mount assembly for the Bionic Eye

Again, the parts are numbered and listed as follows:
  1. 4" wide hose clamp.
  2. 2" PVC tee fitting with the top half of the "T" sliced off.
  3. 3/8" flat head wood screws.
  4. Two 15 mm wide x 5 mm thick x 64 mm tall strips made from the scrap piece sliced off from the PVC tee fitting above.
  5. 76 mm long 2" PVC pipe with, on one end, an 8 mm wide hole to allow a bolt to go through and a 25 mm wide x 30 mm deep notch to accommodate the mounting post from the flexible arm.
  6. 5/16" x 4" hex bolt.
  7. 1" PVC fitting trimmed to 23 mm long with a 25 mm wide x 19 mm deep notch to accommodate the mounting post from the flexible arm.
  8. 5/16" x 1 1/2" OD fender washer.
  9. 5/16" hex nut to secure everything.
It is important to note that the PVC tee fitting (2) and the 2" PVC pipe (5) are held together securely by pure friction, thus allowing the Bionic Eye to rotate and be placed at any angle relative to its default vertical orientation. With this design, I can easily switch to use a more powerful zoom lens and place the Bionic Eye horizontally to look at distant objects, since many software applications can rotate videos on-the-fly these days. For greater clarity, a rear view of the mount assembly showing various cuts and notches is displayed below:

Figure 5: Rear view of the mount assembly for the Bionic Eye

Finally, here is an image of a DC-to-DC voltage converter circuit board captured using the fully assembled Bionic Eye:

Figure 6: A DC-to-DC voltage converter viewed under the Bionic Eye

Limited by the quality of its CCD sensor, the Bionic Eye is only able to produce low resolution videos. Regardless, it is still a fairly usable piece of equipment for examining or tinkering small electronic devices. Using a page of printed material and a caliper, I have determined the magnification of the Bionic Eye to be approximately 10x when used with a desktop computer at 1280x1024 resolution.

Wednesday, January 27, 2010

Cell Phone as a TV Remote Control

I have been reading on how people control their televisions with cell phones by playing specially prepared sound files through a pair of infrared LEDs. Each of these sound files provides a properly encoded on-off pulse sequence modulating a carrier at frequency close to the upper limit of most audio devices found in computers and hand helds. Because one of the infrared LEDs is connected in reverse, one LED lights up during the positive half cycles while the other lights up during the negative half cycles. In doing so, they effectively double the carrier frequency to that designated for remote controls making it possible for the intended receiver to decode the signal. The method is simple and elegant. And it sounds like a lot of fun to experiment with.

But as soon as I tried it out, I realized that it does not work on any devices. It worked on my desktop PC and my laptop, but it did not work on my Palm Centro cell phone. This makes reasonable sense since some portable devices just do not generate enough output at high frequencies to overcome the forward voltages the infrared LEDs require (typically 1.2V). In order to salvage my little experiment, I decided to construct a simple transistor-based infrared transmitter that plugs into my cell phone's audio jack. To be a bit more adventurous, I restricted myself to using just one infrared LED and one AA battery. The latter not only made biasing the transistors difficult but also limits the range of the transmitter to only a few meters. So this really is a proof-of-concept design. Below is the transmitter's schematic. It was designed with my collection of electronic parts in mind.


Figure 1: Infrared Transmitter Schematic


Input to this transmitter is assumed to be a pulse-width modulated sine wave oscillating at around 20 kHz. Q1 acts as a phase splitter providing an inverting and a non-inverting output signals which are then rectified by D3 and D4 and superimposed across R8. The circuit so far behaves just like a full wave rectifier and, for this reason, positive pulses at this point are appearing twice as often as in the original input signal. Finally, Q2 and Q3 perform voltage level shifting and impedance matching so as to deliver sufficient signal to the base of Q4 to actually drive the infrared LED D5. To make the transmitter as small as I technically can, I used the following PCB layout to position my components on a 5x15 perf board.


Figure 2: Printed Circuit Board


Everything is enclosed quite nicely inside a modified 2 AA battery holder that came with a small power switch. The circuit board is small enough to fit into one of the battery slots. A small hole on the front side of the battery holder exposes the infrared LED. The whole unit, when fully assembled, is shown below:


Figure 3: Finished Infrared Transmitter


Everything works as expected. So far, I have created four WAV files to control my Sony Trinitron TV which uses the SIRC protocol. Those interested in trying it out can download the WAV files, SPICE file, schematic and PCB layout below:For more information on protocols used by remote controls and instructions on how to capture infrared signals and create WAV files used in this post, please see the References section for a list of useful online resources.

References