Author Topic: Length of sunlight using a lux sensor?  (Read 600 times)

0 Members and 1 Guest are viewing this topic.

Offline vecerapl

  • Member
  • *
  • Posts: 8
    • Napajedlaci.cz
Length of sunlight using a lux sensor?
« on: August 26, 2020, 04:13:58 AM »
I would like to count how much time the sun shines all day. I have a BH1750 sensor, but I can't calculate 100% too much sunlight with that. During the day I will reach 54613 lux, but even though it is now clear, the sun will set in an hour, so lux is only 2423.

Has anyone tried it yet?

Offline sky_watcher

  • Member
  • *
  • Posts: 47
Re: Length of sunlight using a lux sensor?
« Reply #1 on: August 27, 2020, 02:30:59 AM »
I would like to count how much time the sun shines all day. I have a BH1750 sensor, but I can't calculate 100% too much sunlight with that. During the day I will reach 54613 lux, but even though it is now clear, the sun will set in an hour, so lux is only 2423.

Has anyone tried it yet?
Not sure what you mean by "but I can't calculate 100% too much sunlight with that."

The World Meteorological Organization (WMO) definition of ‘sunshine’ is ‘the duration of the period for which the direct solar irradiance exceeds 120 W/m². Are you using this definition, or something else?
“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Weather Uploads: WU | WOW | Ecowitt

Online johnd

  • Forecaster
  • *****
  • Posts: 3822
    • www.weatherstations.co.uk
Re: Length of sunlight using a lux sensor?
« Reply #2 on: August 27, 2020, 03:38:38 AM »
The World Meteorological Organization (WMO) definition of ‘sunshine’ is ‘the duration of the period for which the direct solar irradiance exceeds 120 W/m². Are you using this definition, or something else?

Please don't overlook that word 'direct' in the definition. All non-high-end stations (including Davis) that I know of use a global or whole-sky light sensor which measures total irradiance and not direct irradiance (ie direct + indirect). Measuring direct irradiance only needs a sophisticated and costly sensor such as a tracking pyranometer. And using that definition of direct sun when your data is actually total sun is pretty much guaranteed to cause major errors. There are algorithmic ways of trying to guesstimate sunshine hours from total irradiance data, but they're not trivial to implement.
Prodata Weather Systems
Prodata's dedicated Davis EnviroMonitor website
UK Davis Premier Dealer - All Davis stations, accessories and spares
Littleport, Ely, Cambs UK

Sorry, but I can't help with individual issues by email. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 5747
Re: Length of sunlight using a lux sensor?
« Reply #3 on: August 27, 2020, 03:47:46 AM »
But there is also another issue to contend with. The OP is using a Lux sensor which is not the same thing as a solar radiation sensor. It does not output W/m2.

I do though have a recommendation. Fine Offset stations also use a Lux sensor and then liberally use a conversion factor to take Lux and approximate W/m2. This yeilds a result that is an average that does not work so well for all locations given their climate and Latitude. Therefore it is important to adjust this accordingly to get a better approximation. Fine Offset stations have a calibration adjustment to address this.

The conversion factor used is to take Lux and divide it by 126.7 to arrive at W/m2.

Explanation:
https://help.ambientweather.net/help/why-is-the-lux-to-w-m-2-conversion-factor-126-7/

« Last Edit: August 27, 2020, 05:20:32 PM by galfert »
Ecowitt GW1000 | Meteobridge (WeatherBridge)
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Online johnd

  • Forecaster
  • *****
  • Posts: 3822
    • www.weatherstations.co.uk
Re: Length of sunlight using a lux sensor?
« Reply #4 on: August 27, 2020, 04:13:51 AM »
@galfert: All true of course in the explanation of radiometric (w/sqm) vs photometric (lux) units, the latter being adjusted for the spectral sensitivity of the human eye.

But I'm not sure that it matters much if you take an empirical approach to trying to estimate bright sunshine hours from the lux data (which I think is what the OP is aiming for).

