Help with Safety Monitor


Hi All,

Recently i’ve been worrying about my astro gear getting wet, so tonight i had some free time and built a rain sensor and wrote an ascom driver for it under the Safety Monitor class.

The driver appears to work fine and triggers as expected, but i would like to know how the timings of the Unsafe trigger are controlled in SGP.

I.e. when it driver triggers as Unsafe in the bottom right hand corner, it’s appears to be around 5-10 seconds before SGP does anything with this, and then it displays the unsafe warning and starts the 30 second end of sequence countdown.

So my first question is how do i chnage that initial 10 second delay to 1 - 2 seconds, and then when the end of sequence starts, how can i change this to lets says 5 seconds.

I want to chnage these values as i dont want to have to wait up to 40 seconds before my mount starts parking and closing the roof in the event of rain.

From the initial first detected drop of rain, i want the process to start within no more than 5-10 secs.



The Safety Monitor is passive, it only reports the state when it’s asked so getting a response within 1 - 2 seconds means that SGP has to check every 1 -2 seconds as well as everything else.

Waiting until it’s started raining will always be a problem. What if it starts raining hard really suddenly? Then there’s the time to scope takes to park and the roof to close. Even if it starts parking when the first drop of rain falls there could still be a delay of a minute or two before the scope is protected and it could get pretty wet in that time.

I’d look at extending the hardware to detect cloud as well, it usually gets cloudy before it starts raining and triggering the close when it gets cloudy will give you some lead time.



Hi Chris,

I take your point, as i have seen some rather sudden downpours in my time. I might just try setting up that tektite skies and using a camera so i dont need to develop anything.

I’ll have a google around and see how much work is involved to do a cloud detector. If i remember rightly, i did read something about it, some time ago and i think is something like taking they ambient temp and the sky temp and doing some calculation based on the 2.

Well, my rain sesnor was very short lived lol.



Rain sensors are still good but only to tell you that your gear is actively getting soaked :slight_smile: . Cloud monitors are the way to go. The easiest of which monitors the sky temp (very cold when clear) and compares it with the ambient temp. When these get close its cloudy and time to call it a night.



But what about those of us who like to image the undersides of clouds? :wink:


Judging by some of the feature requests there certainly seem to be a fair amount of folks that like to image though “sucker holes”!



I’ve always been surprised at how effective a rain sensor is. It knows well before I know that it’s raining. The cloud sensor on the other hand has always been ‘finicky’. I can tweak the settings day by day… but it takes a lot of work to keep it running effectively and often times is more conservative than you need to be.

In the end, a little rain during the initial start of a storm isn’t going to kill your gear. It’s less rain than the dew you get every day :).


I guess it depends on how much you trust the weather forecast, which in my case it’s a bit 50/50

I did some initial testing a few weeks ago where the sensor was just running at the Arduino level, i.e. no ascom integration where i just has the mount parked and left the roof open when i thought it was going to rain and it seemed to work very well. but like others have said, it’s that one freak heavy shower that wikk catch you out.

So… going back to my original quesiton :

Can the 30 second end of sequence countdown be altered ? i.e. chnaged to 5 seconds ?



A cloud detector is quite easy, most people use a MLX90614 IR sensor. It uses I2C and there’s probably an Arduino library to run it. The only thing to be careful of is that it runs on 3.3V.

I’m running one with a PICAXE, with temperature, light level, wind and an experimental rain sensor using a touch interface. Need to get round to getting it in enough of a box that I can put it outside.



Hi Chris,

Well i finally got round to building a weather station using the MLX90614IR sesnsor and wrote a Ascom Safety Monitor Driver, but due to my lack of programming skills it’s a bit unstable running in sgp where sgp sometime triggers even thought safety monitor shows a green, and other times when the safety monitor reports as being unsafe and sgp just sits there and doesn’t trigger.

the odd thing is that watching the com port traffic on the arduino, the arduino appers rock stable and seems to trigger correctly. It just seems that my ascom driver is a bit unstable



I don’t know the detail of your system so can only give general suggestions.

  1. First, find out what is happening - really happening. Get log data
    that shows exactly what the driver is reading from the Arduino and
    what it is sending to SGP. Log both as close to where the data is read or sent so any problem will be seen in the log.
  2. Once you know what is really happening, fix it.

It could be some sort of timing problem, using a value before it’s been set or having a value updated in one thread but not globally.