SQM Top
SQM Front Sensor
Inspired by the Unihedron Sky Quality Meter and its straightforward design, I embarked on creating my own DIY handheld version. My goal was to build a device that not only displays sky quality in Mag/Arc sec² but also maps it to the relevant Bortle zone for quick reference. Thanks to Unihedron’s documentation on key components like the TSL237, a UV/IR Cut Filter, and a 30-degree lens, I found it easy to get started.
OLED Display: Aliexpress Link
Project Enclosure: Jaycar Black Hand-Held Electronic Enclosure
Arduino Nano: AliExpress Link
TSL237: AliExpress Link
30-degree Lens: AliExpress Link
UV/IR Cut Filter: Sourced from CCD Camera Module AliExpress Link
9V Battery and 9V Battery Terminal Lead
LM7805 5V Battery Regulator: Jaycar Link
Latching Switch
https://github.com/joeldhenry/ArduinoSQM/blob/main/ArduinoSQM.ino
https://github.com/joeldhenry/ArduinoSQM/blob/main/cap-SQM.gcode
https://github.com/joeldhenry/ArduinoSQM/blob/main/front-v2.gcode
https://www.thingiverse.com/thing:6578554
Unihedron provides the specifications for the TSL237 on their website, which details the coding required. The critical code segment is:
SQM_OFFSET - 2.5 * log10(frequency) * SQMGain
Here, the Offset and Gain are calibration variables. I set my gain to 1 and offset to 21, but these values can vary based on the TSL237 sensor and calibration accuracy. My initial calibration was done using the Sky Quality iPhone app.
Additionally, I created a table for Bortle Value lookups from Wikipedia:
String getBortle(double mag) {
if (mag >= 21.99) {
return "Bortle 1";
} else if (mag >= 21.89) {
return "Bortle 2";
} else if (mag >= 21.69) {
return "Bortle 3";
} else if (mag >= 21.25) {
return "Bortle 4";
} else if (mag >= 20.49) {
return "Bortle 4.5";
} else if (mag >= 19.50) {
return "Bortle 5";
} else if (mag >= 18.95) {
return "Bortle 6";
} else if (mag >= 18.38) {
return "Bortle 7";
} else if (mag >= 17.80) {
return "Bortle 8";
} else {
return "Bortle 9";
}
}
Compatibility Issues: The FreqMeasure Arduino library is not compatible with ESP32 or ESP8266, leading me to use an Arduino Nano. This is likely due to differences in clock cycles and frequency calculations.
Sensor Availability: The TSL237 is an older sensor and is harder to find and more expensive. While it’s available on AliExpress, newer sensors might offer better quality or results, though they would require significant code refactoring.
Light Leakage: I used putty and removed LEDs from the Arduino and OLED display to prevent light leakage into the sensor.
Calibration: Calibration requires understanding the code and output frequency, as well as a calibrated device, clear skies, and time. My initial calibration was done using the Sky Quality app, and further calibration was assisted by a fellow astronomy club member. Future code adjustments require connecting the Arduino to a computer, so I recommend making the device easily accessible.
To further enhance the functionality and accuracy of this project, future efforts could focus on:
ASCOM Driver Support: Adding ASCOM driver support to allow integration with various astronomy software, making the device more versatile and user-friendly.
Improved Calibration Methods: Refining the calibration process to ensure more accurate readings.
Newer Sensors: Exploring compatibility with newer sensors for potentially better performance.
Bluetooth or Wi-Fi Connectivity: Revisiting the idea of Bluetooth or Wi-Fi compatibility if suitable hardware becomes available.
User Interface Enhancements: Improving the display and interface for easier use in the field.