Close

Full Circle

A project log for Daylight Geolocator Remix

This is a remix of https://hackaday.io/project/28550-light-level-geolocator

agpcooperagp.cooper 03/01/2018 at 08:350 Comments

Full Circle

Its a bit like booze, you know its not good for you but you keep coming back for more!

Anyway I am back looking at the sunrise/sunset transition. I was looking at the Lux curve and noting that the curve has a strong inflection (red circles) between twilight (i.e. dawn/dusk) and sunrise/sunset:

Anyway, here is the first and second derivative:

Now note the curve above is a "standard" curve not a measured curve. So the funny "hook" for Lux' is an artifact of the construction of the "standard" curve. What is interesting is Lux'' as it has a peak around sunrise and sunset. Now this is not surprising, the question is it practical to use this information?

Okay here is some (old) measured data:

And yes it does look promising. Note, the green line is the first derivative of the LDR voltage (the magic on non-linear maths!). The noise on the right hand side can be filtered:

Well that looks very nice! The LDR peaks are very consistent. Some thought needs to be made to avoid false trips but it looks very promising.

Well it ran last night, if I cheat and adjust the assumed altitude for the best result (I can't calculate it at the moment as I do not have a calibrated the LDR sensor), I get:

This is within 11 km of my true location and within accuracy of the sampling frequency.

So it the results are consistent, especally with cloudy conditions I have a great solution.

Another reading for today;

The box site was not the roof this time but in the middle of my back yard. A more typical/practical location.

I reworked the filter (green) but more work is required:

I am currently using a threshold and a simple adjacent value test to determine a peak. I still need a threshold but better to use a sliding window to find the loacl maxima.

It seems as if the sunrise transition this morning was missed. The box site is shaded by a tree from the morning sunlight (unlike the roof position). With the new filter I can lower the threshold significantly. Currently the threshold is about 50% of the full sunlight range. With the new filter this can be reduced to 10% (or less).

New Code

Here is a sunset with the box placed in a window putting up with some ambient room light:

This looks quite promising. It will be interesting to see how much the peak altitude moves in full sunlight. Hopefully not much. I am expecting -3.3 degrees. I will probably have to look at a calibration factor based on the peak derivative value (a higher value should indicate a brighter sunset). 

Some results (assuming -3.0 altitude):

  1. 18.9333, 0.0000, 120.0000
  2. 5.9000, -31.9239, 116.7482

Well it off 80 km, it means I am not going to escape a poorly selected site, assuming no coding errors. It is a poorly selected sight because the longitude is off which means the sunrise and sunset are not equal intensity (which I know for this site).

Magic

Discussions