Light Intensity Sensor Module 5528 Photo Resistor Arduino review and code
This post is a review of the “Light Intensity Sensor Module 5528 Photo Resistor” and includes code and images to use the sensor.
There are a couple variants of this light sensor sold by different companies but all have similar components and designs. This model is sold by HiLetgo CN and is available on amazon (link below).
Comments about the Sensor
This sensor is built around a light dependant resistor. This is a component whose resistances changes depending on the light level.
Normally if you are using a light dependant resistor you need to measure the current resistance of the component. However this isn’t required as the circuitry takes care of this.
The sensor has three pins marked as GND, VCC and SIG. GND is where you would connect your ground signal. VCC will be your “high voltage”, the data sheet recommends 5 volts. SIG is the current value of the sensor in volts. With 5 volts provided to its VCC connection the range of SIG will be between 0 and 5 volts. 5 volts will represent a high light intensity and 0 volts will represent a low light intensity.
The light readings obtained from this are only relative light levels. This means that if you read 3 volts at one time, and 4 volts later you know that the light intensity has gone up. However you cannot turn this into a specific light intensity (typically measured in lumens).
Testing the light sensor
To test the sensor I wired it up to an Arduino Uno as shown below in the schematic and image.
Once it has been wired up I wrote the below code to read the value of the sensor every 2 seconds and print it out on the serial port. This was logged by my computer and stored in a file.
#define ANALOG_IN_PIN 0 int sensorVal = 0; void setup() { Serial.begin(115200); } void loop() { sensorVal = analogRead(ANALOG_IN_PIN); Serial.println(sensorVal); delay(2000); }
Once I had stored the data I was able to process it into a graph for better review. On the graph below I plotted the sensor value in red. In addition to this I plotted the maximum sensor value (1023) and the minimum sensor value (0). The final line plotted is the base sensor light level. When testing the sensor it was placed in a room with LED lights at a constant brightness. This ensured that the light level would not change due to outside interference.
By reviewing the graph above you can see that the base light level remains stable during the experiment. The sensor quickly returned to the initial light level after changing the brightness it was exposed to. This also shows that the sensor is reliable at returning to the same values after changing light levels.
I was able to easily reach quite close to the maximum and minimum by using a strong light source and covering the sensor completely. In addition by changing the amount of light the sensor was exposed to I was able to reach a variety of different light levels.
When maintaining the same light level the sensor appears quite stable and there is a minimum amount of noise in the readings. I have observed that it is also very fast to return to normal light readings.
Overall Review – Would buy again
For the price of the sensor this is a great pick to measure relative light levels. The circuitry to provide a simple signal wire to read the light level eases the implementation of the sensor. This also reduces the requirements compared to a standard light dependant resistor. The range of values the sensor can produce is definitely sufficient for general light level monitoring. Although it cannot measure a specific lumen value no sensors at this price range can so this is not a great loss.
Overall I would definitely recommend this sensor to use it in your project.
The product I purchased to test is available on Amazon.