You have to devise an algorithm to estimate - on the fly - the maximum (in this case) lux value that your sensor could theoretically see for your lat/long, day of the year and (solar) time of day. Then compare your measured value to the max value and define a cutoff value above which you deem the light level to be bright sunshine. The necessary formulas are all on the web in various places though do need implementing with care over such niceties as being sure which quadrant an arctan value is ending up in. 

A threshold of around 50% or a little less often works out about right but it really needs fine-tuning against some reference data to be optimal. This is only an approximation of course and particular sky conditions can catch it out. But for monthly sunshine hours totals - where over and under spot estimates tend to cancel out - it can be more accurate than one might imagine.
« Last Edit: August 27, 2020, 05:28:44 AM by johnd »
Prodata Weather Systems
Prodata's dedicated Davis EnviroMonitor website
UK Davis Premier Dealer - All Davis stations, accessories and spares
Littleport, Ely, Cambs UK

Sorry, but I can't help with individual issues by email. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 251
    • test site
Re: Length of sunlight using a lux sensor?
« Reply #5 on: August 27, 2020, 05:04:29 PM »
But does anyone understand what the original question is ?

His site is full of manipulated data for the sensor readings, but ...
Quote
During the day I will reach 54613 lux,
there is a suspiciously constant flat-line @  54613 lux - so averages are going to be wrong at least.
Imagine what you will KNOW tomorrow !

Offline sky_watcher

  • Member
  • *
  • Posts: 47
Re: Length of sunlight using a lux sensor?
« Reply #6 on: August 27, 2020, 09:51:25 PM »
But does anyone understand what the original question is ?
I think that he is saying that his sensor saturates before noon, hence the flat line readings. A neutral density filter would help fix it if that is the issue, but at the expense of the sensitivity near dawn and sunset.

By attempting to adjust the reading for the increased atmospheric path near dawn and sunset, I think that he is looking to detect if there is cloud between the Sun and the sensor over the total time the Sun is over the horizon. This is different to the W/m2 methodology.

However, this is just a guess.
« Last Edit: August 27, 2020, 10:46:03 PM by sky_watcher »
“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Weather Uploads: WU | WOW | Ecowitt

Offline the beteljuice

  • the beteljuice
  • Senior Contributor
  • ****
  • Posts: 251
    • test site
