Sun Avoidance Monitor (SAM)

23 Augustus 2025 (© N. de Hilster)

This article discusses a safety device intended to protect the imaging camera to be exposed to direct sunlight. It consists of a 'dumb' alarm system, combined with a 'smart' Arduino microprocessor. The alarm system alerts the user by sounding a buzzer as soon as illumination exceeds a pre-set level. At the same time it pulls down a pin on the Arduino as a result of which it will tell the mount to either stop or even slew away from danger.


The Sun Avoidance Monitor. From left to right: LED, 12V and LDR connectors, buzzer, test-button.
Figure 1: The Sun Avoidance Monitor. From left to right: LED, 12V and LDR connectors, buzzer, test-button.
On InFINNity Deck, the sun is observed daily. Sunspots are recorded by projection/sketch with the GTT60, immediately followed by imaging using the SkyWatcher Esprit 150ED, protected by an ND5.0 foil filter. Because the observatory is also used for planetary and deep-sky imaging this filter is not permanently mounted, and there is a risk that one of the cameras on the installation (piggy-back to the Esprit 150ED is a SkyWatcher Esprit 80ED with camera) could accidentally be exposed to direct sunlight. This has happened several times over the past four years, resulting in two serious camera damage in the past twelve months.
To prevent a recurrence, I decided to develop a Sun Avoidance Monitor, a (hopefully) robust system that alerts me as soon as an unprotected telescope/camera is pointed at the sun. It consists of a 'dumb' electronic circuit that sounds an alarm and an Arduino that takes immediate action. The electronic circuit uses a Light Dependent Resistor (LDR) mounted in the telescope's dew shield (see figure 5 and figure 6) to trigger an alarm when it is hit by too many photons. Because the telescopes are parked horizontal after a night of deep-sky imaging, low light levels should not trigger the alarm, so it can be adjusted with a potentiometer.


The 'dumb' circuit of the Sun Avoidance Monitor.
Figure 2: The 'dumb' circuit of the Sun Avoidance Monitor.
My astronomy friends Rob and Paul, both with better electronics skills than I, kindly helped me set up the electronics. Rob gave me the initial circuit, and Paul modified it to interface with the Arduino. Adjacent figure 2 shows the final schematic.
Because I wanted the SAM to be simple and robust, and to only operate when the observatory's 12V power supplies are switched on (they switch on as soon as the observatory's mains switch is turned on), the entire circuit operates on 12V and uses a standard 12V buzzer as an audible alarm. However, because an Arduino MKR was used for the 'smart' part of the SAM, two additional resistors (10 kΩ and 27 kΩ on the right vertical line of the circuit) and a diode were added to limit the maximum voltage at pin 0 of the Arduino to 3.3 V.
At the bottom left of the schematic is the LDR, with a switch and a 220 Ω resistor to its right. This switch can be used to test the circuit when there is insufficient light. for multiple OTA set-ups like mine (I use both an Esprit 80ED and Esprit 150ED for deep-sky imaging) it is possible to have multiple LDRs parallel to each other, so no matter which scope catches the full blast of the Sun it will turn away. In such a set-up the largest FOV should be specified in the sketch.


Arduino MKR

The 'dumb' circuit of the Sun Avoidance Monitor mounted on a halved MKR Proto Large Shield.
Figure 3: The 'dumb' circuit of the Sun Avoidance Monitor mounted on a halved MKR Proto Large Shield.
Initially I wanted to use an Arduino Nano, but as Arduino does not make Ethernet shield for this version (and I was reluctant to use third party shields), I decided to go for the Arduino MKR. On hindsight this was a good choice as the Arduino Nano and Arduino Uno do not have enough memory to run the required software (as I found out later while adapting the software for iOptron mounts).
Because I wanted to use a small enclosure measuring 98 x 64 x 37 mm, I decided to use half of a MKR Large Proto Shield to solder the electronic circuitry. Adjacent figure 3 shows this board; the top half is the section cut off the original board.
The components within the white MKR shield boundary are mounted underneath the board. The largest is an LM7805, a 1.5A 12V to 5V fixed voltage regulator. This component gets considerably hot and is therefore connected to an external heat sink (see figure 1 and figure 4).
Pin 1 is used to power an LED whenever the mount is queried or controlled by the Arduino sketch. To reduce the amount of light emitted by the LED, it is paired with a 1 kΩ resistor (a 470 kΩ resistor would have been sufficient, but makes the LED brighter).


