How to use The Photocell Module
The light sensor is a photoresist, which is also known as a light-dependent resistor or photocell. It is used not only to detect light but also to measure the brightness or illuminance level of the ambient light. It has a wide range of applications, such as measuring the brightness of ambient light and controlling the lights turning on and off.
How it works
The more light the photoresist’s face is exposed to, the smaller its resistance is. Therefore, we know how bright the ambient light is by measuring the photoresistor’s resistance.
In this article, we'll talk about the setup and wiring of the module operating with an Arduino Board. At the end of the tutorial, you will learn how to use the light sensor to control the light turning on and off depending on the illuminance level of the light.
Wiring
The light sensor module operates at 3.3V to 5V, while its analog input pin can convert the voltage (from 0V to 5V) to integer values (between 0 to 1023). There are a few types of light sensor modules in the market where some do not come with a potentiometer for adjusting the sensitivity. We will be using Photocell Module, the one we carry in our shop.
This module consists of 4 pins that allow it to connect to a microcontroller, like Arduino.
- GND: Ground pin to connect the sensor to the ground with the microcontroller
- VCC: Power pin for 3.3V to 5V operation voltage with the microcontroller
- D0: Digital output pin based on a predefined threshold through the potentiometer and the operation voltage of the microcontroller.
- A0: Analog input pin converts the voltage (between 0V and VCC) into integer values (between 0 and 1023), called analog value.