Introduction: Light/Dark Detector Using an Op-amp
This is a simple demonstration showing how to use an op-amp and a photocell to sense light or darkness.
You will need:
- LM741 Op-amp Digikey part #LM741CNNS/NOPB-ND
- 10 kΩ 1/4 Watt resistor Digikey part #CF14JT10K0CT-ND
- 470 Ω 1/4 Watt Resistor Digikey part #CF14JT470RCT-ND
- Photocell https://www.adafruit.com/products/161
- 10 kΩ Trim pot https://www.adafruit.com/products/356
- 5mm Red LED https://www.adafruit.com/products/299
- 22 gauge hookup wire and/or jumper wires
- 3.3 - 6 Volt power source *
* In the picture the Arduino is only being used as a power source.
Step 1: Build the Circuit
Build the circuit according to the diagram.
The red dot on the chip indicates pin one.
The resistor in series with the LED is not critical. It can be anywhere between 330 to 560 Ohms. I recommended a 470 Ohm because most resistor kits contain it. I substituted a 560 Ohm because I have lots of them.
There are many different op-amp chips available, and just about any of them will work. I chose the LM741 because it is what I have on hand. If you use a different chip be sure to check the pinouts. I have seen op-amps with four different pinouts. For instance Adafruit and SparkFun sell dual op-amp, eight pin chips that have different pinouts.
Step 2: Testing
The trim pot adjusts the sensitivity.
The way the circuit is wired it is a light detector. In a reasonably dark room the LED will be off. Shining a light on the photocell will cause the LED to light.
If you reverse the wires to pins two and three it will be a darkness detector. In darkness the LED will be on, and shining a light on it will cause the LED to turn off.