How to Make Luxometer using Arduino Uno

Has
3 min readJan 17, 2020

--

Things You’ll Need

  • Photo resistor (LDR)
  • Resistor (1 kilo ohm)
  • Male pins
  • Bread board /Matrix board
  • Arduino Uno Board
  • Computer
  • Arduino compiler
  • Arduino connector

1.Connect one pole of photo-resistor to 1 kilo Ohm resistor in series. You can do it using breadboard or matrix board.

2. Connect the 1 kilo ohm resistor to ground (GND) pin of Arduino Uno board.

3. Add another connection to the junction where you connected photo resistor to 1 kilo ohm resistor and connect it to analog pin 0 (A0) of Arduino board.

4. Connect the other pole of photo resistor to +5 volt of Arduino uno board. Now the hardware part of luxometer is complete.

5. Connect Arduino board to your computer via USB port and open Arduino code compiler program.

The Code:

Source

/* Compatibility : Arduino Uno / Arduino Genuino
* One pole of photoresistor connected to Analog pin 0
* Another pole of photoresistor connected to +5v
* Analog pin 0 is connected to GND via 10 k Ohm.
*/
const int Sensor = A0;
int SensorValue = 0;
float Lux = 0;
float Resistance = 1; // 1 kilo Ohm
float Voltage = 0;
float Source = 5;

void setup() {
// Initialize serial port communication at 9600 bps:
Serial.begin(9600);
}
void loop() {
// Read the analog in value:
SensorValue = analogRead(Sensor);
// Calculations for getting voltage
Voltage = Source*SensorValue;
// Voltage Drop Across Resistor
Voltage = Voltage/1023;
// Voltage across resistor
Voltage = 5-Voltage;
// Equation for finding light intensity in Lux
Lux = 2500/Voltage;
Lux = Lux-500;
Lux = Lux/Resistance;
// Print the results to the serial monitor for debugging purposes:
/*Serial.print("Sensor Value = " );
Serial.println(SensorValue);
Serial.println(Lux);
// Delay for 10ms, since latency of photo resistor is 10ms
delay(10);
}

6. Click upload button on upper left of the compiler or simply press Ctrl+u. It will upload the program into Arduino uno board. Wait until it is finished.

7. Go to “Tools >> Serial Monitor” in Arduino compiler or simply press Ctrl+Shift+m. This will open a serial port monitor, displaying current light intensity.

Tips

  • You can change pin numbers and resistance in the program for your convenience.
  • Carefully install pins.
  • Using bread board will make it a lot easier.
  • Use double side male pins.
  • You can also use reverse biased LED as a photodetector.

Warnings

  • Do not use resistors of low values as it will short circuit your board.

--

--

No responses yet