Menu |
Prof /
Cosqmv2-users-manualCoSQM - a color hack to the SQM-LE for Light At Night SensingUser's Manual
Martin Aubé1, Ph.D. (PI) 1 Cégep de Sherbrooke, Sherbrooke, Québec, Canada CoSQMv2 January 23, 2022 Creative Commons Attribution-ShareAlike 4.0 International License . AbstractThe CoSQM is a portable device which aims to sample the multispectral properties of the artificial light scattered by the atmosphere. It is a convenient tool to estimate light pollution and its impact on the environment. CoSQM is an instrument composed of a filter wheel with four different spectral transmittance in the visible range (clear, red, blue, green) that is standing on a step motor in front of a Sky Quality Meter. The device comprise a Raspberry pi open source linux computer so that it can be reproduced by anyone. CoSQM also comprise a camera module. The instrument can be operated remotely via the ssh protocol and the data may be accessed via an integrated web server. This device should better show how humankind can affect their own nocturnal environments. Color detection capability is an important improvement over existing non-imaging detectors in the context of the drastic change in the color of light pollution provided by the transition to the LED technology. Operation modeThe CoSQM was designed to be used in a permanent installation mode. Note that unclean shutdown of the system may end-up in file system corruption. In such a case the system may fail to restart properly and then will need to be serviced. As a routine step, the CoSQM is restarted around noon local time. This is done automatically by the crond service (see Crontab section below). That time should be set correctly according to the region of installation of the instrument to be sure that it falls during day time around noon. Note that the time zone of any CoSQM must be set to GMT. This is why that reboot time should be changed according to your installation site. HardwareComponentsThe system consists of the following items, but it would certainly be adapted to a different list of items with minor corrections.
Optional components
EnclosureWe use the Bud industries NEMA box part number NBF-32314 with the associated prototype plate NBX-32914-PL. On the lid, we drill two 1 1/2 inch holes according to the picture below. Four small 1/8 inch holes need to be drilled around each large holes to attach the window supports on the top lid from the inside with the M3 self taping screws. If a fixation plate have to be used, seven 5/16 inch holes should be drilled on the bottom of the box. Some holes also need to be drilled on the side for installing the connector gland and the LED (if the LED is desired). We suggest to let the reboot button inside the enclosure (no need to secure it on the enclosure simple let the cable inside). 3D printed componentsThere are only 5 printed parts. We recommend the use of PLA material in black color. Black is better to attenuate the light inside the instrument. You can find the 3D print link of each component below the image of each one. Main support
Filter wheel
Windows supports (2 copies)
Position sensor support
Filter wheel encoder plateIn order to get rid of thermal deformation of the filter wheel, we deciced to make a fiber glass plate on which the filter support is glued. This circular plate show a slot to serve as a zero position encoder for the filter wheel. We suggest to use a CNC router to cut that encoder plate. The sketch of the plate is given below. Along with the corresponding gcode file for the CNC router. The slot on the encoder plate must be aligned with the clear channel position (the filter support hole that will not hold any filter). Filter wheel encoder plate
Filters positionsThe filter hole aligned with the slot of the encoder plate must be empty (without filter). Then when looking to the filter wheel from the top, put the Red, Green, Blue and the white diffusing into the following holes (clockwise order) Optical properties
Angular response of SQM in a linear scaleThe angular response is determined using figure 4 of the report on Sky Quality Meter of Pierantonio Cinzano (2007) Power consumptionThe CoSQM typically drive up to 5A (25W). But we found that a 5A power supply sometimes fail to provide the required current. For that reason it is recommended to use a higher power supply capacity. We suggest a >7A 5V power supply and >2A 12V power supply. It is highly recommended to set the power voltage to 5.45 V so that when current peaks appear, the power will remain sufficient for the RPI. The little lightning icon should disappear when the voltage is correctly set. But take care of not going above 5.5 V otherwise you can damage the RPI. 5V will power up the RPI, the SQM, the HUB, and the fan while the 12V power the stepper controller. Size and weight
WiringPinout informations and GPIO pinout map
USB-C powerTo benefit of the UPS hat protection, you need to power the RPI through the USB-C connector. If you want you can solder your power wires directly to the RPI PCB. TP1 = 5v and TP7 = GND. In such case, use at least AWG20 stranded wire (not solid core wire). It can also be a good idea to sue hot glue to the wires after soldering to serve as stress relief. LEDA red LED is installed near the connectors of the CoSQM. This LED will blink at some point to indicate the state of the system. Of course it will not blink during measurement and at least no less than 20 sec to the next measurement to get rid of any contamination of the LED to the measurements. Below are the various signals given by the LED.
LED wiringThe wiring of the LED is very simple. First it is required to solder a 330 Ohm resistor to the ground pin of the LED (the shortest pin). Then the other end of the resistor must be connected to the ground of the raspberry pi. The other pin of the LED have to be connected to the GPIO 13 (pin 33). Note that in very dark place the LED may be a problem as it can become a significant source of light pollution given its proximity to the SQM. Maybe you can put some black nail varnish on it to attenuate the light level and/or put a back electrical tape over it that can be took off when you really need to see the LED state. In any case you can simply not put any LED, that will not impact the CoSQM at all. Shutdown/reboot buttonThe shutdown button should follow the following configuration The pin numbers below refers to figure "RPI GPIO pin out map".
The RPI will reboot if the button is held for more than two seconds but fewer than five seconds and it will shut down if the button is held for more than five seconds. AssemblyAssembling steps (see detailed sections below)
(:galleria list="#assembly":) Main supportAn 1mm thick aluminum plate have to be screwed to the top of the main support with 4 self tap M3 screws. That plate is supporting the stepper and block possible light contamination coming from underneath components. This plate also assure a certain level of heat dissipation protecting the support from over heating. The image below show the plate when installed on the main support. The small holes are 9/64in in diameter and the two large holes are 7/8in in diameter. On that supporting plate, the right angle camera support (see image below) have to be screwed with 1/4-20 screw. We suggest to use the same thickness as for the plate. The two holes may have a diameter of 33/64in. All components
Window supports
WeldsWe recommend to weld the wires on a prototype hat. Ethernet wire connectionsMake the connections in the following order :
Stepper motorUse the 18 mm M3 screws to secure the motor on the main support. Be sure to put the washers and the lock washers between the screws heads and the support. This is important because that the vibrations produced by the motor can lead to the screws to unscrew with time. The stepper motor can become quite hot. To reduce the surface temperature of the motor, install a heat sink on it, under the motor. This is an important step to protect the PLA main support from suffering of excessive heat. Setting up the CoSQM for measurementsInstall the instrument to point the relevant part of the sky. Normally the zenith is the direction that must be preferred. Be sure that the sky is clear from blocking structure to allow the GPS to connect correctly (if a GPS is used). One must also put some near horizon obstacles to block the direct light from important sources near horizon. If such source hit the optical window, there is a possibility for that light to interfere with the light coming from the sky after multiple reflection into the window. Even if the CoSQM can comprise a GPS, it is not designed to be used in a roadrunner mode. Starting the CoSQMCoSQM is trivial to startup. All you have to do is to plug the power connector to the grid. The RPI will then boot and will automatically startup the observation script. The data will be stored into the relevant /data directory accessible to the web server. If the ethernet cable is connected to a local network with 192.168.0.* root, you will be able to access the instrument remotely for any station in that network. You can both connect via ssh or http. The standard IP used by the CoSQM is 192.168.0.100. Downloading the dataWired connectionThe data are stored into the micro SD card of the Raspberry pi (RPI). In order to access the data, an apache2 web server is configured on the RPI. You can browse the data simply from a web page using the following URL http://192.168.0.100/data . To do that you first need to plug the network cable of your computer to a router of switch in the sub net 192.168.0.* and configure your pc IPV4 connexion properties. You need to set it to manual configuration mode then set the IP address, net mask and route/gateway according to the following table.
Once configured, restart your interface, open a web browser and enter the following address in the address bar. Note that the "200" in your computer IP can be replaced by any other address and depending on the local network configuration, a automatic DHCP IP attribution can work. To access the data, type this in your browser: 192.168.0.100/data You should then see a directory tree and will be able to visualize the text data along with the camera images. The data is organized by year and month. You can also download all the data by using the following command on a linux command line: wget -r 192.168.0.100/data The data will be download and stored in a local directory named 192.168.0.100 Wifi accessYou can alternatively connect to the cosqm wifi network to access the web server (or the ssh). The wifi SSID is cosqm and the passphrase is cosqmwifi. Your device IP will then be set automatically (if you are using DHCP) to a value between 192.168.5.2 and 192.168.5.20. To access the data, simply do the same as for the wired connection explained above using IP 192.168.0.100 . Data format and sizeThe data is structured in the following way for each equivalent column number:
The radiances are calculated using equation 5 of Sánchez de Miguel et al. (2017)1 . 1Sánchez de Miguel, A., Aubé, M., Zamorano, J., Kocifaj, M., Roby, J., & Tapia, C. (2017). Sky Quality Meter measurements in a colour-changing world. Monthly Notices of the Royal Astronomical Society, 467(3), 2966-2979. The average size of a complete day of measurements is about 38 kB and the images for the same day period is 4.3 MB. Considering the available memory on the 32 GB micro SD card, it is possible to run the system without emptying the card during about 13 years. Shutdown of the CoSQMA Shutdown/reboot button is provided at the bottom of the instrument. Please never power off the instrument by unplugging directly the power cable. Sometimes, doing so may result in data corruption problems on the RPI micro-SD card. When you push the power button, a signal is sent to the RPI for a safe shutdown. You have to press the button for at least 5 seconds for a shutdown to be initiated. Please wait about a minute after pushing the power button before unplugging the power cable. |