Capturing Deep Sky Images with a Modded Webcam on a Mac

Introduction

Steve Chambers developed a hardware circuitry modification for webcams that allows them to take exposures of arbirtary duration, thereby bringing webcams to the world of astrophotography. I offer a detailed explanation of how I have performed the mod on two webcams elsewhere on my website. There is a fundamental challenge after the mod is completed however. The camera will no longer work with the large number of off-the-shelf and readily available webcam programs, or if the mod is performed in a certain way, the camera can be reverted to normal operation via a switch for use with normal software but will still not take long exposures in that mode of course.

The short answer here is that there is software for PCs that "works with" modded webcams, while this is mostly not the case for Macs. I am purposefully vague here, putting "works with" in quotes and using the phrase "mostly not the case", because the true story is quite a bit more complicated and requires a deeper understanding of what is going on between the user, the computer, and the webcam.

The Pieces

Taking pictures with an SC modded camera requires two pieces of hardware, either one or two connections, and either one or two pieces of software (the software can be bundled into a single program however). All six are:

  • Hardware: Computer
  • Hardware: SC modded webcam
  • Connection: USB connection
  • Optional Connection: Modded camera circuitry control
  • Software: Image capture
  • Optional Software: Modded camera circuitry control

The Connections

The first connection is the USB connection overwhich the computer configures standard webcam settings such as framerate and gain, and over which the camera will transmit images back to the computer. This isn't changed by the mod, and so works in the usual manner (but the nature of the images that arrive changes, and therefore works best with special image capture software as opposed to standard webcam software).

The other connection you need is some way to control the modded circuitry on the camera. On an SC1 camera you need one switch to start and stop exposures. On an SC1.5 camera you need two, the previous switch and another one to turn the amp on and off. For an SC2 camera you would need three, one for the amp and two for starting and stopping each of the interlaced exposures. As will be explained below, these connections can be computer controlled or can be human controlled.

These switches can be controlled in many possible ways. PC users use a parallel port and special software such as K3CCDTools that properly toggles the switches on the parallel port.

Macs don't have parallel ports. Rats.

In my original mod (described on my website here), I used physical switches to control the exposure. I actually flipped a switch (push-button actually) to start an exposure and flipped it again to end the exposure. In theory, this could have worked with the amp-off mod as well, but would have required a more complicated thumbing of switches in the proper order to successfully control the camera. I worked this way (SC1 without the amp-off mod) quite happily for a year before making a new computer controlled mod that controls the circuitry from my Mac and controls an amp-off mod as well.

It is possible, in theory, to do the same thing with a serial port as with a parallel port. There are some problems however. First off, the way the parallel port mod works is by using multiple various pins of the parallel port as independent switches. Serial ports don't provide as many lines as a parallel port (and the lines that are available aren't really meant to be used in this way at all), but they provide at least one and possibly two lines, which is all you need for SC1 or SC1.5. I have experimented with using serial port lines and they work well. My software, described below, allows this method of control if you want it. It is probably the best method for using SC cameras on a Mac at the time of this writing.

My solution was more elegant that hijacking archaic lines on a serial port that were never intended for such use in the first place, but it is also expensive and eccentric, in that it uses a rare piece of extra hardware that goes way beyond the call of mere switches, and I don't recommend it because of the cost. I happened to have already owned a Pontech SV203 serial controlled servo controller board ($60) that I used for robotics projects, such as my Visorbot. This board can be reconfigured so that instead of sending modulated servo signals to its servo control pins it instead sends a constant high or low voltage, which is the same thing as a switch in essence.

