Karl Von Dyson has come out with unique application of photoresistors. He has successfully used the characteristics of light dependent resistors (LDRs) or photocells. They are used in transition process, home automation, gardening applications, and to control street lighting. Photoresistors are low-cost variable resistors and their resistance changes depending on the amount of light hitting its surface. For instance, in dark environments the resistance is high and vice versa in light environments. Hence, they are not suitable for measuring exact levels of light but are capable of detecting changes. Here Photoresistors are used by placing it inside an enclosure that can detect when it is opened or the presence of objects that block the sensor when inserted.
An Arduino or Arduino-compatible board with analog inputs and The Arduino IDE (integrated development environment) is needed to complete the project along with photoresistors (photocell/light dependent resistor), one 10Ko resistor, one 10Ko potentiometer and a breadboard and connecting wires.
As already mentioned, when the photoresistor is exposed to light and when light is blocked, the resistance of the photoresistor increases. It has similar effect on voltage too that is when resistance decreases, voltage reading will be higher and when increased, the voltage reading lowers.
Start experimenting with a diagram of a breadboard circuit. To ensure that at least some resistance is always present on the line, the photoresistor and the 10Ko resistor are powered by the Arduino 5V power supply and form a potential divider. It protects the Arduino from short circuits. A wire is connected from this circuit to the Arduino as resistors lower the voltage passing through them. To read changes in light from this circuit, the Arduino analog to digital converters (ADCs) is used to measure the voltage level of the input.
Create a basic sketch that reads the voltage level and outputs the value to the serial port, to check that everything is functioning correctly. Now create the voltmeter sketch by opening the Arduino IDE and Pasting in the code. Then save the sketch and upload it to your Arduino and watch the output. Detect changes in the light level as the exact values of output from the sketch might vary depending on several factors
The value that defines how much change is expected before something happens is set by sketch in the program code. This value is known as threshold and depends on environment and application. To avoid reprogramming of Arduino to the computer, a potentiometer is used to adjust the amount of resistance in the circuit as it is another type of variable resistor
To determine a new value for the variable threshold and for a digital approach, wire the pot in the same way as a photoresistor and read it using a second analog input.
More interesting projects for home automation and alarm systems, can be constructed using additional components like relays, motors, and wireless communication devices. For coding, streaming and minute details you can visit the website of Udemy.com
Filed Under: Reviews