ARDUINO TUTORIAL FOR BEGINNERS LESSON 9: DARK AND LIGHT ACTIVATED LEDs USING PHOTORESISTOR
Number nine photo resistor introduction a photo, resistor or photocell is a light controlled variable resistor. The resistance of a photoresistor decreases, with increase increasing incident light intensity. In other words, it exhibits, photo conductivity. A photoresistor can be applied in light sensitive detector circuits, unlike light and dark activated, switching circuits components, one arduino uno board, usb data cable, one photo resistor, one resistor with 10 kilo, ohms value, eight leds, each resistor with 220 ohms value, jumper wires and one breadboard experimental Principle, the resistance of the photoresistor changes with incident light intensity. If the incident light intensity is high, the resistance reduces if low increases in this experiment, we will use eight leds to indicate light intensity. The higher the light intensity is, the more led is lit when the light intensity is high enough. All the leds will be lit when there is no light. All the leds will go out. Lets build the circuit for experimental procedures. Step 1 build the circuit, so this will be our representation for our circuit, so we have eight leds, a two c stores, one 10 kilo ohms register and a photo resistor here and a jumper wires for the connection. This will be its schematic diagram for step. 2. Lets program it step 3, compile the code and step 4 upload, the sketch the arduino uno board. Now, if you shine the photo resistor with a certain light intensity, you will see several leds will light up. If you increase the light intensity, you will see more leds light up when you place it in a dark environment, all the leds will go out, so this will be a representation of what will will be the actual connection of the the leds, the resistors and the Connecting wires as well as the photo resistor whats up guys welcome to our lesson number nine.
The photo resistor things that we need for this project is, of course, the photo resistor. We have here the leds, so we have eight leds and then theyre 220 ohms 3c stores the connecting wires here. The breadboard and the arduino uno now lets try to assemble our circuit. So first lets try to attach the leds. So again, the longer side of these leds are the positive side and the other one the shorter one is. The negative lets try to make sure that the rights, the right side is the positive side and the left the left one is the negative. So we will uh try to arrange it on that way, so we can remember it if, even if we build other circuit Music now that we have attached all of these leds lets, try also to attach the photoresistor. So we we actually call this one ldr or light dependent, resistor, so lets attach it this way. Okay, lets attach it this way and then well connect the 220 ohms on the positive side of the leds and lets make sure that we can jump it. The other way, also, as you can see here, i have to from this point on the right side – ill jump it here. So we can, we can connect, so we can have connection from this side here on to this side. Okay, so lets do it on the eight leds Music. Let us also connect a resistor on our photo resistor just to limit the connection.
I think its safe, that we put this this way. Music, now that we have attached the leds and the resistors its time for us to connect uh common ground for these resistors. So by saying that we need to connect a common ground lets attach a the ground from this arduino to one of the sides here. So lets just use the blue one Music, so from um. The arduino now lets use the black wires and white wire to attach the negative side of the leds to this side. Blue lines that we have settled for this ground of the leds. Okay lets: do it? Music and now lets connect a ground wire from this point of the resistor here. Its line here and put this on the blue line. Thats the ground and now lets try to connect all these leds to the pins of the arduino. So we have pins five to twelve um for us to easily attach this. One lets start from this led: 12 pin number 12 eleven, ten, nine, eight seven, six, five, okay and the connection for this um photo easy store will go to the pin a0 and now lets attach the wires so lets lets use red wire. So if you can see this one um the straight line from the positive side straight with the resistor to the pin of the arduino, so, for example, lets line this in here and then connect it to pin number 12. Music.
Okay, Music lets connect this side. This side here to pin a0 move the arduino. This is pin a0 here, a02 a5 pin a0 and the other side will be on pin number of 5 volts of the arduino from here to the five volts of arduino, which will be which is located here, Music. So basically, this is our setup for our autoresistor circuit diagram. Okay, now lets try to uh make it function, make it work and now lets try how this um diagram works. First, i will be turning off my lights here to see if we can make any difference. Lets turn off first and the other one lets turn it off and im gon na turn off also the lights here. I have minimal light here, so lets use my cell phones flashlight here, Music softwares flashlight since its dark, it doesnt light anything, but when its exposed to sunlight or to a light, it will light up the um, the leds, okay, Music. We can also do it. The opposite way so now guys this is uh a modified code that i uploaded to my arduino uno, so whenever it senses um a value less than 50, which means that it also detect the uh darkness lets just say this is the sun. So when its on a daylight, it will not turn on, but if it senses dark already, you can try this one and it the leds, will turn on. So basically, the concept of this one is that, for example, you have a light which is always turned on you, make it automatic um by making it turn on only if its dark already using the photo resistor.
So thats, one big one, um application of this project.