So that's how I do it. All I had to buy was a USB serial converter for the board since my Mac doesn't have a serial port (which you would need for the raw serial port method as well of course, assuming your Mac doesn't have a serial port), so the additional cost of my method is $60 plus a cheap $2 battery pack from Radio Shack, plus an obligatory USB serial converter, and all of that that buys you a really fancy little board that you can do lots of neat projects with if you so choose. It is total overkill for a few switches however.

The Software

So that's the physics of the control. To recap, I used two methods. One was a set of physical switches and the other was the SV203 board (and bear in mind that I have made serial line control work as well). There are two other crucial parts though, both software related. The first is that you must have a program that can actually control the camera's modified circuitry lines, whether parallel port, serial port, or my strange servo board method (of course you don't need any software if you do it with physical switches instead, which is why I did it that way for a year when I first got started).

I have of course written software that is keyed to my servo controller board method. I have also written publically available software that uses serial port DTR, RTS, and HSKo lines for control. This program, Keith's AstroImager, can be downloaded for your own use.

Then there is the last part of the whole operation, the other piece of software mentioned above, a program that can catch the long exposures being sent from the camera and save them. Keith's AstroImager serves this purpose as well as offering exposure control. It is interesting how capturing the long exposures works. The camera apparantly sends frames at the framerate you choose in the settings dialog for the quicktime capture device regardless of the long exposure mod. In other words, I set my settings to 5 frames per second, and by God I get a frame every fifth of a second, nonstop, all night long (which isn't to say that I save all that data to disk for several hours straight, keep reading). Between long exposures, the camera operates normally, and the 5 fps image is a realtime 1/5 second exposure 5 fps stream of images, good for focusing on bright stars and such. During a long exposure, the images arriving from the camera are functionally blank (they aren't truly black for some strange reason). Then, when an exposure ends, regardless of the method of circuit control, one bright image is received by the computer from the camera, followed immediately by a stream of 1/5 second 5 fps images until the next exposure is begun.

So my software does a nice little trick. It detects the blank exposures as being too dark to be interesting and ignores them as they roll in constantly. When a really bright image arrives, it is detected on the basis of its brightness and is saved to disk. That's it.

Now you can understand my statement early on that PCs "work with" the camera. Such software doesn't merely control the modded circuitry, or merely capture the long exposures, but must do both of these things, and must do both of them exactly right.

Each Method in Detail

So, which method will work best for you? In order to answer this question you must figure out how to resolve all of the issues raised so far. In short, you need a way to control the modded circuitry and you need a way to save the long exposures. I will list the possible solutions in the approximate order of increasing complexity and/or cost.

Method 1

The first and simplest way is to perform only an SC1 mod to your camera, requiring only one switch for the exposure and no other switches. This switch is wired to a physical switch which you toggle by pushing a button or flipping a toggle. This is really quite simple and a detailed description is available on my website. This settles the control of the camera.

You must then capture the images from the camera. You can do this with off-the-shelf webcam software as a matter of fact. Here's how it works. You would load the webcam software so that it is receiving the stream of frames from the camera. You would go ahead and set it to 5 fps in the webcam settings for the software. You start using your physical switch to start and stop long exposures. Right before you finish a given exposure you would turn on the software's movie-capture feature, which captures frames to disk at the framerate chosen. After you end the exposure you would then stop the movie-capture. So for each long exposure you capture a short movie to disk of a second or two surrounding the moment of the end of the long exposure. This movie would consist of a stream of dark frames, then one bright frame, then a stream of dark frames again. You could then, at a later time, pull the desired single bright frames out of the movies, save them elsewhere, and throw away the movie files. My image stacking program, Keith's Image Stacker can do this.

Method 2

Similar to method 1 but with amp-off control. Just use two physcal switches. Turn the amp off before starting an exposure, then start the exposure a second later. To finish the exposure, turn the amp back on and then end the exposure a second later. Kind of tricky, but otherwise the same as method 1.

Method 3

Buy a USB serial converter (if your computer doesn't have a serial port), and plug the control wires for the camera into a serial plug (by plug I mean solder together a serial plug that will plug into your computer and then feed into the camera). Then download either Keith's AstroImager or EquinoX. I have never used Equinox. Frankly, I recommend my program since I am more familiar with it. Additionally, as of this writing, it looks from the description like Equinox only provides one line of control through the serial port and therefore is only useful for SC1 cameras, whereas my program offers two lines of control for SC1 or SC1.5 cameras.

Method 4

Use physical switches, as in methods 1 and/or 2, but write your own software to capture and save long exposure images while discarding the junk images. Alternatively, try to talk me into writing it for you. Yeah, good luck. Actually, my program would already work for this, if you choose to go this route. You would simply not use the camerra control functions of the program and set it to automatically detect bright long exposures and save them and ignore other dim exposures.

Method 5

Buy a USB serial converter (if your computer doesn't have a serial port), and make a serial plug, same as in method 3. Then write your own serial port software that toggles the serial pins to control the camera. Why bother, since my program already exists and works pretty well, but if you like to hack, go for it.

Capture images the way as method 1.

Method 6

Mix methods 4 and 5, writing software for both serial control and image capture.

Method 7

Buy a Pontech SV203 Servo Controller board and a USB serial converter (if your computer doesn't have a serial port). I will guide you through hooking up your modded camera to the SV203 and will happily give you my control/capture software. It is however not the most beautiful piece of software in the world (this program is different from AstroImager which is oriented toward the public and has an easier interface as a result). I have never felt the need to make my SV203 program extremely user-friendly as it has a user-base of 1, me, at the present time, but I would be willing to try to help you figure it out. If you go this route, be aware that I offer no guarantee that any of this will work until you try it. I know, that makes it a rather undesirable option, but it's expensive anyway, so I doubt anyone will be attempting this in the first place.