Welcome to Peter Armstrong's ScanCam Home Page

From this... To This... 

A roll-your-own wide-field high-resolution CCD imager for the Sun and Moon.

So What's a ScanCam?

ScanCam is a home made linear CCD camera made from parts of a commercial hand scanner. It was repackaged for mounting on the telescope, and modified to include a simple timing circuit to trigger line scans at a constant rate. The camera is mounted on the telescope so that the CCD records a line of pixels in declination. Earth's rotation supplies the RA dimension. Since Earth rotates at roughly 15 degrees per hour, the Moon which is about 0.5 degrees, takes two minutes to scan when on the celestial equator, and somewhat longer at its extreme northern and southern excursions.

For scopes without a clock drive, or for Alt-Az mounted scopes, not to worry. Exposures are taken with the scope in a fixed position, and the object's image is allowed to drift past the CCD.

Construction is easier than you might think, and your results will be well worth the effort. Total cost for my ScanCam was about $210 including the scanner. With the cost of scanners falling, you should be able to build a monochrome camera for about $100, and a color one for about $150.

Any Twain compliant application such as Aldus PhotoStyler 2.0 SE, boundled with many scanners, can be used to acquire and process your images.

Field of view is about one inch at the focal plane. You can image the entire Moon if your focal length is less than 100 inches, or you can make multiple scans and stitch them together.

Sensitivity is about the same as many real-time CCD cameras. The first quarter Moon records well at f:31. Don't expect to record faint stars or nebulae. Exposure time for each line is quite short: around 5 to 10 milliseconds.

Image resolution is adjustable from 413 pixels at 100 dpi, to 3300 pixels at 800 dpi, in 8-bit greyscale, 24-bit color, and other modes.

I will be adding further images and information to this page as time permits. Hopefully I will be able to include all the information a person with modest electronic skills will need for successful construction and operation.

Anyone building a ScanCam is encouraged to submit your best images, and I'll include them here for the world to see. This information is freely shared in the sincere hope that it will encourage others to build their own ScanCam, and enjoy the benefits of wide-field high-resolution lunar and solar imaging.

Some ScanCam Images

These images are in JPEG format because GIFs would require excessive download time and they don't support 24-bit color. JPEG images are never as good as the originals but the artifacts are hard to detect.

If your browser doesn't support JPEG, load them to disk and use a JPEG viewer.

These images will probably look awful if your viewer or display adapter doesn't support 24-bit (16M) color. 

1st quarter Moon - Greyscale (188K)
Celestron-14 prime focus with 5" off-axis stop (~f:30)

This red-channel image shows more detail than the color one below. Isolating one channel reduces the effects of chromatic abbaration caused by atmospheric refraction. 

1st quarter Moon - 24 bit color at half scale (60K)

Celestron-14 prime focus with 5" off-axis stop (f:31)

Although the Moon doesn't exhibit much color, recording all three channels (RGB) allows subsequent separation into red, green, and blue. Certain detail shows up better in some channels than others. 

1st quarter Moon terminator - 24 bit color (130K)

Celestron-14 prime focus (f:11)

This image shows more shadow detail at the terminator, while allowing brightly illuminated areas to saturate. Note the chromatic aberration caused by atmospheric refraction. Some of the color in the highlight areas is an artifact of the way some channels saturate before the others. 

/Near Full Moon - 24-bit color at half scale (107K)

Celestron-14 prime focus with 4" off-axis stop (~f:39)

Stitch of two scans taken on May 31, 1996 in 24-bit color mode at 200 dpi. Slightly 'stretched' to increase contrast. 

Selecting a scanner

While I have experience with only the Envisions ENVColor hand scanner, I believe they are all very similar. Make sure the scanner is capable of true 8-bit greyscale at full resolution, as opposed to being dithered or interpolated. Most scan an area about 4.13 inches wide, and support a number of resolutions, from 100 dpi to 800 dpi. This translates to a total of 413 to 3300 pixels. The choice of color or monochrome is unimportant unless you really need color. Monochrome versions may be slightly more sensitive and with lower noise. Some scanners, such as the ENVColor, require a controller and a ISA slot in your PC. Others, usually monochrome versions, connect via a printer port. The cable is relatively short, about 5 feet. Printer port models may be able to be extended. Make sure the scanner includes Twain compliant drivers, so that you can use any of the newer image processing programs.