Re: Length of sunlight using a lux sensor?
« Reply #7 on: August 27, 2020, 10:35:56 PM »
So he needs to address the over-saturation of the sensor and then do a "Hours Sun" script (If his software [homebrew ?] doesn't already cover it.)
Imagine what you will KNOW tomorrow !

Offline vecerapl

  • Member
  • *
  • Posts: 8
    • Napajedlaci.cz
Re: Length of sunlight using a lux sensor?
« Reply #8 on: August 31, 2020, 03:46:44 AM »
What I found out is that the BH1750 has a conversion to W/m2: lux * 0.0078. And sunshine is calculated from 120 W/m2

What do you think about it?

Offline galfert

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 5747
Re: Length of sunlight using a lux sensor?
« Reply #9 on: August 31, 2020, 04:28:28 AM »
What I found out is that the BH1750 has a conversion to W/m2: lux * 0.0078. And sunshine is calculated from 120 W/m2

What do you think about it?

Multiplying by 0.0078 is almost the same thing as dividing by 126.7. But it is better to divide by 126.7 because you'll get better precision. That is why my earlier post recommended dividing by 126.7.

1/126.7 ~= 0.0078926598263614838200473559589582

The premise is this...when you need one third of something you don't multiply by 0.3333, rather you divide by 3.

« Last Edit: August 31, 2020, 05:56:40 AM by galfert »
Ecowitt GW1000 | Meteobridge (WeatherBridge)
WU: KFLWINTE111  |  PWSweather: KFLWINTE111
CWOP: FW3708  |  AWEKAS: 14814
Windy: pws-f075acbe
Weather Underground Issue Tracking
Tele-Pole

Online johnd

  • Forecaster
  • *****
  • Posts: 3822
    • www.weatherstations.co.uk
Re: Length of sunlight using a lux sensor?
« Reply #10 on: August 31, 2020, 04:50:49 AM »
What I found out is that the BH1750 has a conversion to W/m2: lux * 0.0078. And sunshine is calculated from 120 W/m2

Read my post above please. The conversion to sunshine hours only works if you're measuring DIRECT solar irradiance (ie sunshine). Your sensor does not measure that. Re the conversion from lux to W/sqm - I suspect that's just an approximation, which may be OK - it's the conversion to sun hours that I'm commenting on.

Quote
What do you think about it?

A poor choice TBH.
« Last Edit: August 31, 2020, 05:48:46 AM by johnd »
Prodata Weather Systems
Prodata's dedicated Davis EnviroMonitor website
UK Davis Premier Dealer - All Davis stations, accessories and spares
Littleport, Ely, Cambs UK

Sorry, but I can't help with individual issues by email. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline sky_watcher

  • Member
  • *
  • Posts: 47
Re: Length of sunlight using a lux sensor?
« Reply #11 on: August 31, 2020, 05:44:40 AM »
What I found out is that the BH1750 has a conversion to W/m2: lux * 0.0078. And sunshine is calculated from 120 W/m2

What do you think about it?
I have found a range of lux -> W/m2 conversion factors for silicon devices. I can't see a conversion factor listed in the datasheet, so 0.0078 seems a reasonable place to start experimenting.

From the datasheet, the directional characteristics of the BH1750 may cause a mount orientation issue. By 45 degrees away from perpendicular to the sensor face, response has dropped to between 50% to 60% of the maximum response, depending on the orientation of the sensor face. By 60 degrees, its down to 30% to 40%, depending on orientation.

Bear in mind that you are measuring whole of sky radiation, not just direct radiation. Unless you are trying for a scientific paper, this is not a fatal flaw for experimentation. What this will mean is that you will have an error band around your readings due to the presence or absence of clouds. That is, the reading with direct sunlight surrounded by dark clouds will be lower than what you will get with a clear sky, but it will be higher if there are reflective clouds (like Cumulus) around as more radiation will be reflected to the sensor.

If you are just looking to detect bright sunlight, you need to see what readings you can expect under a variety of cloud conditions. In my location, I haven't seen any conditions (away from sunrise/sunset) where the cloud in the area reduces the reading so much that direct sun on the sensor can't be detected as sunlight, or increases it so much that I confuse reflected sunlight with direct sunlight.

If you want a calibrated power reading of direct sunlight, you have the wrong setup. If you are happy to experiment, you can get a good idea of when there is direct sunshine on the sensor. As far as using multiplication or division goes, I think that the other uncertainties will swamp any variations between using multiplication or division.

« Last Edit: August 31, 2020, 08:51:41 AM by sky_watcher »
“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Weather Uploads: WU | WOW | Ecowitt

Offline vecerapl

  • Member
  • *
  • Posts: 8
    • Napajedlaci.cz
Re: Length of sunlight using a lux sensor?
« Reply #12 on: August 31, 2020, 09:59:25 AM »
What sensor to buy so i can measure sunlight, light?

Offline PaulMy

  • Forecaster
  • *****
  • Posts: 4729
    • KomokaWeather
Re: Length of sunlight using a lux sensor?
« Reply #13 on: August 31, 2020, 10:04:44 AM »

Quote
What sensor to buy so i can measure sunlight, light?


The Blake-Larsen Sunrecorder http://www.sunrecorder.net/


Enjoy,
Paul

Offline vecerapl

  • Member
  • *
  • Posts: 8
    • Napajedlaci.cz
Re: Length of sunlight using a lux sensor?
« Reply #14 on: September 08, 2020, 02:06:49 AM »
What to use sfh203p for example? That could work.

Online johnd

  • Forecaster
  • *****
  • Posts: 3822
    • www.weatherstations.co.uk
Re: Length of sunlight using a lux sensor?
« Reply #15 on: September 08, 2020, 03:31:13 AM »
What to use sfh203p for example? That could work.

Why would that be any different to your existing lux sensor?

The problem is that all of these sensors can only measure TOTAL or whole-sky sunlight (irradiance). To repeat previous answers, you have two choices:

1. Buy a sensor that points at the sun throughout the day and measures DIRECT irradiance. In general, these are very expensive though there are alternatives such as the BL sensor referred to above.

2. Use software that can estimate sunshine hours from whole-sky irradiance data.

Those are your only choices.
Prodata Weather Systems
Prodata's dedicated Davis EnviroMonitor website
UK Davis Premier Dealer - All Davis stations, accessories and spares
Littleport, Ely, Cambs UK

Sorry, but I can't help with individual issues by email. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline sky_watcher

  • Member
  • *
  • Posts: 47
Re: Length of sunlight using a lux sensor?
« Reply #16 on: September 08, 2020, 04:06:28 AM »
What to use sfh203p for example? That could work.

Why would that be any different to your existing lux sensor?

The problem is that all of these sensors can only measure TOTAL or whole-sky sunlight (irradiance). To repeat previous answers, you have two choices:

1. Buy a sensor that points at the sun throughout the day and measures DIRECT irradiance. In general, these are very expensive though there are alternatives such as the BL sensor referred to above.

2. Use software that can estimate sunshine hours from whole-sky irradiance data.

Those are your only choices.
I don't think that is point of the question. The graph from the previous sensor appeared to show that the sensor saturates during the day.

A new sensor or a light reducing filter is first needed to prevent saturated readings, before option 2 would make any sense at all.

I haven't had an in-depth study of the sfh203p datasheet, but the recommended use in a smoke detector or white goods does not seem to indicate it would be a good choice for full summer sun readings.

There are devices which are specifically designed to measure ambient light such the BH1730FVC which provides a 16-bit digital output using I2C and is good for 0.001lux to 100k lux. This device costs AUD$6.13 each from Element 14, so  it isn't expensive, but they are surface mount.






“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Weather Uploads: WU | WOW | Ecowitt

Online johnd

  • Forecaster
  • *****
  • Posts: 3822
    • www.weatherstations.co.uk
Re: Length of sunlight using a lux sensor?
« Reply #17 on: September 08, 2020, 04:36:00 AM »
I don't think that is point of the question.

Well, the original post does start off 'I would like to count how much time the sun shines all day.'.

I interpret that to mean sunshine hours, but maybe there are other interpretations. I'm not sure why a sensor saturating would prevent an estimate of total sunlight duration (ie dawn to dusk), which is the only other interpretation I can think of. If it is saturating (which sounds a bit surprising for a sunlight sensor) then it's still reading at a high level and wouldn't stop a dawn to dusk timing.
Prodata Weather Systems
Prodata's dedicated Davis EnviroMonitor website
UK Davis Premier Dealer - All Davis stations, accessories and spares
Littleport, Ely, Cambs UK

Sorry, but I can't help with individual issues by email. Please post your issue in the relevant forum section here & I will comment there if I have anything useful to add.

Offline sky_watcher

  • Member
  • *
  • Posts: 47
Re: Length of sunlight using a lux sensor?
« Reply #18 on: September 08, 2020, 04:39:11 AM »
I don't think that is point of the question.

Well, the original post does start off 'I would like to count how much time the sun shines all day.'.

I interpret that to mean sunshine hours, but maybe there are other interpretations. I'm not sure why a sensor saturating would prevent an estimate of total sunlight duration (ie dawn to dusk), which is the only other interpretation I can think of. If it is saturating (which sounds a bit surprising for a sunlight sensor) then it's still reading at a high level and wouldn't stop a dawn to dusk timing.
I believe he is trying to build his own, not repair a broken one.
“The more a man knows, the more willing he is to learn. The less a man knows, the more positive he is that he knows everything...” ― Robert G. Ingersoll

Weather Uploads: WU | WOW | Ecowitt