When I started doing DSLR astrophotography, I quickly found that the on-camera limitation of 30sec exposures was frustrating. So, bulb exposures are necessary. At the time, nothing existed to easily interface my Nikon D70 camera to a computer (the Nikon requires an IR cable release, which is a more daunting task than the stereo-jack connection required by Canon cameras).

So, I decided to build my own. I built the circuit that has come to be known as “The Gizmo” around a PIC 16F684 microcontroller. This little gem is an absolutely wonderful and powerful chip that has done everything I’ve asked of it and more (I also made a Sony-IR-to-Panasonic-IR code translator, to fake my Sony Tivo into recording to my Panasonic DVD-R burner, but that’s another show). For really tiny applications, its little brother, the PIC 12F675 is equally wonderful in every way.

The Gizmo went into semi-retirement when I moved away from the concept of being highly portable and settled into observatory life, with easy access to 110v and a laptop.

There has been a tool missing in my astronomy toolkit for years, though. To do polar alignment, I use a routine that requires me to sit in the dark being eaten by mosquitoes, holding down the “west” button for several boring minutes, followed by holding down the “east” button for several more boring minutes.

I always figured there was a way to automate this, but as nice as The Gizmo is, it was my first major project, and was not really constructed in a way that allows easy modification. sigh. So my polar alignment tool concept has been on the shelf for several years.

Enter the Arduino.

In the past few years, microcontroller tech (and microcontroller support on the ‘net) has grown considerably. In particular, some folks on the net decided to make an open-source development board around a microcontroller, and tie that to a very nice C-like language IDE that turns microcontroller programming from a chore into a dream. The Arduino is the result of this effort. It’s built around an ATmega 328 microcontroller (sorry, PIC), and is programmable in C or C++. Best of all, there are lots and lots of people using the board, and sharing their “libraries” with the user community, so almost any electronic gadget you can think of (ethernet, GPS, stepper motors, and Wii Nunchuck, to name a few) can be hooked up to the board and accessed very easily.

My mind whirled with ideas — what new wonders could I build with the Arduino? I thrashed around for awhile; there’s a only-partly-started helium blimp project that’s on the shelf, any number of BLFNAR (blinky light for no apparent reason) concepts that I’ve thought about and discarded, and then I remembered my old polar alignment routine, and The Gizmo 2.0 was conceived.

Given another chance to create a user input device, I have given myself the opportunity to re-think some of the concepts from Gizmo 1.0:
Stays in:
– LCD output — there’s nothing like actual text to get your point across. The LCD was one of the best pieces of the original gizmo
– 12v power allowed — taking the same voltage as everything else in the observatory makes for easy power options
– different exposure lengths — ’nuff said

Left out:
– hardcoded proprietary camera control — the D70 IR circuit is already written. I can easily mod it to take a single high/low logic level to trigger the shutter, and thus be able to swap out the Nikon for a Canon just by changing the cable.
– matrix keypad — I found that I never really used most of the keys, and it was a lot of work and debouncing and decoding in a package that required a lot of physical space in the project box, for something that wasn’t as useful as I’d hoped.

New features:
– ST-4 port control — to do the polar alignment routine, I have to figure out how to access the ST-4 port on the mount.

– Canon camera control — I intend to make this very modular, and allow the same command from The Gizmo to fire either a Canon or Nikon camera
– time-lapse control — I’d love to be able to do timelapse, and it’s a very simple option to add, I just never did it on the original Gizmo.
– some kind of “see it in the dark” option — the backlight never worked on The Gizmo 1.0 (a sad and long story), so I always had to wield a flashlight to see how things were going.

I’ve spent the last couple of days breadboarding and learning about the Arduino to get this project up and running. I have to say that for the most part, the Arduino “gets out of the way” and lets me just build the circuit how I want, and modify it as necessary to get the job done. The programming is dead simple.

For instance, I decided that, since I never use values other than full minutes (occasionally half-minutes), I should be able to use a knob to set the exposure time. A potentiometer (variable resistor) is read by the Arduino as an analog voltage between 0 and 5v. This gets translated (automatically) into a range 0-1023 (10-bit ADC for the geeks). Translating that reading into “1 to 20 minutes with 30 second intervals” takes?

Three lines of code.

int exposureLength = analogRead( potExposureLengthPin ); // read the pot value and convert to range 0-1023
exposureLength = map( exposureLength, 0, 1023, 2, 40 );   // map the reading onto the 38 discrete steps needed
exposureLength *= 30; // scale up to seconds

Wow.

The toughest coding challenge I’ve had so far is refactoring my LCD code from PIC over to Arduino. It would have gone in with essentially no code changes at all (original was written in C), but I decided to implement a similar interface to the other LCD libraries that are out there already for Arduino, so I had to rename a few functions to match.

In just a few days, I have a working beta version of the new Gizmo sitting on the breadboard. I can control the mount through the ST-4 port, exposure length setting via the pot (output to the LCD of course). I need to add camera control, and I’m ready to solder it together.

What a great project! I’m looking forward to adding more Arduino gadgets to the observatory!

Photos to follow.

Leave a Reply

Your email address will not be published. Required fields are marked *