Measure nightsky with TSL237

SQM lens is just a half-sphere ball lens (you can get them from Edmund Scientific). Those lenses have a really short focal length and a decent aperture.

About the code, every time I try to write an interrupt-driven counter, I end forgiving it and looking for alternatives because of problems like overflows, freezes with intense light (you can fix them, but I think it's not trivial). And they don't solve themselves the 'slow' frequency reading mode needed in very dark nights (mag>21). For that, you need to count the pulse period (which can be as long as 10 seconds or so on unpolluted skies).

The mag/arcsec2 conversion is as simple as doing

ZP - 2.5*log10(frequency)

where ZP is the zero point, which depends on each individual photometer (sensitivity of your sensor, the filter you are using, the lens characteristics). It's probably the hardest part of the project if you want to be accurate and you won't probably get 'scientific-level' values unless you can access already calibrated photodiodes / lamps to study the response of your system.

The LCD output is nearly trivial in arduino (both in normal LCDs and I2C ones) :wink: