-
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. We will discuss this later.
To measure the current, we will use an ACS712 chip. This chip contains a hall sensor that measures the current passing through an internal trace and outputs the measured current as a voltage. Since this can measure both AC and DC current, the chip will have a bias voltage of 2.5V on the output. There are three flavours of this chip : 5A, 20A and 30A. We will go with the 20A version for this project, since it has adequate headroom and resolution for our power demands. We will discuss this further in the "Hardware" section of the wiki.
Since we have measured the voltage and current, we can easily calculate the power by multiplying the voltage by the current. To record the total power consumption since the device was connected, we can add up the current usage multiplied by the time passed. We will further explore this in the "Arduino Code" section of the wiki.
We need to contain this project in a box which we can attach to our mount/telescope/tripod. We can choose a store-bough box, or we can 3D model and print our own box. I went with a 3D printed box, but you can usee a store-bought box, depending on how comfortable you are with drilling and cutting slots in that box. As for the mounting options, we can choose to mount this using velcro, using hook-and-loop straps to affix it to the tripod, finder scope shoe mount, on a vixen/losmandy rail with the correct clamp.
- Soldering iron and fume extractor. We will be working with both SMD and through-hole components. You can use a hot air soldering station, as well, for soldering the SMDs in place, but a soldering iron will work, too, if the other is not available. I have only used a soldering iron in this project and I've had no trouble soldering the small SMDs in place.
- ESD Safe tweezers
- Rosin core solder. The thinner, the better, preferably 1mm and under.
- Flux
- Helping-hands or electronics vise, with a magnifying glass.
- Solder pump, in case of mistakes
- Solder wick
- Isopropyl alcohol, to clean up the flux
- Flush wire cutters.
If you are making your own PCB, instead of ordering online you will need:
- Laser printer
- Transfer paper (a paper with a waxy side, like stickers backing. Check your local electronics provider for this)
- Clothes iron
- Etching solution
- Dremel tool with fine drills (0.4mm, 0.7mm)
- Box cutter or hobby knife
- Metal ruler
- Woodworking clamps.
If you want to make the box yoursel, you will also need a 3D printer. If you are using a store-bought electronics case, you will also need a drill and drill-bits to drill the holes for the DC and RCA plugs, as well as a dremmel tool to cut out the USB slots.
- Mid level electronics and soldering experience
- Arduino IDE usage or programing experience (to program
- Visual Studio and Visual Basic knowledge (if you want to build or modify the driver yourself)
- Basic knowledge of how to use a 3D Printer (if building the box or mounting options yourself)
This project will also later need some basic understanding of how ASCOM works and how to connect and use devices in NINA
The only other difference between these chips is their resolution:
- The 5A version has a resolution of 183mV/A
- The 20A version has a resolution of 100mV/A
- The 30A version has a resolution of 66mV/A.
The resolution means that, for 1A of current running through the sensing portion of this chip, it will output the number of millivolts mentioned in the ratio above.
An Arduino Nano has a 10 bit ADC (Analog to Digital Converter) with 1024 ADU (Analog to Digital Units). The maximum voltage an analog pin can read is 5V. By dividing the 5V by the number of ADUs (1024), we get that the resolution of an Arduino Nano is roughly 5mv/ADU. Combining this resolution with the resolution of the ACS712 of choice, we get the resolution of current reading.
For example: The 20A chip has a resolution of 100mV/A, while the arduino has a resolution of 5mV/ADU. So, by dividing the 5mv/ADU by 100mV/A, 20mA/ADU. This is the resolution at which we can read the passing current, in 20mA increments. Since we are working with current much higher that 20mA, this resolution is adequate.