Jump to content

SkySurveyBanner.jpg.21855908fce40597655603b6c9af720d.jpg

Raspberry Pi Zero SQM


GuLinux

Recommended Posts

I've started this little project, using the TSL2591 Adafruit sensor, which seems to have an adequate dynamic range for SQM readings.

I finished putting the hardware back together, and hacked a "quick&dirty" software to get the readings and showing them to an OLED display.

I also added a temperature/humidity and atmospheric pressure sensor, and the ability to log the readings to a file for future reference.

On the hardware side it miss refinings, but not big things: a lens for the light sensor, a decent case (3d printing would be perfect, if only I had a printer..), add a button for the readings and turning everything off (right now it's on a loop, every 2 mins), and maybe redo some solderings.

IMG_20170716_131152.thumb.jpg.135cfad51545b1d62069e9d8282a459a.jpgIMG_20170716_130859.thumb.jpg.83ecf9c66898e536850a3a4b3e7eed3d.jpgIMG_20170716_132236.thumb.jpg.0b8a262e2de9a2304743cab76527e5ec.jpg

 

 

 

 

 

 

But the software, that's where it gets a bit messy.

This is my current implementation: https://github.com/GuLinux/raspi-sqm-weather/blob/master/sqm.py

I found only one other project using the same sensor, and this is the associated code: https://github.com/jvoight0205/SQM/blob/master/SQM/SQM.ino

The line doing the calculations is quite misterious:

mag = -1.085736205*log(.925925925 * pow(10,-5.)*adjustedVisible);

It's not clear where the numbers come from, how could I change them for calibration, and of course, I'm not even 100% sure that the formula is correct at all.

I saw a similar formula in the Arduino SQM thread on this forum using the TSL237, where the starting point is a frequency. But at a guess, to reuse the same formula, I'd have to know:

 1) if the readings I have from the TSL2591 output is a frequency as well (I suspect so, but I can't be 100% sure... the specification document doesn't mention frequencies, but "counts": https://cdn-shop.adafruit.com/datasheets/TSL25911_Datasheet_EN_v1.pdf )

2) If I should subtract the IR value from the Visible as shown in the other project

3) How to properly scale the values to apply the same formula as the TSL237.

 

Any ideas?

 

Cheers,

Marco

 

 

 

 

Link to comment
Share on other sites

Yes, calibration is the key!
But the calibration from counts / sec or period of square wave will vary depending on the lens you use in front of the sensor. It will also depend on whether you place a filter in front of the sensor - as it is sensitive to IR. My SQM has a bluish filter that mimics the response of the human eye.

Oh yes, and the device seems to have a temperature dependency, too.

(But if it was easy, it wouldn't be any fun. Isn't that why we do astronomy?)

Link to comment
Share on other sites

Yes, of course :)

But my problem right now is more "theorethical": before calibrating, I need to understand the right formula, and where to apply the calibration factors in the formula (wether they are constant, linear, logarithmic, etc).

Good point about the temperature... luckly I have the temp sensor in there, might be useful! :)

Link to comment
Share on other sites

My approach to calibration, used with other sensors, is to make a series of test readings against a good sensor or known standard (e.g.  boiling water/melting ice, m,et office air pressure readings etc.)

(You can get total darkness easily enough, but for other points you may have to calibrate against someone else's meter - but it doesn't need to be as sensitive as yours, as you can interpolate with some loss of accuracy.)

I then plot the points on a graph in excel, and armed with a basic knowledge of what sort of curve ought to fit, I let it add a trendline.

The fun bit is then translating the forumla exel generates, easier for you as you are using C.

Neil

Link to comment
Share on other sites

On 16/07/2017 at 19:30, Stub Mandrel said:

My approach to calibration, used with other sensors, is to make a series of test readings against a good sensor or known standard (e.g.  boiling water/melting ice, m,et office air pressure readings etc.)

(You can get total darkness easily enough, but for other points you may have to calibrate against someone else's meter - but it doesn't need to be as sensitive as yours, as you can interpolate with some loss of accuracy.)

I then plot the points on a graph in excel, and armed with a basic knowledge of what sort of curve ought to fit, I let it add a trendline.

The fun bit is then translating the forumla exel generates, easier for you as you are using C.

Neil

That is almost certainly how those values were derived in the OP's original query, if not in Excel then possibly Octave/MatLab. Measured empirically then plotted.

Link to comment
Share on other sites

Find someone with an SQM and buy them a beer.... then you could calibrate yours to theirs... cheaper than trying to setup and photometric facility. Then you could check nominally identicaL sensors for their results. I have tried a phone "SQM app", but the numbers don't agree very well. SQM generally agree well with each other.

cheers

peterW

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.