-
Notifications
You must be signed in to change notification settings - Fork 0
Overview
This power box needs to be able to control the power output to 4 DC jacks, 2 RCA PWM jacks, measure the environmental conditions and monitor power usage. All this data needs to be displayed and controlled via an ASCOM driver which can be accessed from an astrophotography automation software, like NINA, communications happening via a USB cable, through the serial COM protocol.
For this task, we need a device capable of communicating with the computer via serial and which has GPIO pins for controling and monitoring the integrated modules (power delivery automation, environmental conditions monitoring and power monitoring).
An Arduino Nano board is the perfect choice. It has 8 analog pins that can be used to measure voltage and current, 11 digital I/O pins, out of which 6 are PWM capable. We need two analog input pins for voltage and current measurement, two PWM capable pins for controlling the outputs for the dew heaters, one digital output pin to control the 4 x 12V DC outputs and one digital input pin to read the environmental conditions sensor.
This project has been started because of my need to automate the switching of the power delivery to my astrophotography gear at the end of an imaging session through instructions in my NINA sequences, or manually through the Switch device page.
To do this, I chose to use a relay to control 4 12V DC outputs and two N-MOSFET transistors to control two separate channels of 12V PWM output for my dew heaters. In the next version of the board, I will swap the relay for two P-MOSFET transistors in parralel, for higher efficiency and longevity of the components.
I wanted to integrate a way to read the outside temperature and relative humidity conditions, as well as calculate the dew point, in order to better control my cooled camera and dew heaters.
For this, I chose to use the DHT22 sensor module. The temperature and relative humidity is read off the sensor, then the dew point is calculated using some code in the microcontroller (we will go over this later).
The DHT22 sensor is a temperature and humidity sensor that can measure temperatures between -40C and 80C in 0.1 degrees increments, as well as relative humidity between 0% and 99.9%, in 0.1 increments. The error for the temperature measurement is +/- 0.5C and the relatitive humidity error is +/-2%. This range, resolution and accuracy is more than adequate and, coupled with the realive low price of this unit, it will make an excelent choice for environmental conditions measurement.
Since most of us are working off batteries, I wanted to integrate a way to monitor the power usage and condition. I wanted to be able to measure and display the voltage, current and power usage, as well as log the total power used since the device was connected to NINA.
To measure the voltage, we just need to bring it to an Analog pin of the Arduino Nano. Since we are working with 12V, we need to bring this down to under 5V. For this, we will use a 11:1 voltage divider composed of two resistors: 100k and 10k. This will bring the 12V down to a readable ~1.1V, which is withing the readable range of the microcontroller.