View previous topic :: View next topic |
Author |
Message |
artohautala
Joined: 17 Nov 2011 Posts: 187
|
logarithmic math question [solved] |
Posted: Tue May 09, 2017 7:24 am |
|
|
HI,
I'm very poor / bad in mathematics I can't undestand math so I'll be very happy if someone will help me to solve my problem ...
so I'm programming PIC18F452 and trying to get work logaritmic ambient light sensor
sharp GA1A1S202WP ...
I use 10bit AD-converter A0 in PIC - processor ...
AD-result 925 equals 100 000 lx...
How I can calculate those other values in logaritmic scale ?
I'll be very pleased if someone help me because I'm so bad in mathematics
best regards
-arto-
Last edited by artohautala on Tue May 09, 2017 9:12 am; edited 1 time in total |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Tue May 09, 2017 7:47 am |
|
|
That is an obsolete sensor.
The actual behaviour is simply uA/decade. So if (for instance) it gives 925 at 100000 lux (though beware this is slightly beyond the recommended top of this sensors operating range), it should give about 740 at 10000 lux.
Conversion is simple:
lux=(adc_reading/185)^5 |
|
|
artohautala
Joined: 17 Nov 2011 Posts: 187
|
|
Posted: Tue May 09, 2017 8:21 am |
|
|
Ttelmah wrote: | That is an obsolete sensor.
The actual behaviour is simply uA/decade. So if (for instance) it gives 925 at 100000 lux (though beware this is slightly beyond the recommended top of this sensors operating range), it should give about 740 at 10000 lux.
Conversion is simple:
lux=(adc_reading/185)^5 |
Thank you for your answer..
I know sensor is rather obsolete... but I have one and I like to use it ...
so maybe power of 5 is because there's 5 decades...
but where comes that number 185 ?
925/185 = 5, 5^5 = 3125 not 100000 as it should be... ?
-arto- |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
|
|
Posted: Tue May 09, 2017 8:52 am |
|
|
Sorry:
10^(adc_reading/185)
Yes, it is just 185 counts/decade. So 5 decades. |
|
|
artohautala
Joined: 17 Nov 2011 Posts: 187
|
|
Posted: Tue May 09, 2017 9:10 am |
|
|
Ttelmah wrote: | Sorry:
10^(adc_reading/185)
Yes, it is just 185 counts/decade. So 5 decades. |
Thank you ... I made excel table to solve this problem ...
and 10^(adc_reading/185) in that table works fine ! everything is OK !
Thank you so much
all the best for you
friendly regards
-arto- |
|
|
|