When you receive your scanner, make sure that it works perfectly as a scanner. Scan a black-and-white photograph and verify that it records shadow detail. If a color model, use 16M color mode, and make sure that the result is shades of grey with very little color. This insures that the three color channels are tracking each other. Next, scan a white piece of paper at both the minimum and maximum 'lightness' settings. Verify that there are no bad pixels, which will appear as light or dark streaks in the direction of travel. At the minimum setting, the result should be a uniform shade of grey, and not some shade of puke. There should be no variation from side to side. Finally, scan something very black and verify that the result is very dark grey with a just a little noise present. A viewer with a histogram function should show most of the pixels at a low but non-zero value. A poorly adjusted scanner may not record shadow detail properly.

If any of these tests fail, return the scanner for a replacement. Once you disassemble it, you are on your own.

Repackaging the scanner

The ENVColor hand scanner, and I suspect most others as well, are comprised of 4 small circuit boards, interconnected with short ribbon cables. One which you won't need is the power supply for the lamp. Another is a small board that holds the CCD itself. The goal is to mount these boards such that the CCD faces the image. I used a 3.5 by 6 by 1 inch plastic box from Radio Shack, on which I cemented an old T-ring for attachment to the telescope.

The three boards, not counting the power supply, can be removed from the scanner shell, leaving the ribbon cables intact. Protect the CCD from dirt and scratches by wrapping its board with lens tissue secured by a rubber band. Room light will not damage the CCD, but prolonged exposure to direct sunlight might damage the dyes used for the color filters.

Mounting the boards in an enclosure is an easy task unless you require the most compact design. I found that I could use a smaller box if I moved some of the electronic components to the other side of the boards. In particular there is a voltage regulator, which if remounted, allows the boards to be mounted in a small space with their controls accessible. Observe polarity when moving capacitors and wear a grounding strap to avoid static discharges.

All hand scanners have some means of sensing movement across the subject. The ENVColor scanner uses a roller which rotates a perforated wheel through an elaborate gear train. The rotating wheel interrupts light from a LED shining on a photodetector at a rate of 400 per inch of travel. Since the roller won't work on your telescope, a substitute must be found. The LED and detector (labeled PH1 on the board) should be removed, leaving its pads available for connection to the timing circuit which you must build. Only 3 connections between the scanner electronics and your timing circuit are needed. They are +12 volt power, Ground, and the timing output

Calculating the optimum scan frequency

The purpose of the timing circuit is to trigger line scans at a constant rate. The required scan frequency is a function of the telescope's focal length and the declination at which it is pointed. The frequency doesn't have to be very accurate since most image processing applications allow adjusting the aspect ratio. It should however be very stable and repeatable. In general, an object on the celestial equator which drifts westward at 15 degrees per hour, should be scanned at a rate proportional to its image size. For example, the Moon subtends an angle of about 0.5 degrees in the sky, and takes 120 sceonds to completely drift past the CCD. If your focal length is such that the Moon covers 2000 of the 3300 pixels, then you need to trigger 2000 scans during the 120 seconds exposure. This works out to 2000/120 seconds, or 16.67 scans per second. The scanner triggers on both the rising and falling edge of the trigger waveform, so the required frequency is half the scan rate. A reasonable approximation for a 1:1 aspect ratio for objects on the celestial equator is: frequency (in Hz) = 0.120 * focal_length (in inches).

For non-zero declinations, multiply the scan frequency by the cosine of the declination. Ignoring declination results in a worst case error of about 13 percent. Images will appear somewhat stretched in the RA direction. Use your image processing software to correct for this by scaling the appropriate dimension.

A nice feature of the scanner is that the scan frequency is independent of the dpi (dots per inch) setting, so you can change the resolution without having to also change the scan frequency.

There is, however, a maximum scan rate based on the dpi setting that you can use which limits the maximum useful focal length to about 300 inches at 800 dpi. At 100 dpi, you should be able to use up to 8 times this limit. The start scan button includes a LED which remains on for the duration of the scan. If you exceed the maximum scan rate, this LED will flash or go out entirely. This indicates the scanner's inability to operate at the selected rate.

Here is a table listing optimum scan frequency as a function of focal length. Select the next higher available frequencies with the rotary switches.

The Timing Circuit

The timing circuit must generate a TTL level square-wave with a 50% duty cycle at a rate appropriate for the focal length of your telescope. There are many ways to implement this circuit. I chose to use an IC which includes a 60 KHz crystal oscillator and counters to divide the crystal frequency by a factor determined by the coding on its 6 input pins. I used two small octal-encoded rotary switches to provide 3 of these inputs each. With this I can dial in any of several output frequencies as shown in this table. Only 8 components are required to implement this circuit.

