{"id":28454103,"url":"https://github.com/jlecomte/ascom-telescope-cover-v2","last_synced_at":"2025-06-28T05:30:33.368Z","repository":{"id":257131876,"uuid":"856407178","full_name":"jlecomte/ascom-telescope-cover-v2","owner":"jlecomte","description":"Open Source ASCOM-Compatible Telescope Cover And Spectral Calibrator","archived":false,"fork":false,"pushed_at":"2025-01-15T03:57:28.000Z","size":9863,"stargazers_count":14,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-06T18:53:15.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jlecomte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-12T14:25:23.000Z","updated_at":"2025-05-04T19:59:14.000Z","dependencies_parsed_at":"2024-09-15T01:24:04.280Z","dependency_job_id":"a89987d1-4db7-42b6-a122-817a63d89f6e","html_url":"https://github.com/jlecomte/ascom-telescope-cover-v2","commit_stats":null,"previous_names":["jlecomte/ascom-telescope-cover-v2"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jlecomte/ascom-telescope-cover-v2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlecomte%2Fascom-telescope-cover-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlecomte%2Fascom-telescope-cover-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlecomte%2Fascom-telescope-cover-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlecomte%2Fascom-telescope-cover-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlecomte","download_url":"https://codeload.github.com/jlecomte/ascom-telescope-cover-v2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlecomte%2Fascom-telescope-cover-v2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262380861,"owners_count":23302110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T18:40:49.566Z","updated_at":"2025-06-28T05:30:33.361Z","avatar_url":"https://github.com/jlecomte.png","language":"C#","funding_links":["https://www.paypal.com/donate/?hosted_button_id=49UXY8F6VVYFA"],"categories":[],"sub_categories":[],"readme":"# ASCOM-Compatible Telescope Cover\n\nI do not charge anything to create and maintain these open-source projects. But if you would like to say \"thanks\" for this project, feel free to send any amount through Paypal using the button below. I appreciate your support!\n\n[![](images/donate.png)](https://www.paypal.com/donate/?hosted_button_id=49UXY8F6VVYFA)\n\n\u003c!-- toc --\u003e\n\n- [Introduction](#introduction)\n- [Finished Product](#finished-product)\n- [Demo](#demo)\n- [Pre-Requisites](#pre-requisites)\n- [Hardware / BOM](#hardware--bom)\n- [ASCOM Driver](#ascom-driver)\n  * [Downloading And Installing The Driver](#downloading-and-installing-the-driver)\n  * [Compiling The Driver (For Developers Only)](#compiling-the-driver-for-developers-only)\n- [Arduino Firmware](#arduino-firmware)\n  * [Microcontroller Compatibility](#microcontroller-compatibility)\n  * [Compiling And Uploading The Firmware](#compiling-and-uploading-the-firmware)\n  * [Calibration Procedure](#calibration-procedure)\n- [Electronic Circuit](#electronic-circuit)\n- [3D Model](#3d-model)\n- [Using With NINA](#using-with-nina)\n- [Known Issues](#known-issues)\n  * [Device Access Synchronization](#device-access-synchronization)\n- [Ideas For Improvements](#ideas-for-improvements)\n\n\u003c!-- tocstop --\u003e\n\n## Introduction\n\nThis repository contains code that allows you to build your own automated telescope cover and spectral calibrator:\n\n* The code for the ASCOM driver (Microsoft Visual Studio 2022 project)\n* The code for the Arduino firmware\n* The FreeCAD 3D model\n* The KiCad project for the electronic circuit\n\nThis project is an updated version of [my original ASCOM-compatible telescope cover](https://github.com/jlecomte/ascom-telescope-cover). It brings the following enhancements:\n\n* **Analog Position Feedback:** If you happened to power up my original ASCOM-compatible telescope cover while it was not in its closed position, it would violently close because it assumed that it was in a closed position at startup. This is now fully resolved by using a servo with analog position feedback. Note that this feedback loop needs to be calibrated once.\n* **Magnets:** The cover will be held in place (in either open or closed position) by magnets, which means that the servo can be powered off when it is not moving, thereby completely eliminating the possibility of vibrations while imaging.\n* **PCB:** This new project uses a PCB that can be manufactured by a company like [PCB Way](https://www.pcbway.com/). This means that the final product is more compact and more reliable than when using a perforated circuit board as in my original project.\n* **Spectral Calibrator:** This project includes neon bulbs that can be remotely turned on or off. This is especially useful when doing spectroscopy. **Note:** You could technically modify this project to eliminate this (if you don't need it) or replace it with an EL panel if you would like to create a motorized flat panel. I have no need for this because I have [a wireless flat panel](https://github.com/jlecomte/ascom-wireless-flat-panel) and while I do operate my equipment remotely, it is not located in a remote location (it is in my backyard, but it is nice to be able to fully control it from inside the house, or using a fully automated sequence).\n* **Better 3D Model:** This new version comes with a much improved 3D model and the final product is much sturdier than my original version. It also provides a simpler and cleaner attachment method to the OTA.\n* **Single Cable:** This new version only requires a USB type C cable connection for both power and data, whereas my original version required two cables (USB type C and 12V power)\n\n## Finished Product\n\nHere is what the finished product looks like:\n\n![Finished Product](images/Finished-Product-1.jpg)\n\n![Finished Product](images/Finished-Product-2.jpg)\n\n## Demo\n\nHere is a short demo video of the finished product, hosted on YouTube. Check it out!\n\n[![Short demo video of the finished product](images/YouTube-thumbnail.jpg)](https://www.youtube.com/watch?v=r8KIGEcJ2Xw)\n\n## Pre-Requisites\n\n* A Windows computer (Windows 10 or newer)\n* [Microsoft Visual Studio](https://visualstudio.microsoft.com/) (FYI, I used the 2022 edition...)\n* [ASCOM Platform 6](https://ascom-standards.org/)\n* [ASCOM Platform Developer Components](https://ascom-standards.org/COMDeveloper/Index.htm)\n* [Arduino IDE](https://www.arduino.cc/en/software)\n* [FreeCAD](https://www.freecadweb.org/), a free and open-source 3D parametric modeler\n* A 3D printer able to print PETG, and a slicer (I use a Bambu Lab X1C)\n* A few basic tools that any tinkerer must own, such as [a breadboard](https://www.amazon.com/dp/B07LG9V8WQ?tag=darkskygeek-20), [a soldering iron](https://www.amazon.com/dp/B08M9B4MP4?tag=darkskygeek-20), [a bench power supply](https://www.amazon.com/dp/B07GCJ5QHF?tag=darkskygeek-20), etc.\n\n## Hardware / BOM\n\n* [Seeeduino XIAO](https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html) (You can get it quicker from Amazon, but you will have to pay twice as much!)\n* [Capacitors](https://www.amazon.com/dp/B07PBQXQNQ?tag=darkskygeek-20)\n* [Resistors](https://www.amazon.com/dp/B08FD1XVL6?tag=darkskygeek-20)\n* [Diodes](https://www.amazon.com/dp/B08SBTS2KZ?tag=darkskygeek-20)\n* [FQP30N06L](https://www.amazon.com/dp/B07WHSD3GJ?tag=darkskygeek-20) (logic-level MOSFET)\n* [EL Inverter](https://www.amazon.com/dp/B08Q7CNZ7F?tag=darkskygeek-20)\n* [Neon bulbs](https://www.amazon.com/dp/B07CPY6TM5?tag=darkskygeek-20)\n* [270° servo motor with analog feedback](https://www.dfrobot.com/product-1709.html)\n* [8x2mm magnets](https://www.amazon.com/dp/B077KYBYYY?tag=darkskygeek-20)\n* [Brass inserts for 3D printed parts](https://www.amazon.com/dp/B0BDD3865B?tag=darkskygeek-20)\n* [Assortment of small metric screws, nuts, and washers](https://www.amazon.com/dp/B08JCKH31Q?tag=darkskygeek-20)\n\n## ASCOM Driver\n\n### Downloading And Installing The Driver\n\nYou can install the ASCOM driver by simply running the executable setup file that you will find in the [releases page](https://github.com/jlecomte/ascom-telescope-cover-v2/releases). By default, it places files under `C:\\Program Files (x86)\\Dark Sky Geek\\Telescope Cover V2 ASCOM Driver`.\n\n### Compiling The Driver (For Developers Only)\n\nOpen Microsoft Visual Studio as an administrator (right click on the Microsoft Visual Studio shortcut, and select \"Run as administrator\"). This is required because when building the code, by default, Microsoft Visual Studio will register the compiled COM components, and this operation requires special privileges (Note: This is something you can disable in the project settings...) Then, open the solution (`ASCOM_Driver\\TelescopeCoverV2.sln`), change the solution configuration to `Release` (in the toolbar), open the `Build` menu, and click on `Build Solution`. As long as you have properly installed all the required dependencies, the build should succeed and the ASCOM driver will be registered on your system. The binary file generated will be `ASCOM_Driver\\bin\\Release\\ASCOM.DarkSkyGeek.TelescopeCoverV2.dll`.\n\n## Arduino Firmware\n\n### Microcontroller Compatibility\n\nPretty much all Arduino-compatible boards should work. There is nothing magical about the firmware. However, this was developed for, and tested with a [Seeeduino XIAO](https://www.seeedstudio.com/Seeeduino-XIAO-Arduino-Microcontroller-SAMD21-Cortex-M0+-p-4426.html), so that is what I recommend for this project.\n\n### Compiling And Uploading The Firmware\n\n* If needed, add support for the board that you are using in your project.\n* Then, connect your board to your computer using a USB cable, open the sketch file located at `Arduino_Firmware\\Arduino_Firmware.ino`, and click on the `Upload` button in the toolbar.\n\n### Calibration Procedure\n\nThis is a one-time operation. Disconnect the right arm from the servo. Then, from the Arduino IDE, connect to the device. Using the Arduino IDE serial monitor, type `COMMAND:COVER:CALIBRATE`. This will launch the calibration procedure for the servo analog feedback. Once it has completed, re-attach the right arm to the servo. The device is now ready to be used.\n\n## Electronic Circuit\n\nHere is the KiCad schematics:\n\n![KiCad schematics](images/Schematics-kicad.png)\n\nI very strongly recommend prototyping it first, using a breadboard:\n\n![Breadboard prototype](images/Breadboard-Prototype.jpg)\n\nHere is the routed PCB in KiCad:\n\n![Routed PCB in KiCad](images/PCB-kicad.png)\n\n**Note:** You can directly use [PCBWay.zip](KiCad_Project/PCBWay.zip) to order your PCB from [PCB Way](https://www.pcbway.com/).\n\nOnce you've received your PCB and soldered all the components, it should look like the following:\n\n![Finished PCB](images/PCB.jpg)\n\n## 3D Model\n\n:warning: **IMPORTANT:** :warning: The 3D model is parametric and will scale within a reasonable range of values for the `OTA Outside Diameter` and `OTA Thickness` pareneters (see the `Parameters` spreadsheet in the 3D model for more details...) However, FreeCAD being FreeCAD, be warned that if you change the value of a parameter multiple times, you may get a model error. Simply close the model without saving it, reopen it, and set the parameter you want to change, e.g., the `OTA Outside Diameter` parameter, to the appropriate value. The model *should* scale properly.\n\nHere is what the 3D model looks like in FreeCAD:\n\n![FreeCAD model](images/FreeCAD-model.png)\n\nOnce you've updated the model to fit your needs, you can export the parts as STL and print them on your 3D printer.\n\nHere is how the neon bulbs are installed on the back of the cover lid:\n\n![Neon Bulbs Install](images/Neon-Bulbs-Install.jpg)\n\nA 47kΩ resistor is soldered to _each_ bulb, and the 4 x _resistor + bulb_ are wired in parallel (that is critical!)\n\nThe wires that power up those bulbs travel through the servo box and the left arm, so they are not directly visible, which makes for a very clean final product.\n\n## Using With NINA\n\nOnce you have installed the driver, open NINA, go to the `Equipment` tab and select `Flat Panel`. You should be able to select the `DarkSkyGeek Telescope Cover \u0026 Spectral Calibrator` device from the device dropdown:\n\n![NINA Screenshot 1](images/NINA-screenshot-1.png)\n\nThen, you can connect to the device, and all the standard controls should appear, allowing you to test and use your device. Enjoy!\n\n![NINA Screenshot 2](images/NINA-screenshot-2.png)\n\n## Known Issues\n\n### Device Access Synchronization\n\nI made sure that access to the serial port was synchronized, thereby preventing a second serial command from being sent if the reply to the first one has not yet been received. However, that code only works in multi-threaded applications. It will not work as expected if the same device is used by two different applications (i.e., processes) as they will each have their own instance of the ASCOM driver, and therefore their own locking object. Indeed, I opted to use the tried-and-true approach of implementing ASCOM drivers (output as a Class Library). Switching to a local COM server would have allowed me to resolve this relatively minor issue, but it seemed overkill for my use case.\n\n## Ideas For Improvements\n\n* Add a physical button (or several buttons) to manually control the device could be a relatively simple enhancement.\n* Leverage a small embedded LiPo battery and use BLE for communication, thereby completely removing the need for a USB cable.\n* Make the 3D model more scalable so that it can be easily adapted to various telescopes.\n\n**Note:** These are just ideas for you, in case you would like to challenge yourself. I am not planning to implement any of these ideas.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlecomte%2Fascom-telescope-cover-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlecomte%2Fascom-telescope-cover-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlecomte%2Fascom-telescope-cover-v2/lists"}