 In this video, we are going to learn all about LDRs, how they work, how to interface them with prototyping boats, like Ibai Vinado Eno using picture blocks, and what one does we can create using them. Let's begin. LDR is an acronym for light dependent resistor. LDRs are tiny light sensing devices, also known as photo resistors. And LDR is a resistor whose resistance changes as the amount of light falling on it changes. The resistance of LDR decreases with increase in intensity of light. This property allows us to use them for making light sensing circuits. To use an LDR, we always have to make voltage divided circuit. When the value of the resistance of an LDR increases in comparison to the fixed resistance, the value of the voltage across it also increases. We will be using Ibai's analog input pin to observe this change. But before we move ahead, let's talk a little about signals. A signal is anything that carries some sort of information. It can be an action, a sound, or any type of moment. Any signal can be classified as an analog signal or as a digital signal. Analog signal is a signal that represents all of the possible values in a given range as it varies with respect to time. It is analogous to the time varying quantity it represents. On the contrary, a digital signal is a signal that represents a quantity as a series of discontinuous values. The digital signal can represent only two values, high and low. An LDR is an analogous device. Its resistance changes gradually, not in discontinuous steps. Now that we know how an LDR works, let's see how to interface it with Ibai's and see it in action. Connect the LDR and 4.7K ohm resistor in series. Connect the common leg of LDR and resistor to the A0 pin on Ibai. Connect the 5 volt pin to the first leg of the LDR. Connect the ground pin to the end of the resistor. Now let's visualize the change in the resistance of the LDR on Ibai's pin state monitor. Switch Ibai on. When you navigate to pin state monitor, select analog pin states. Observe the value in front of the A0 pin. As the light decreases, the value also decreases and vice versa. Now let's create a script to control an LDR in Pictoblocks. Pictoblocks is a graphical programming software based on scratch blocks. You can download it from the link given in the description box below. Before doing anything else, connect Ibai to your computer using a USB cable. Next, open Pictoblocks. Then click on the board button and select Ibai from the drop-down. Now from the dialog box that appears, choose the appropriate serial port. We are going to create a script to change the backdrop of Pictoblocks' stage according to the amount of light incident on the LDR. First, open backdrop library and select two backdrops. We are selecting Metro and Night City with Street for day and night respectively. To obtain the values from LDR, we will use a read analog sensor block and select light or photo resistor from the drop-down. Select the pin to which it is connected from the second drop-down. Use an F-block and a less than operator block to check whether the value obtained from the LDR is less than 100 but is less than 100. Our job should change to the Night City with lights. Otherwise, we will keep Metro as our backdrop. Now we want the script to run forever. So, we will add a forever block around it. Next, we'll place a when flag clicked head block above the forever block. It will ensure that the script runs when the green flag is clicked. Everything is perfectly fine. Let's create a script to work with LDR without being if I've connected to the computer. For that, we'll have to work in the upload mode. We will make the LDR connected to pin 13 turn on when the light incident on the LDR is low. First, switch to the upload mode. Now, add a read analog sensor block to get the value of the analog sensor, that is the LDR. If the value is less than 100, then the LED should turn on. Therefore, from the evives palette, add a set digital pin block and set the output as high. If the value is more than 100, it means that the light is bright. Therefore, the pin 13 LED should turn on. Duplicate the set digital pin block and place it below the L sign. Select low from the second drop down. Use a forever block to run the code continuously. Place the when evive starts up head block to execute the program. If you know how to work with LDR, you can use it to make projects like a DIY Solar Tracker, Smart Street Light and much more. That's it for this video. If you liked it, give it a thumbs up and share it with your friends. For more such educational content, subscribe to STEMpedia and follow us on Facebook, Instagram and Twitter. Bye-bye.