The sketch

The interior of the SAM.
Figure 4: The interior of the SAM.
The Arduino MKR operates completely stand-alone; it is only connected to the observatory's 12V and LAN power. A USB connection is not required during operation. In fact, I deliberately disconnected it so it shuts down as soon as the 12V power is lost (the observatory PC is always running).
The sketch does the following:

At startup:
- connect to the mount;
- get the mount's latitude and longitude;
- start the loop.

While the main loop is running:
- get the mount's date and time;
- calculate the sun's altitude and azimuth;
- get the mount's altitude and azimuth;
- listen to pin 0;
- do nothing as long as pin 0 remains high.

As soon as pin 0 goes low:
- abort slewing (if it was);
- calculate the angular distance between the mount and the sun (using Haversine formula);
- if the angular distance exceeds the criterion: stop;
- if the angular distance is less than the criterion: move the scope up or down (default 15 degrees), depending on the scope's elevation and the limit (default 35 degrees elevation). Finally, the mount is stopped.

As long as pin 0 indicates an unsafe condition, the Arduino continues to monitor the situation and moves the scope again if required.
Currently, the sketch is only written for 10Micron and iOptron mounts, but it may soon be available for LX200 compatible mounts as well. As the software still is under development I am not sharing it here, so contact me if you would like a copy of the SAM sketch.


Shoppping list

Provided you want to run the SAM on 12V DC:
1 x Arduino MKR (not Nano or Uno as they have not enough memory!)
1 x Arduino MKR ETH shield
1 x MKR Large Proto Shield (with headers)
1 x Housing
1 x 100kΩ variable resistor
2 x 4kΩ7 resistor
1 x 27kΩ resistor
1 x 10kΩ resistor
1 x 220Ω resistor (for test switch)
1 x 1kΩ resistor (for LED)
2 x 1N4001 diode
2 x BC547 transistor
1 x LM7805 power regulator
1 x normally open push button switch (for testing)
1 x LDR (Light Dependant Resistor)
1 x LED
1 x 12V buzzer
1 x 12V female connector
For connecting the LDR (not required):
1 x 3.5mm audio jack female
1 x 3.5mm audio jack male


If you have any questions and/or remarks please let me know.

The LDR mounted in the SkyWatcher Esprit 80ED.
Figure 5: The LDR mounted in the SkyWatcher Esprit 80ED.
 
The LDR mounted in the SkyWatcher Esprit 150ED.
Figure 6: The LDR mounted in the SkyWatcher Esprit 150ED.

For the Esprit 80ED I drilled a 5.5mm hole in the dew-shield, just under the dew-strap.
Figure 7: For the Esprit 80ED I drilled a 5.5mm hole in the dew-shield, just under the dew-strap.
 
At the Esprit 150ED I used 0.3mm thin flat-cable, which just fits the gap of the sliding dew-shield.
Figure 8: At the Esprit 150ED I used 0.3mm thin flat-cable, which just fits the gap of the sliding dew-shield.

The 'dumb' part of the SAM-circuit.
Figure 9: The 'dumb' part of the SAM-circuit.
 

 

Home Geodesy Navigation Astronomy Literature
InFINNity Deck... Astrophotography... Astro-Software... Astro Reach-out... Equipment... White papers...
Hardware... Imaging...
Balancing system Camera centring errors Collimator construction Dome Azimuth Calculation Filter focus-offsets RC Collimation Removing lens artefacts Removing Newton-rings Solar Seeing Monitor (DIY) Stability measurements Sun Avoidance Monitor