Step 1: Gather Parts and Tools
- A few Jumper Wires
- 9 Volts Battery
- 9 Volts Battery Clip
- Light Dependent Resistor (LDR)
- Light Emitting Diode (LED) with any color of choice
- TLC3704 Quad Comparator (only one of its four comparators will be used) (Alternatively, you can use the single LM311N Comparator with 8pin)
- 3362P-103-ND 10K Ohms Variable Resistor
- 1K Ohms (Brown-Black-Red) Resistor X2
- 330 Ohms (Orange-Orange-Brown) Resistor
- Variable Resistor Trimmer Pen (or a small screwdriver)
- Needle-nose Pliers (not essential but useful for breadboarding)
Step 2: Understand How It Works
Like its name suggests, a comparator compares two given voltages. The pair of 1K ohms resistors create a voltage divider and provide a 4.5 volts reference for the comparator. The variable resistor and LDR both form another pair for a second voltage divider. When light falls on the LDR, its resistance lowers and that voltage divider provides a voltage lower than 4.5 volts. The comparator produces no output (0 volts). When light is absent, the resistance of the LDR and the voltage increases. When the voltage increases over 4.5, the comparator activates its output and supplies 9 volts to power the LED.
An interactive flash animation of how the circuit works can be accessed by clicking here or on the file below.