cactus.io logo

How to Hookup Keyes K853518 LDR Module to an Arduino

The Keyes K853518 breakout board is based on a LDR (Light Dependent PhotoResistor). It is a simple device that has the characteristic of changing its resistance based on the amount of light that hits it. Its resistance will be lower when a light is shone on it. When the light is removed the resistance will be at it's highest. The breakout board is fitted with a pull down resistor on the breakout board. Using the cable that was supplied with the board we can connect it directly to the Arduino board.

Images

Keyes K853518 breakout board
Note: Images shown on this page are not to scale.

Parts List

  • Arduino Board
  • Keyes K853518 LDR breakout board.
  • Breadboard hookup wires
  • USB Cable to suite Arduino

Circuit Diagram

Keyes K853518 breakout board circuit

The breakout board circuit is configured as a voltage divider with a 10K pull down resistor mounted on the board. The voltage that appears at the out pin will vary depending on the amount of light hitting the LDR. The LDR can be connected to either 5V or 3.3V.


Wiring Diagram for connecting the Keyes K853518 LDR module to the Arduino Board

Wiring up the sensor requires only the ldr and a pull down resistor. We are using a 10K (R1) pull down resistor. We can wire up to the 5V or 3.3V power pin on the Arduino. It just means the voltage output to analog input when using the 3.3V power pin will be lower.


Connect Arduino to Keyes K853518 breakout board
Note: Images shown on this page are not to scale.

Software

To test this sensor we can use sample sketch shown below. You can download the sketch file. It reads the LDR on the Keyes K853518 board every 0.5 seconds and prints the results to the console on the computer connected to the USB port on the Arduino. We do not require any libraries for this sketch.

We are using analog pin A0 to connect to the sensor. If you are using a different analog pin then you will need to change the pin number defined on line 9 in the sketch code.

Keyes K853518 Sample Sketch
Download as (Arduino Sketch) (Text File)
1
// Example Sketch for Keyes K853518 LDR Module (Light Dependent PhotoResistor).
2
// It reads the voltage at the OUT Pin and displays it on the console. The value should
3
// range from 0 to 1024. The lower the value the lower the light. The higher
4
// the value means more light being received by the LDR.
5
// Written by cactus.io. For more details and how to hookup the Keyes K853518 LDR module to
6
// the Arduino then visit this link.
7
// http://cactus.io/hookups/sensors/light/ldr/hookup-arduino-to-keyes-k853518-light-sensor-module
8
9
int OUT_Pin = A0; // what pin on the arduino is the OUT pin connected to
10
11
void setup(){
12
Serial.begin(9600);
13
Serial.println("Keyes K853518 LDR Module Example Sketch | cactus.io");
14
}
15
16
void loop(){
17
Serial.println(analogRead(OUT_Pin));
18
delay(3000);
19
}

Sketch Output

Keyes K853518 breakout board Sample Console Output

License