calculate equation from measured data

gillestugan

Enlightened
Joined
Nov 20, 2007
Messages
242
Location
Nora, Sweden
I want to use a photoresistor as light meter, so I need to be able to translate the resistance to lux-level. I have made some measurements with a borrowed light meter, so I have both resistance and corresponding light levels.
But now Im having trouble calculating the equation for the graph the values produce. The resistor is logarithmic and its been too long since my math classes. I need a equation in the form Lux= x*Ohm to use in excel, but it will probably not be that simple...

Does anyone know how to do it? (or have a program that can do it)

Here are the numbers:

lux ohm
10,4 14700
21,0 7500
24,8 6440
27,4 5910
54,3 3140
119,0 1700
148,0 1400
195,0 1050
292,0 732
481,0 494
648,0 388

And this is what the graph looks like when set to logaritmic scale.


my.php


my.php
 
In Excell, right click your data > add trendline > select "power" > show equation on chart

TaDa!!

You may have to format the equation to show more decimal places for accuracy. You can do that by right clicking it.

Edit:
Your data is reversed in your graph. You want lux vs ohm plotted. You have the opposite.

I get lux= 567389*ohm^(-1.143) with R^2 = 0.9994
 
Last edited:
That's pretty neat; it looks like your graph is a nice straight line.

In that case, your function will be of the form

log(Lux) = a log(ohm) + b

You can calculate the values of a and b by doing a linear regression on a table of log(lux) and log(ohm). I'm pretty sure Excel can do that for you, or many ordinary scientific calculators can do it too.

Sorry I can't do the calculations for you right now, but maybe someone else will step in, or maybe you can figure it out.

Edit: Or Marduke might even tell you how to make Excel do magic!
 
You have a nearly straight line on a log-log plot, which means that you should be fitting a power law function. You can do this through the Excel trendline.

Also, you should reverse the axes, so that you get lux as a function of ohms.
 
Thanks a lot! That is just wonderful. You guys are wonderful!

I had been trying to solve it for almost two hours.
Had no idea I could use excel graph for it.
 
Top