I chose not to tap the +5 volts on the scanner. Instead I included a separate +5 volt regulator (Q1) supplied by +12 volts. The controller supplies +12 volt power when you are ready to scan. I found that the start scan button could be permanently in the pressed state, allowing the exposure to be controlled entirely by the software. Pressing a button on the camera could cause vibrations which would be apparent in the image as serrated edges.

The scanner's original photodetector (PH1) operated as an emitter follower, ie. it sources current. Since TTL cannot source much current, a pull-up resistor (R1) is needed. R2 and LED1 are optional and merely provide a visual indication that the circuit is functioning. It flashes at the selected output frequency. Drivers for hand scanners require you to wait up to a minute for the lamp to 'warm up' before the scan begins. It appears that this wait is still useful, as it also allows the CCD to warm up. CCDs are very temperature sensative and without this waiting period, the effects are noticable as gradually increasing background noise.

A prototyping board (Radio Shack P/N 276-150) holds all of the components on one side and which are soldered on the other side. Three wires connect to the scanner bottom board and two others are from the rear panel mounted LED.

Here is the Schematic and Parts List and the layout of the timing circuit.

Information from Digi-Key's catalog for the Epson America SPG-8651 Crystal oscillator.

Connecting the timing circuit to the scanner

Before connecting to the scanner, you should test the circuit. Set SW1 to position 4 and SW2 to position 6 and touch the +12V wire and the Gnd wires to the + and - terminals respectively of a standard 9 volt battery (9 volts is enough). The LED should flash once per second. If it doesn't start flashing immediately, you have likely made a wiring error. Check all connections for shorts, opens, or improper polarity. Power for the camera is derived from your PC, and controlled by the controller. Inadvertent shorts can damage the controller, or worse, your PC.

When you remove the optical encoder marked PH1, you will have four vacant pads. Connect the output from the timing circuit to the pad shown in the photos. Likewise when you remove the four pin header that used to supply +12 volts to the lamp power supply, you will be left with two +12V and two Ground pads. They are also shown in the photos.

Choosing a resolution

There are several considerations to keep in mind when you select the resolution. There is little sense in using a much higher resolution than your telescope can provide. To achieve 3300 pixels (800 dpi setting), your optics must be perfectly aligned, and the seeing must be excellent. The only reason I can think of for choosing a higher resolution than the image warrants would be to improve the signal-to-noise ratio. When you then scale the image back down to a reasonable size, the image processing software averages several adjacent pixels to determine the resulting pixel's value. Averaging in this way reduces random noise in the same way that image co-addition with 'sandwiched' negatives reduces the effects of film grain.

The higher the resolution, the larger your image files will be. For example, at 100 dpi a 400 by 400 pixel image requires only 16K bytes for greyscale and 48K bytes for 24-bit color images. On the other hand at 800 dpi, corresponding to 3300 by 3300 pixels, greyscale images will require 10.9 megabytes, and 24-bit color images will need nearly 33 megabytes each.

Focusing the camera

Focusing any type of camera presents its problems. With SLR film cameras, you have a focusing screen, and even most CCD cameras have a focus mode. ScanCam has neither. Other than trial and error, one solution is to focus on something the hard way, and then par focus a high power eyepiece with cross-hairs, such as those used for guiding. Once calibrated, you can focus with the eyepiece, and then substitute the camera. I believe there are commercial beam splitter and flip-mirror devices intended for this purpose.

The most sensitive test of focus is to maximize the brightness of stars. Scan a dense star field and focus not for minimum star size, but for maximum brightness. As you approach best focus, you will see more and more of the fainter stars appear.

If you need to reduce your aperture to control exposure, focus at full aperture. Any residual focusing errors are then minimized when you stop down.

Photos of my ScanCam -- Inside and Out

These photos apply to the Envisions ENVColor hand scanner only.

Here is a look at my prototype camera Before GIF or 24-bit JPEG , During GIF or 24-bit JPEG , and After GIF or 24-bit JPEG modification.

The JPEG versions are better if your system supports 24-bit color. 

See my article in the Summer issue of CCD Astronomy magazine.

The ideas and opinions expressed on these pages are my own and not necessarily those of McDATA Corporation.
Comments, suggestions, and inquiries are welcome at petera@mcdata.com

Last Updated: June 16, 1996