A photoresistor or photocell is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity. A photoresistor can be applied in light-sensitive detector circuits, and light- and dark-activated switching circuits. It’s also called light-dependent resistor (LDR).
In this tutorial you will learn how to use a photoresistor with and without arduino uno.
For those beginning to learn about robotics, particularly in the area of building circuits, you may have come across the question of how to change the brightness of a LED, without having to keep switching parts. Quite simply, the solution to this issue is a potentiometer.
In this example you will learn how to fade an LED by using analogWrite() function. AnalogWrite uses pulse width modulation (PWM), turning a digital pin on and off very quickly, to create a fading effect.
Before we start let’s learn more about PWM
LEDs (Light-emitting diode) can be found on many collors and sizes.
This example shows the simplest thing you can do with an Arduino to see physical output: it blinks an LED!
In this tutorial you will also learn how to use pinMode(), digitalWrite() and delay() functions.