astroshell
Optimized Arduino Code for controlling of my AstroShell Dome
프로젝트 개요 (KR)
AstroShell은 무인 천문대 환경에서 돔(dome)을 안전하게 제어하기 위한
Arduino 기반 지능형 돔 컨트롤러 프로젝트입니다.
비, 네트워크 장애, 센서 오류와 같은 위험 상황을 자동으로 감지하여
사람의 개입 없이도 돔을 닫아 망원경과 장비를 보호하는 것을 목표로 합니다.
본 프로젝트는 기존 AstroShell 오픈소스를 기반으로,
실제 운용 환경에서의 안정성과 안전성을 강화한 확장 구현입니다.
프로젝트의 필요성 및 문제 정의 (KR)
무인 또는 원격 천문대에서는
기상 변화나 통신 장애에 즉각 대응하지 못할 경우 장비 손상이 발생할 수 있습니다.
특히 비가 내리는 상황에서 돔이 열려 있는 경우,
망원경과 전자 장비는 치명적인 손상을 입을 수 있습니다.
AstroShell은 이러한 문제를 해결하기 위해
“문제가 발생하면 반드시 닫힌다”는 Fail-safe 철학을 중심으로 설계되었습니다.
시스템 전체 구성 (KR)
AstroShell 시스템은 다음과 같은 계층으로 구성됩니다.
- 제어 계층
- Arduino Mega 기반 돔 모터 제어
- 센서/입력 계층
- 기상 센서(Cloudwatcher)
- 리미트 스위치
- 네트워크 계층
- W5500 Ethernet 기반 유선 통신
- 사용자 인터페이스 계층
- 웹 브라우저 기반 제어 UI
- 알림/로그 계층
- 이벤트 로그
- 원격 알림(Pushover)
안전 설계 및 Fail-safe 전략 (KR)
AstroShell은 다음 상황을 모두 위험 조건으로 간주합니다.
- 비 감지
- 기상 센서 통신 끊김
- 이더넷 연결 해제
- 시스템 비정상 동작
위 조건 중 하나라도 발생하면
돔은 자동으로 닫히며, 사용자에게 알림이 전송됩니다.
핵심 하드웨어 구성 (KR)
Arduino Mega 2560
- 충분한 메모리와 안정적인 제어를 위한 메인 MCU
W5500 Ethernet Shield
- 유선 네트워크 기반의 안정적인 통신 및 장애 감지
Cloudwatcher Solo (선택)
- 비 및 기상 조건 감지
돔 모터 및 리미트 스위치
- 물리적 개폐 제어 및 위치 검출
FAQ – astroshell Telescope Dome Controller (WIZnet Focused)
Q1. 이 프로젝트는 왜 WIZnet W5500을 사용하나요?
A:astroshell은 망원경 돔을 안전하게 제어하기 위해 설계된 시스템으로, 네트워크 장애가 발생할 경우 돔을 자동으로 닫아야 합니다. W5500은 하드웨어 TCP/IP 스택을 내장하고 있어 Arduino MEGA 2560의 CPU 부하를 크게 줄여주며, 소프트웨어 네트워크 스택의 불안정성으로 인한 위험을 최소화합니다. 이러한 신뢰성은 기상 변화로 인한 장애가 실제 물리적 손상으로 이어질 수 있는 천문대 환경에서 매우 중요합니다.
Q2. W5500은 Arduino MEGA 2560에 어떻게 연결되나요?
A:W5500 이더넷 실드는 SPI 인터페이스를 통해 Arduino MEGA 2560에 연결되며, MOSI, MISO, SCK, CS 신호선과 전원이 필요합니다. 초기화는 표준 Arduino Ethernet 라이브러리를 사용합니다. W5500이 TCP/IP 처리를 내부적으로 수행하기 때문에, MCU는 네트워킹 오버헤드 대신 돔 모터 제어, 센서 모니터링, 안전 로직 처리에 집중할 수 있습니다.
Q3. 이 프로젝트에서 W5500은 어떤 역할을 하나요?
A:astroshell에서 W5500은 단순한 통신 칩이 아니라 핵심 안전 인프라 구성 요소입니다. 웹 기반 돔 제어 인터페이스를 제공하고, 네트워크 연결 상태를 감시하며, Cloudwatcher Solo 기상 센서와 통신합니다. 또한 네트워크 연결이 끊어질 경우 이를 감지해 자동으로 돔을 닫는 트리거 역할을 수행합니다. 즉, 신뢰할 수 있는 돔 보호 로직을 가능하게 하는 기반 역할을 합니다.
Q4. 왜 Wi-Fi 대신 이더넷(W5500)을 사용하나요?
A:천문대 환경은 거리, 전파 간섭, 기상 조건 등의 영향으로 Wi-Fi 연결이 불안정해지기 쉽습니다. 이더넷은 예측 가능한 지연 시간과 명확한 물리적 링크 상태 감지가 가능합니다. astroshell은 네트워크 연결 상실 자체를 치명적인 안전 이벤트로 취급하기 때문에, W5500을 통한 유선 이더넷 연결과 하드웨어 수준의 링크 감지는 논리적으로 더 안전하고 결정론적인 선택입니다.
Q5. 이 프로젝트는 초보자에게도 적합한가요?
A:기본적인 Arduino 개발 경험과 SPI 통신, TCP/IP 네트워킹 개념에 대한 이해가 필요합니다. 하지만 W5500이 TCP/IP 처리를 하드웨어로 오프로딩하기 때문에, LwIP와 같은 복잡한 소프트웨어 네트워크 스택을 직접 다룰 필요는 없습니다. 이러한 점에서 astroshell은 안전이 중요한 이더넷 기반 제어 시스템을 구축하려는 중급 메이커에게 매우 좋은 레퍼런스 프로젝트입니다.
Project Overview (EN)
AstroShell is an Arduino-based intelligent dome controller designed for unattended observatory operation.
The system automatically detects hazardous conditions such as rain, network failures, or sensor communication loss, and safely closes the observatory dome without human intervention.
This project is based on the original AstroShell open-source firmware, extended and refined to improve reliability, safety, and real-world usability.
Problem Statement & Motivation (EN)
In unattended or remote observatories, delayed responses to weather changes or network failures can result in severe equipment damage.
Rain exposure while the dome is open poses a critical risk to telescopes and sensitive electronics.
AstroShell addresses this challenge with a fail-safe design philosophy, ensuring that the dome is automatically closed whenever unsafe conditions are detected.
System Architecture (EN)
The AstroShell system consists of the following layers:
- Control Layer
- Dome motor control using Arduino Mega
- Sensor & Input Layer
- Weather sensor (Cloudwatcher)
- Limit switches
- Network Layer
- Wired Ethernet communication via W5500
- User Interface Layer
- Web-based control interface
- Logging & Notification Layer
- Event logging
- Remote notifications via Pushover
Key Hardware Components (EN)
Arduino Mega 2560
- Main MCU providing sufficient memory and reliable control
W5500 Ethernet Shield
- Stable wired network communication and fault detection
Cloudwatcher Solo (optional)
- Rain and weather condition detection
Dome Motor & Limit Switches
- Physical dome movement and position sensing
Safety & Fail-safe Strategy (EN)
AstroShell treats the following situations as hazardous conditions:
- Rain detection
- Weather sensor communication loss
- Ethernet disconnection
- Abnormal system behavior
If any of these conditions occur, the dome is automatically closed and the user is notified remotely.
FAQ – astroshell Telescope Dome Controller (WIZnet Focused)
Q1. Why does this project use the WIZnet W5500?
A: astroshell is designed to safely control a telescope dome, where the system must automatically close the dome in case of network failures. The W5500 integrates a hardware TCP/IP stack, significantly reducing CPU load on the Arduino MEGA 2560 and minimizing the risk of software stack instability. This reliability is critical in astronomical observatories where weather-related failures can cause physical damage.
Q2. How is the W5500 connected to the Arduino MEGA 2560?
A: The W5500 Ethernet Shield connects to the Arduino MEGA 2560 via the SPI interface, requiring MOSI, MISO, SCK, CS, and power. It is initialized using the standard Arduino Ethernet library. Because the W5500 handles TCP/IP processing internally, the MCU can focus on dome motor control, sensor monitoring, and safety logic rather than networking overhead.
Q3. What role does the W5500 play in this project?
A: In astroshell, the W5500 acts as a core safety infrastructure component. It enables the web-based dome control interface, monitors network connectivity, communicates with the Cloudwatcher Solo weather sensor, and triggers automatic dome closure when network connectivity is lost. Rather than being a simple communication chip, it forms the foundation that enables reliable dome protection logic.
Q4. Why is Ethernet (W5500) used instead of Wi-Fi?
A: Observatory environments are prone to Wi-Fi instability due to interference, distance, and weather conditions. Ethernet provides predictable latency and clear physical link status detection. Since astroshell treats network loss itself as a critical safety event, a wired Ethernet connection with hardware-level link detection via the W5500 is a logically safer and more deterministic choice.
Q5. Is this project suitable for beginners?
A: Basic experience with Arduino development, SPI communication, and TCP/IP networking concepts is required. However, because the W5500 offloads TCP/IP processing in hardware, developers do not need to manage complex software stacks such as LwIP. This makes astroshell a strong reference project for intermediate makers building safety-critical Ethernet-based control systems.


