Go Down

Topic: Lux meter Project help (Read 2545 times) previous topic - next topic


Hi Everybody, I am Working on a light meter, I have Just "finished it" but I borrowed a real Lux meter and the values I get from the arduino are totally different... the formula I used is one I found in some other post.
This is the code I have used for the lux meter:
Code: [Select]

#include <ks0108.h> //  library for LCD
#include "SystemFont5x7.h"   // we need this for character display, included with ks0108.h download
int LDRPINA4 = 5;
float Resistance = 10.0;
int val = 0;

void setup()
GLCD.Init(NON_INVERTED);   // load the GLCD library
GLCD.SelectFont(System5x7);  // choose font to use (note this needs to match the #include above
GLCD.DrawRect(0, 0, 127, 63,BLACK);
GLCD.CursorTo(1, 1);
// set cursor to top left of LCD (uses character coordinates
// not pixel coordinates
GLCD.Puts("   Welcome To The"); // sends strings to LCD. Does not wrap to next line!
GLCD.CursorTo(1, 2);
GLCD.CursorTo(0, 3);
GLCD.Puts("Project Developed by:");
GLCD.CursorTo(1, 4);
GLCD.Puts("Sixto Llorens Zabala");
GLCD.CursorTo(1, 5);
GLCD.Puts("Student No: 08154978");
GLCD.DrawRect(0, 0, 127, 63,BLACK);
GLCD.CursorTo(1, 1);
GLCD.Puts("Lux Given in Lumens "); // sends strings to LCD. Does not wrap to next line!
GLCD.CursorTo(1, 3);
GLCD.Puts("       LUX\t=");
void loop(void)
float Vout5=LDRREADING4*0.0048828125;
int lux4=104.1*Vout5;

delay (20);

void countdown(int count){
  while(count--){  // do countdown 
    GLCD.CursorTo(10,3);   // first column, second row (offset is from 0)
    GLCD.PutChar(count + '0');

Please can anyone help me on it? can anyone suggest me where I went wrong? or what formula will be giving me the right answer?
By the way, I am using analog input A5... does that affect? This is because in the other posts everybody uses the analog input 0, but because I am using a GLCD my analog input 0 has been used for the screen.

I really want to get this project done as I have been working on it for quite a while now, has anyone attempted it? And got the right values?

Thanks in advance


Sorry for my english, Im spanish and I struggle to write it properly


like right now in m room, the real lux meter gives me 305 lux and my arduino 486
when the room is fully dark the real lux meter gives me 0 lux and the ardino 105-115.
when the real lux meter is put under the lamp it gives me 42600lux and the arduino 515

I am so comfused because I am stuck, and I dont know if with a new formula it will actually work


Also take a look at the real light meter you have - note that the light probably has to travel through some form of translucent disc  or diffuser before reaching the actual sensor. Your setup is missing this peice.

Also the light sensors on professional meters tend to have quite a large surface area as opposed to your LDR which has only a small surface area. These factors will both contribute to differing readings.

I had a play with something like this one.. it got too much of a headache and I moved onto something else for a while. Let me know how you get on!

I was using a TSL230R light to frequency IC. http://www.sparkfun.com/products/8940


thanks A lot,so you think by changeing the formula I will get the right values? it sounds a bit stupid buy I will try it, I was thinking about using a wheatstone bridge system to see what values I come out with, what do you think?

thanks in advance


Thanks! but apparently i should be getting values from 0 to 1023, I used to get those when I used a different LCD (16x2). but anyway I will try to callibrate the lux meter with the formula and the explaination you gave me!


Go Up