ASCOM Temperature Sensor

Published: 02.12.2018 - Last update: 28.01.2019

Motivation

TEPMerHUM Stick.
TEPMerHUM Stick.

As the focus motor of my photo setup is driven by the Avalon Linear, my focuser does not have a temperature sensor.  The Esprit is by far not as bitchy as some other famous refractors in this range. So far I helped myself by initiating an autofocus run from time to time. Usually I initiated a focus run every 90 minutes which is more than necessary. In the second part of the night even less focus runs are adequate. Sequence Generator Pro (SGP) allows this way of controlling  autofocus runs in a quite easy way. My intension was to improve this using a temperature sensor.

SGP allows to evaluate other sensors for focusing as well. So my first idea was to trigger focus run by the temperature sensed by a TEMPerHUM stick. Acually SGP works with ASCOM devices. The TEMPerHUM stick is an exception, but it is not supported officially. Then happened, what had to happen: My stick operated with  APT but not with SGP. The BlueAstro USB weatherstation would be an ASCOM compatible solution, but it is not available due to the passing of Per Frejvall.

Thus I came to the conclusion that I had to design my own solution. Based on an Arduino the hardware part should not be a real issue, but developing the ASCOM driver was fully new for me.

Sensor Hardware

The sensor hardware consists of an Arduino Nano PCB and a DHT22 sensor for temperature and humidity. A  BME280 breakout board is used for air pressure. This device measures temperature as well, but this value currently is not used by the software. The breakout board is one of the cheap ones and containing only a BMP280 sensor, which is not capable to measure humidity. Hence the I2C adress is 0x76 (BMP280)  and not 0x77 (BME280) and the chip identifier is not 0x60 (BME280) but 0x58 (BMP280). One has to modify the lib Adafruit_BME280.h accordningly before compiling.

There are many sketches to be found dealing with that parts. I added an energy save function, which allows the Nano to sleep most of the time. The interrupt for awakening is triggered by the serial communication. This is bit unusual, as the first part of serial communication coming from the computer certainly will get lost in this scenario, but my drivers care for that case. My system seems to run stable without any issues.

DHT 22 Temperature Sensor.
DHT 22 Temperature Sensor.

The circuit is straightforward and very easy to realize.  One should be careful to match the pins with the pin numbers of the sketch. The sleep mode reduces the supply current which is drawn from the USB  connector. Removing the power LED from the PCB and introducing the sleep mode reduced the the current from 32 mA down to 12 mA. I think this is worth it for two reasons: Firstly in the field I only have limited energy available, secondly current produces heat and this compromises temperature measurements in a narrow compartment.

Experimental setup.
Experimental setup with DHT22 only.

The photo shows my experimental setup where the DHT 22 is soldered directly upon the Nano. I used this system for developing the ASCOM code. The final arrangement fits in a 65 mm x 32 mm x 20 mm box. At one side the DHT 22 sits and the USB socket sits at the opposite side. Below is a gallery showing the final temperature sensor in its box.

Software

Software downloaded from this web site is provided ‚as is‘ without warranty of any kind, either express or implied.  You should know what you do. Any action you take upon the information on this website is strictly at your own risk.

ASCOM Telescope Driver

The ASCOM driver (version 1.1.0) is available to download here. Off course, the ASCOM Platform should be installed before this driver. I coded the driver based on a skeleton of an ASCOM Observing Conditions driver in VB. It runs successful at my office PC under Windows 10, at my telescope control notebook under Windows 7 and at a virtual machine running Windows 7, as well.

If somebody wants to compile an own version, I’ve  shared the source code at Github.

Arduino Sketch

The sketch for the Arduino Nano is listed here. Just copy and paste it into your Arduino IDE.

 

last update: Jan 27th 2019