Introduction: Light Detector

In this project, we will build a light detector circuit on the breadboard using some simple components that we can easily buy on the internet. The purpose of the circuit is when we place it at the place, if there is light from any sources like the sun, or lightbulb, it will turn on the circuit and give out a signal to an output source. In this case, we will use the speaker as our output source. In this experiment, we use the circuit in a room, if there is light, the circuit turns on and gives the signal to the speaker.

How does the circuit work? It uses the light sensor or photocell (LDR) acting as a resistor, as the light is bright, the resistor value of the photocell (LDR) is low, and vice versa. Another important component in the circuit we will use is a single operational amplifier (or 555 timer), this 555 timer works with the photocell (LDR) to determine the output of the circuit. We will find out more about it in step 2.

Applications of the circuit:

- Turn on the water switch for water plants in the morning.

- Open or close the curtain depending on whether the sun is shining.

- Use it for security purposes, for example, turn off the light at the museum at night and if someone uses the flashlight to steal arts, ... the alarm will be triggered.

- Use it to detect when the sky is cloudy, tell people to close windows, and take stuff inside the house so it doesn't get wet.

The 555 timer, widely available and affordable, serves as an ideal choice for various electronic applications. Its versatility allows it to be easily configured for tasks ranging from timing circuits to pulse generation. Specifically, its direct compatibility with speakers makes it a convenient option for beginners venturing into audio projects. Whether for educational purposes or hobbyist endeavors, the 555 timer remains a reliable and accessible component in electronics.

Supplies

22k resistor

10k resistor

Potential resistor (100k)

220 resistor (This resistor can be changed depending on the needs)

100n capacitor

10n capacitor

10u capacitor

LM741 Single Operational Amplifier (555 timer)

Photocell (LDR)

Speaker

Jump wire

Breadboard

9V power supply

Step 1: Create the Circuit

Follow the directions in Figure 1 and build the circuit. There are some cautions when you connect the wire in Figure 1, there are some wires that cross over each other, be aware that only the junctions have the green circle dot connected. If they don't have that, it means they just cross over each other without connecting. If you want to have a closer look at the circuit, visit here in the lush project.

Figures 2 and 3 give a better look at how to connect the wire to it as it might confuse you. As the diagram in Figure 3, pins 1 and 2 are connected to the negative (ground side), and pin 3 is the output. Changing the resistor value from the dial button on the potential will affect the sensitivity of the circuit (explanation in step 2).

Step 2: How Does Light Detector Circuit Work?

I divide this circuit into 4 different sections:

- Section A: This is the part that will decide the sensitivity of the circuit. The photocell (LDR) will have different resistance values depending on the brightness of the light. If the brightness is high then the resistor value is low so the circuit pulls voltage from the positive side and turns on the circuit and speaker. Otherwise, the photocell (LDR) will have a high resistor in the dark and the circuit pulls voltage from the negative side, then the circuit and speaker are off. I said earlier we can change the sensitivity of the circuit depending on your need, resistor 3 (R3) is the one you can change. The photocell (LDR) has a resistor value of up to 1M ohm and potential has a resistor value of up to 100k ohm, so by changing the value of resistor (R3), the difference between potential with a resistor (R3) and photocell (LDR), the circuit will use positive or negative side and that will turn on or off the circuit. In this case, I want the circuit still turned off when we have normal daylight so I switch out R3 to 220 ohms. I tried 4k7 ohms for resistor 3 (R3), in order to turn off the circuit I need to black out the room.

- Section B: This section includes a 555 timer and a 10n capacitor, but the capacitor doesn't affect the way circuit too much. More important in this part is the 555 timer, it works with components in section C as an astable mode. The 555 timer functions as an oscillator generator (Section C) when configured in astable mode by connecting just two resistors (R1 and R2) and one capacitor (Capacitor 2), with the Trigger (Pin 2) and Threshold (Pin 6) pins tied together. The cycle initiates with the capacitor charging through the series combination of resistor 1 (R1) and resistor 2 (R2), keeping the output high initially. As the charging progresses, once the capacitor voltage reaches 2/3 of the supply voltage (9V), the internal circuitry triggers, causing the capacitor to discharge through resistor 2 (R2), thereby transitioning the output to low.

