Project Objective SharpSky parts list
SharpSky - telescope focuser
The objective of the SharpSky focuser project was to design and build an ASCOM compliant low cost absolute focuser with a manual scope side control option. The design should be simple in construction and lightweight.

The focuser will be attached to my direct cooled Canon 450D

Cooled 450D project link
SharpSky Software Hardware Considerations Project key features Schematic
Dave Trewren   28/6/2011
-  Low cost
-  Simple construction based around an
   off the shelf PIC micro
-  Bootloader for simple firmware upgrade
-  ASCOM compliant
-  Absolute positioning
-  USB connectivity
-  Manual scope side focus control
-  Variable manual rate
-  Stepper motor mechanical drive
-  PIC micro development card (China) £12
-  PIC18F4455 (or similar)                    £5
-  Volt regulator 7805                            £1.50
-  Stepper motor (China)                       £5
-  Rotary encoder (optional)                  £3
-  ULN2003A Darlington driver              £1.50
-  Main case                                         £2.50
-  Shaft beam coupler (China)               £5
-  Manual focus case (optional)             £2
-  Connectors, passives & misc            £8

Total excluding optional   £40.50
Total including optional    £45.50

You could make it cheaper by not using the development card and building the controller on vero board but I don't think there would be much in the price.  My most valuable component is time, the PIC development card cuts the build time to just a couple of hours.  I used a few quite expensive connectors which could be dispensed with if you wanted to hardwire connections.  I'm sure you could get the price down to around £30 without too much effort. I did source the PIC development board and motor from China via ebay.  I like the Chinese; they are very competitive on price and also very helpful and professional. Things may take a few more days to arrive but I personally have never had a single issue with anything I have purchased. If anyone would like the source of any of the items please email me and I will pass on the details - not via the forum as this may be viewed as advertising.
Initially I had decided to write a PC GUI.  I was planning on using the Visual Studio C# IDE.  Then I had a change of mind. I thought there is a lot of focus control software about, some very simple and some sophisticated providing autofocus functionality - why reinvent the wheel.  So at that point I decided to write an ASCOM compliant driver as an interface between third party software and my hardware solution.  If subsequently I do write my own GUI it will interface via the ASCOM driver.  The ASCOM driver uses the C# template and a USB HID class library.  I donít claim to have written the HID code, it came from the internet - unfortunately, I canít remember where I sourced it from - was a while ago.

The PIC code is written in C and uses the Microchip 18F family compiler.  The PIC18F4455 is also running the Microchip USB stack.  It is my intention to make all software open source.
I expect some may be wondering why I used the PIC18F4455 ?  The answer is simple - I had some knocking about.  I bought a few very cheap (~£3/pp) from a company on ebay that were selling off surplus stock.  The development card was a simple solution and the same price irrespective of the target PIC and size. Also the PIC18F4455 has loads of I/O so future proofs the project.  If I decide to control other things, ie heaters etc there will be no issue with port shortage.  There are several other smaller cheaper 18F family parts that have the USB embedded controller that one could use instead.

The PIC development card voltage regulator was a small TO92 type, not really designed for a motor.  It would have done the job with the little motor I used but for a larger motor might have struggled.  So to allow for a larger motor and to keep motor noise away from the PIC I dropped in a larger 7805 regulator.

The motor is a four phase permanent magnet motor and utilises a ULN2003A Darlington driver.

The PIC was programmed using the PICKit3 programmer/debugger also sourced from China. I have found this excellent and totally reliable - no issues to report.
I have included a schematic for the design.  The beauty of PIC design is that it is so simple.  Just connect power, a crystal, a few passives and you have a platform that can do anything you want.  Note on the schematic I have used a 4MHz crystal.  The embedded USB controller runs at 48MHz, the processor can run at another frequency if you want.  The PIC has an onboard PLL to generate the USB & processor clocks and is setup via a software header.  If you have a crystal of say 20MHz the header will require a modification to change the PLL configuration.  I hope the schematic is accurate, checked it several times. If anyone spots an error please let me know.

Right click to download schematic
SharpSky video demonstration
The following video demonstration shows the operation of the SharpSky focuser both in manual and under PC control. The demonstration is taken before the focuser was fitted to the telescope for ease of access.  A further video will show telescope fitting and subsequent operation.
Copyright © 2011 by Dave Trewren  ∑  All Rights reserved  ∑  E-Mail:
SharpSky video demonstration - initial scope fit
The following video demonstration shows the operation of the SharpSky focuser after the initial fit to the Crayford scope focuser.  I decided to make a short video at this stage mainly to show the operation of the beam coupler.  I received this on the day of making the video and had no issue connecting the motor and focuser shaft.  The beam coupler is very effective and allows the drive to operate very smoothly with vitually no vibration.
SharpSky PIC microcontroller C source code.  Compiler used - MicroChip MCC18.
MCHPUSB is the PC bootloader driver & pc_bootloader is the actual PC bootloader application.
ASCOM compliant driver executable.
SharpSky video motor assembly
This short video shows the motor assembly prior to the scope fit.
SharpSky video motor assembly
This short video shows the finshed design fitted to a Skywatcher 80ED Pro.
ASCOM_driver executable
Rotary encoder PDF
SharpSky PIC bootloader demonstration
This video shows the operation of the PIC onboard bootloader and demonstrates how the firmware can be reprogrammed without the need for a dedicated PIC programmer. Bootloader mode is invoked by pressing the manual focus control rate change switch during power up. Fifteen rapid LED flashes indicate bootloader mode. The PC USB bootloader application can then be used to reflash the PIC application. Following a power cycle the new application will execute automatically.
PIC Prototype board
The following images show the project PIC prototype board build states. The first image is the finished control board with connection overlay. The second image shows the 12v motor version. The third image shows the control board (5v version) installed in the case essentially complete.
LED connections
Rotary encoder connections
Modifications for 12v motor operation

The following image shows the modification/simplification required to produce a focuser that uses the 12v version of the stepper motor.  I had difficulty sourcing the 12v motor initially, hence going with the 5v motor but have now found a reliable Chinese source. The advantage of the 12v motor is that it generates quite a bit more torque.  From the diagram you can see the 7805 voltage regulator and decoupling capacitor are omitted and the 12v power is connected directly to the Darlington driver.