During this discharge phase, when the capacitor voltage drops down to 1/3 of 9V, the internal flip-flop resets, allowing the capacitor to charge again, resulting in the output going high once more. This repeated charging and discharging of the capacitor between the 2/3 of 9V and 1/3 of 9V thresholds generates a continuous square wave output signal. Notably, the high output time depends on the values of both Resistor 1 (R1) and Resistor 2 (R2), along with Capacitor 2. In contrast, the low time is determined solely by Resistor 2 (R2) and Capacitor 2. The period of one complete cycle equals the sum of the high and low times, while the frequency is the reciprocal of this period (calculate equations in step 3). In Lush Project, I have 2 graphs, the one on the left is the input and the right one is the output of the 555 timer.

- Section C: This is the part that generates the oscillation for the 555 timer. The combination of 2 resistors (R1 and R2) with one capacitor (Capacitor 2) will work as an astable mode. It is also the input for the 555 timer and the 555 timer will generate the output. The input goes to Pin 2 and 6 of the 555 timer will have the oscillator waveform up and down. The output will be the squarewave form as the explanation from section B. Visit Lush Project to see more information and how the waveform at the input and output of the 555 timer and stable circuit mode.

- Section D: This part is just the output of the circuit, it includes a 10u capacitor and a speaker. The capacitor in this section just charges up and releases when it is full. The speaker will turn on or off depending on the photocell (LDR) and the resistor 3 (R3) in section A.

General cautions when you build this circuit are unpolarized and polarized components. You don't have to worry too much if the components are unpolarized, but if you have polarized components just be careful since it only works when you put it with the flow of the circuit, it goes from positive to negative (there will be a + and - sign on the cable or the back of the components so you know about it).

Step 3: Explanation More About Section C

As I mentioned earlier, section C produces an astable mode. In Figure 1, the upper graph is the input of the 555 timer at Pin 2 and 6 with oscillation waveform, the lower graph is the output of the 555 timer at Pin 3 with square waveform. It matched with the graph in the Lush Project.

Also, we can calculate the time high (TH) and time low (TL) of the output (bottom) graph in Figure 1, by using equations 3 and 4 in Figure 2.

The output of the 555 timer connects to the speaker (Section D), we want the speaker to produce at the frequency that the human ear can listen. The normal range for human hearing is from 20 to 20,000 Hz. By using equation 1 in Figure 2, with values of resistors 1 and 2 (R1 and R2), and capacitor 2. The frequency of the circuit is 340 Hz so we can listen to it. The duty cycle is 76%. The duty cycle means the percentage of the circuit stays high for the total period. In this case, the circuit stays high at 76% of the total period.

Visit this ALL About Circuit to learn more about the calculation of frequency, duty cycle, time period,... of the astable mode circuit. They have 2 examples of using the astable 555 timer mode for LED flasher, and tone generator.

Also, visit this Circuit Basic if you want to find more information about the astable circuit in case you need it. On this website, they also explain the 555 timer circuit works with an astable mode and uses it for the LED blinking circuit. How To Mechatronics is also another good source to explore more about the 555 timer astable mode circuit.

Step 4: More General Information About the Circuit

In this experiment, I utilize the breadboard due to its convenience in verifying the functionality of the circuit. Various types of circuit boards can be chosen for different applications, such as prototype boards for the physics lab (Figure 2) or perf boards (Figure 3). When using perf boards (Figure 3), proficiency in soldering components is necessary. Unlike the plug-and-play nature of the breadboard and prototype board in Figures 1 and 2, soldering skills are required."

"When constructing the circuit, employing certain tips can enhance the process. Color-coding the cables facilitates easy tracing in case of circuit malfunction. Additionally, ensure that the cables are securely connected, as loose connections can lead to issues, as I experienced with my breadboard.

Moreover, both breadboards and perf boards offer the advantages of being highly accessible, cost-effective, and flexible in circuit prototyping. They allow for quick experimentation and modification without the need for specialized equipment since the perf board can break into small pieces depending on how big you need the circuit to be, making them ideal choices for both beginners and experienced hobbyists alike.

Step 5: More Information

As the component in the circuit, if you want to have a closer look at the component, more general information, how to use it, and how does it work? Visit the link below for the data sheet:

Potentiometer: 3386P-1-104LF Bourns Inc. | Potentiometers, Variable Resistors | DigiKey

LDR photocell: 02-LDR3 NTE Electronics, Inc | Sensors, Transducers | DigiKey Marketplace

555 timer: LM741CN/NOPB Texas Instruments | Integrated Circuits (ICs) | DigiKey