Practical case: Secret drawer alarm sensor

Secret drawer alarm sensor prototype (Maker Style)

Level: Basic — Build a circuit that activates a buzzer when it detects light upon opening a dark drawer.

Objective and use case

In this practical case, you will build a light-sensitive alarm system using a photoresistor (LDR) and a transistor driver. The circuit remains silent in the dark but activates an audible alarm immediately when light hits the sensor.

  • Security: Protects private drawers or boxes by alerting you if they are opened.
  • Safety: Can be used to signal if a refrigerator or pantry door is not fully closed.
  • Automation: Demonstrates how to use environmental inputs (light) to control output devices (sound).

Expected outcome:
* Darkness (Drawer closed): The buzzer remains OFF (0 V across the buzzer).
* Light (Drawer open): The buzzer turns ON immediately.
* Threshold: The transistor switches the load when the base voltage exceeds approximately 0.6 V–0.7 V.
* Target Audience: Beginners and hobbyists learning about sensor interfacing.

Materials

  • V1: 9 V DC battery or power supply, function: Main power source.
  • R1: Photoresistor (LDR) GL5528, function: Detects light intensity (variable resistance).
  • R2: 10 kΩ resistor, function: Pull-down resistor to form a voltage divider.
  • Q1: 2N2222 NPN Transistor, function: Electronic switch to drive the buzzer.
  • LS1: 9 V Active Piezo Buzzer, function: Audible alarm output.
  • SW1: SPST Toggle Switch, function: Master On/Off switch (optional).

Wiring guide

Construct the circuit connecting the components between the specific nodes defined below. Use a breadboard for easy assembly.

  • VCC: Connect the positive terminal of V1 and one side of SW1. Connect the other side of SW1 to the main VCC rail.
  • 0 (GND): Connect the negative terminal of V1, the Emitter of Q1, and one leg of R2.
  • V_BASE: Connect the other leg of R2, one leg of R1, and the Base of Q1.
  • VCC (Connection): Connect the other leg of R1 to the VCC rail.
  • V_COLLECTOR: Connect the Collector of Q1 to the negative wire of LS1.
  • VCC (Load): Connect the positive wire of LS1 to the VCC rail.

Conceptual block diagram

Conceptual block diagram — Light-Triggered Alarm
Quick read: inputs → main block → output (actuator or measurement). This summarizes the ASCII schematic below.

Schematic

[ INPUTS / POWER ]                  [ LOGIC / CONTROL ]                     [ OUTPUT ]

                                             (VCC Rail)
    [ 9 V Battery ] --> [ SW1 Switch ] --+------->+----------------------------------+
                                        |        |                                  |
                                        |        v                                  v
    [ Light Source ] --> [ LDR (R1) ] --+--> [ Voltage Divider ]                    |
                         (Sensor)            [ (Node: V_BASE)  ] --(Trigger)--> [ Q1 Transistor ]
                                        +--> [ R1 vs R2 Logic  ]                [ (NPN Switch)  ] --(Ground Path)--> [ LS1 Buzzer ]
                                        |                                       [ Collector Pin ]                    (Active Alarm)
    [ Resistor R2 ] ----(Pull-Down)-----+                                           |
    (10k Ohm)                                                                       v
                                                                                 [ GND ]
Schematic (ASCII)

Electrical diagram

Electrical diagram for case: Secret drawer alarm sensor
Generated from the validated SPICE netlist for this case.

🔒 This electrical diagram is premium. With the 7-day pass or the monthly membership you can unlock the complete didactic material and the print-ready PDF pack.🔓 See premium access plans

Measurements and tests

Follow these steps to validate the circuit operation:

  1. LDR Resistance Check:
    • Set your multimeter to measure Resistance (Ω).
    • Measure R1 in full light; it should read a low value (e.g., 500 Ω – 2 kΩ).
    • Cover R1 completely; it should read a high value (e.g., > 100 kΩ).
  2. Voltage Divider Test:
    • Power on the circuit (VCC = 9 V).
    • Set multimeter to DC Voltage. Connect the black probe to 0 (GND) and the red probe to V_BASE.
    • In Dark: The voltage should be close to 0 V (below 0.6 V).
    • In Light: The voltage should rise significantly (above 0.7 V).
  3. Output Verification:
    • Expose the sensor to light. The buzzer LS1 should sound.
    • Cover the sensor with your hand. The buzzer should stop immediately.

SPICE netlist and simulation

Reference SPICE Netlist (ngspice) — excerptFull SPICE netlist (ngspice)

* Practical case: Secret drawer alarm sensor
* Ngspice Netlist
*
* Circuit Description:
* A light-activated alarm using a photoresistor (LDR) and an NPN transistor.
* When the drawer opens (Light), LDR resistance drops, Base voltage rises,
* Q1 turns ON, and the Buzzer sounds.
*
* Simulation Scenario:
* 0ms - 2ms: System OFF (Master Switch Open).
* 2ms: Master Switch closes (System Armed). Drawer is Closed (Dark).
* 5ms: Drawer Opens (Light hits LDR). Alarm triggers.

* --- Power Supply (V1) ---
* 9V DC Battery
V1 BAT_POS 0 DC 9

* --- Master Switch (SW1) ---
* Connects Battery Positive to Main VCC Rail.
* Modeled as a voltage-controlled switch closing at t=2ms.
* ... (truncated in public view) ...

Copy this content into a .cir file and run with ngspice.

🔒 Part of this section is premium. With the 7-day pass or the monthly membership you can access the full content (materials, wiring, detailed build, validation, troubleshooting, variants and checklist) and download the complete print-ready PDF pack.

* Practical case: Secret drawer alarm sensor
* Ngspice Netlist
*
* Circuit Description:
* A light-activated alarm using a photoresistor (LDR) and an NPN transistor.
* When the drawer opens (Light), LDR resistance drops, Base voltage rises,
* Q1 turns ON, and the Buzzer sounds.
*
* Simulation Scenario:
* 0ms - 2ms: System OFF (Master Switch Open).
* 2ms: Master Switch closes (System Armed). Drawer is Closed (Dark).
* 5ms: Drawer Opens (Light hits LDR). Alarm triggers.

* --- Power Supply (V1) ---
* 9V DC Battery
V1 BAT_POS 0 DC 9

* --- Master Switch (SW1) ---
* Connects Battery Positive to Main VCC Rail.
* Modeled as a voltage-controlled switch closing at t=2ms.
S1 BAT_POS VCC CTRL_SW 0 SW_MODEL
V_SW_CTRL CTRL_SW 0 PULSE(0 5 2ms 1u 1u 100ms)
.model SW_MODEL SW(Vt=2.5 Ron=0.01 Roff=100Meg)

* --- Photoresistor (R1 / LDR) ---
* LDR GL5528 connecting VCC to Base.
* Modeled as a behavioral resistor B_R1.
* Resistance logic controlled by V_LDR_RES:
*   Dark (Closed) = 1 MegOhm
*   Light (Open)  = 2 kOhm
* Simulation: Transitions from Dark to Light at t=5ms.
V_LDR_RES RES_CTRL 0 PWL(0 1Meg 4.99ms 1Meg 5ms 2k)
B_R1 VCC V_BASE I=(V(VCC) - V(V_BASE)) / V(RES_CTRL)

* --- Resistor (R2) ---
* 10k Ohm pull-down resistor from Base to Ground.
R2 V_BASE 0 10k

* --- Transistor (Q1) ---
* 2N2222 NPN Transistor acting as the switch for the buzzer.
* Connections: Collector=V_COLLECTOR, Base=V_BASE, Emitter=0
Q1 V_COLLECTOR V_BASE 0 2N2222MOD

* --- Buzzer (LS1) ---
* 9V Active Piezo Buzzer.
* Modeled as a 1k Ohm resistive load connected between VCC and Collector.
* (Not modeled as a voltage source per requirements).
R_LS1 VCC V_COLLECTOR 1k

* --- Component Models ---
.model 2N2222MOD NPN(Is=14.34f Xti=3 Eg=1.11 Vaf=74.03 Bf=255.9 Ne=1.307 Ise=14.34f Ikf=.2847 Xtb=1.5 Br=6.092 Nc=2 Isc=0 Ikr=0 Rc=1 Cjc=7.306p Mjc=.3416 Vjc=.75 Fc=.5 Cje=22.01p Mje=.377 Vje=.75 Tr=46.91n Tf=411.1p Itf=.6 Vtf=1.7 Xtf=3 Rb=10)

* --- Analysis Directives ---
.op
* Transient analysis for 10ms to capture the sequence.
.tran 10u 10ms

* Print directives to verify operation
* V(VCC): Power rail status
* V(V_BASE): Transistor drive voltage (Low=Dark, High=Light)
* V(V_COLLECTOR): Output node (High=Off, Low=Alarm On)
.print tran V(VCC) V(V_BASE) V(V_COLLECTOR)

.end

Simulation Results (Transient Analysis)

Simulation Results (Transient Analysis)
Show raw data table (1057 rows)
Index   time            v(vcc)          v(v_base)       v(v_collector)
0	0.000000e+00	8.999090e-02	8.909999e-04	8.999089e-02
1	1.000000e-07	8.999090e-02	8.909999e-04	8.999089e-02
2	2.000000e-07	8.999090e-02	8.909999e-04	8.999089e-02
3	4.000000e-07	8.999090e-02	8.909999e-04	8.999089e-02
4	8.000000e-07	8.999090e-02	8.909999e-04	8.999089e-02
5	1.600000e-06	8.999090e-02	8.909999e-04	8.999089e-02
6	3.200000e-06	8.999090e-02	8.909999e-04	8.999089e-02
7	6.400000e-06	8.999090e-02	8.909999e-04	8.999089e-02
8	1.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
9	2.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
10	3.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
11	4.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
12	5.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
13	6.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
14	7.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
15	8.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
16	9.280000e-05	8.999090e-02	8.909999e-04	8.999089e-02
17	1.028000e-04	8.999090e-02	8.909999e-04	8.999089e-02
18	1.128000e-04	8.999090e-02	8.909999e-04	8.999089e-02
19	1.228000e-04	8.999090e-02	8.909999e-04	8.999089e-02
20	1.328000e-04	8.999090e-02	8.909999e-04	8.999089e-02
21	1.428000e-04	8.999090e-02	8.909999e-04	8.999089e-02
22	1.528000e-04	8.999090e-02	8.909999e-04	8.999089e-02
23	1.628000e-04	8.999090e-02	8.909999e-04	8.999089e-02
... (1033 more rows) ...

Common mistakes and how to avoid them

  1. Reversing the Voltage Divider: If you swap R1 (LDR) and R2 (Fixed Resistor), the alarm will sound in the dark and stop in the light (Inverse logic). Ensure R1 is connected to VCC and R2 to GND.
  2. Using a Passive Buzzer: A passive buzzer requires an oscillating AC signal to make sound. This circuit provides DC. You must use an Active Buzzer (which has an internal oscillator).
  3. Transistor Pinout Errors: Confusing the Collector (C) and Emitter (E) is common. For the 2N2222 in a TO-92 package, verify the pinout datasheet; usually, with the flat side facing you, the pins are E-B-C or E-B-C depending on the manufacturer.

Troubleshooting

  • Buzzer sounds continuously (even in dark):
    • Ambient light is too strong. Place the circuit in a box.
    • R2 value is too high. Try replacing R2 with a lower value (e.g., 4.7 kΩ) to pull the base voltage down harder.
  • Buzzer never sounds:
    • R2 value is too low.
    • LS1 is connected backwards (check polarity).
    • Q1 is damaged or connected incorrectly.
  • Buzzer is too quiet:
    • Battery voltage might be low.
    • Ensure the buzzer is rated for the supply voltage used (9 V).

Possible improvements and extensions

  1. Sensitivity Control: Replace the fixed resistor R2 with a 50 kΩ potentiometer. This allows you to fine-tune exactly how much light is needed to trigger the alarm.
  2. Latching Alarm: Add a Silicon Controlled Rectifier (SCR) instead of the NPN transistor, or add a feedback loop. This would keep the alarm sounding even if the thief quickly closes the drawer again, forcing a manual reset.

More Practical Cases on Prometeo.blog

Find this product and/or books on this topic on Amazon

Go to Amazon

As an Amazon Associate, I earn from qualifying purchases. If you buy through this link, you help keep this project running.

Quick Quiz

Question 1: What is the primary function of the circuit described in the text?




Question 2: Which component is used to detect light intensity in this project?




Question 3: What is the expected behavior of the buzzer when the drawer is closed (in darkness)?




Question 4: What is the role of the Q1 (2N2222 NPN Transistor) in the circuit?




Question 5: At approximately what base voltage does the transistor switch the load?




Question 6: What is the function of the R2 (10 kΩ resistor) in this specific voltage divider configuration?




Question 7: Which component serves as the main power source for the circuit?




Question 8: What is a practical safety use case mentioned for this circuit?




Question 9: How is the master On/Off switch (SW1) typically connected in this type of circuit?




Question 10: Who is the stated target audience for this project?




Carlos Núñez Zorrilla
Carlos Núñez Zorrilla
Electronics & Computer Engineer

Telecommunications Electronics Engineer and Computer Engineer (official degrees in Spain).

Follow me:


Practical case: Automatic twilight switch

Automatic twilight switch prototype (Maker Style)

Level: Basic. Build a circuit that automatically turns on an LED when ambient light drops below a specific level.

Objective and use case

You will design and assemble a light-sensing circuit using a photoresistor (LDR) and a transistor to control an LED based on environmental brightness. The circuit acts as a logical NOT gate relative to light intensity: Light = Output OFF, Dark = Output ON.

Why it is useful:
* Street lighting: Automating street lamps to turn on only at night to save energy.
* Garden lights: Solar-powered garden fixtures that activate at dusk.
* Security systems: Triggering low-light recording or illumination.
* Display efficiency: Adjusting screen brightness or backlighting based on room conditions.

Expected outcome:
* When the LDR is exposed to bright light, the LED remains OFF.
* When the LDR is covered (simulating darkness), the LED turns ON.
* The voltage at the transistor base (V_BASE) increases as light intensity decreases.

Target audience: Beginners learning about sensors and transistor switching.

Materials

  • V1: 9 V DC battery or power supply.
  • R1: 10 kΩ resistor, function: upper leg of voltage divider (pull-up).
  • R2: LDR (Light Dependent Resistor), GL5528 or similar, function: light sensor (lower leg).
  • R3: 470 Ω resistor, function: LED current limiting.
  • Q1: 2N3904 NPN transistor, function: electronic switch.
  • D1: Red LED, function: output indicator.

Wiring guide

Construct the circuit following these connections using the specific node names:

  • Power Supply:

    • V1 (+): Connects to node VCC.
    • V1 (-): Connects to node 0 (GND).
  • Sensor Stage (Voltage Divider):

    • R1 (10 kΩ): Connects between VCC and node V_BASE.
    • R2 (LDR): Connects between node V_BASE and 0 (GND).
  • Switching Stage:

    • Q1 (Base): Connects to node V_BASE.
    • Q1 (Emitter): Connects to node 0 (GND).
    • Q1 (Collector): Connects to node N_LED_CATHODE.
  • Output Stage:

    • R3 (470 Ω): Connects between VCC and node N_LED_ANODE.
    • D1 (Anode): Connects to node N_LED_ANODE.
    • D1 (Cathode): Connects to node N_LED_CATHODE.

Conceptual block diagram

Conceptual block diagram — Light-Controlled Switch
Quick read: inputs → main block → output (actuator or measurement). This summarizes the ASCII schematic below.

Schematic

[ SENSOR STAGE ]                   [ SWITCHING STAGE ]                 [ OUTPUT STAGE ]

   [ VCC 9 V Source ]
          |
          v
   [ R1: 10k Pull-Up ]
          |
          v
   [ Node: V_BASE  ] --(Trigger)--> [ Base: Q1 (2N3904)   ]
          |                         [                     ]
          v                         [ Coll: N_LED_CATHODE ] --(Sink)--> [ Cathode: D1 LED ]
   [ R2: LDR Sensor ]               [                     ]             [ Node: N_LED_ANODE ]
          |                         [ Emit: GND           ]             [ Anode:   D1 LED   ]
          v                                                             [         ^         ]
       [ GND ]                                                          [         |         ]
                                                                        [ R3: 470 Resistor  ]
                                                                                  ^
                                                                                  |
                                                                             [ VCC 9 V ]
Schematic (ASCII)

Electrical diagram

Electrical diagram for case: Automatic twilight switch
Generated from the validated SPICE netlist for this case.

🔒 This electrical diagram is premium. With the 7-day pass or the monthly membership you can unlock the complete didactic material and the print-ready PDF pack.🔓 See premium access plans

Measurements and tests

To validate the circuit operation, perform the following steps with a multimeter:

  1. Light Condition (Simulation): Shine a flashlight on R2 (LDR) or ensure the room is bright.

    • Measure voltage at V_BASE relative to 0 (GND). It should be low (< 0.6 V).
    • Observe D1: It should be OFF.
    • Measure voltage at N_LED_CATHODE relative to 0 (GND). It should be close to VCC (floating high through the LED).
  2. Dark Condition (Simulation): Cover R2 (LDR) completely with your finger or a cap.

    • Measure voltage at V_BASE. It should rise above 0.7 V.
    • Observe D1: It should turn ON.
    • Measure voltage at N_LED_CATHODE (Collector). It should drop to near 0 V (Saturation voltage, approx 0.1 V – 0.2 V).

SPICE netlist and simulation

Reference SPICE Netlist (ngspice) — excerptFull SPICE netlist (ngspice)

* Practical case: Automatic twilight switch
* 
* This netlist implements a twilight switch where an LED turns ON
* when the light level drops (simulated by increasing LDR resistance).

* --- Models ---
* Standard NPN Transistor Model
.model 2N3904 NPN(IS=1E-14 VAF=100 BF=200 IKF=0.3 XTB=1.5 BR=3 CJC=8E-12 CJE=25E-12 TR=460E-9 TF=400E-12 ITF=0.6 VTF=10 XTF=30 RB=10 RC=1 RE=0.1)
* Generic Red LED Model (Vf approx 1.8V)
.model LED_RED D(IS=1e-14 N=2.5 RS=5 BV=5 IBV=10u)

* --- Power Supply ---
* V1: 9 V DC source connected to VCC and GND (0)
V1 VCC 0 DC 9

* --- Sensor Stage (Voltage Divider) ---
* R1: 10 kΩ Pull-up resistor
R1 VCC V_BASE 10k

* R2: LDR (Light Dependent Resistor)
* ... (truncated in public view) ...

Copy this content into a .cir file and run with ngspice.

🔒 Part of this section is premium. With the 7-day pass or the monthly membership you can access the full content (materials, wiring, detailed build, validation, troubleshooting, variants and checklist) and download the complete print-ready PDF pack.

* Practical case: Automatic twilight switch
* 
* This netlist implements a twilight switch where an LED turns ON
* when the light level drops (simulated by increasing LDR resistance).

* --- Models ---
* Standard NPN Transistor Model
.model 2N3904 NPN(IS=1E-14 VAF=100 BF=200 IKF=0.3 XTB=1.5 BR=3 CJC=8E-12 CJE=25E-12 TR=460E-9 TF=400E-12 ITF=0.6 VTF=10 XTF=30 RB=10 RC=1 RE=0.1)
* Generic Red LED Model (Vf approx 1.8V)
.model LED_RED D(IS=1e-14 N=2.5 RS=5 BV=5 IBV=10u)

* --- Power Supply ---
* V1: 9 V DC source connected to VCC and GND (0)
V1 VCC 0 DC 9

* --- Sensor Stage (Voltage Divider) ---
* R1: 10 kΩ Pull-up resistor
R1 VCC V_BASE 10k

* R2: LDR (Light Dependent Resistor)
* Modeled as a behavioral resistor to simulate changing light conditions.
* Low Resistance = Bright Light (LED OFF), High Resistance = Dark (LED ON).
* Simulation: Resistance ramps from 100 Ohm to 3000 Ohm over 5ms.
* The switching threshold (Vbe ~ 0.65V) occurs around R2 = 780 Ohms.
R2 V_BASE 0 R='100 + 2900 * (time / 0.005)'

* --- Switching Stage ---
* Q1: 2N3904 NPN Transistor
* Base -> V_BASE, Collector -> N_LED_CATHODE, Emitter -> GND (0)
Q1 N_LED_CATHODE V_BASE 0 2N3904

* --- Output Stage ---
* R3: 470 Ω LED current limiting resistor
R3 VCC N_LED_ANODE 470

* D1: Red LED
* Anode -> N_LED_ANODE, Cathode -> N_LED_CATHODE
D1 N_LED_ANODE N_LED_CATHODE LED_RED

* --- Simulation Directives ---
* Perform a transient analysis for 5ms to observe the switching behavior
.tran 10u 5m

* Print required voltages for verification
* V_BASE: Shows the sensor voltage rising.
* N_LED_CATHODE: Shows the collector voltage dropping when Q1 turns ON.
.print tran V(V_BASE) V(N_LED_CATHODE) V(N_LED_ANODE)

.op
.end

Simulation Results (Transient Analysis)

Simulation Results (Transient Analysis)
Show raw data table (508 rows)
Index   time            v(v_base)       v(n_led_cathode v(n_led_anode)
0	0.000000e+00	8.910891e-02	8.519679e+00	9.000000e+00
1	1.000000e-07	8.915880e-02	8.519729e+00	9.000000e+00
2	2.000000e-07	8.920993e-02	8.519780e+00	9.000000e+00
3	4.000000e-07	8.931227e-02	8.519882e+00	9.000000e+00
4	8.000000e-07	8.951694e-02	8.520087e+00	9.000000e+00
5	1.600000e-06	8.992625e-02	8.520496e+00	9.000000e+00
6	3.200000e-06	9.074475e-02	8.521314e+00	9.000000e+00
7	6.400000e-06	9.238131e-02	8.522950e+00	9.000000e+00
8	1.280000e-05	9.565263e-02	8.526219e+00	9.000000e+00
9	2.280000e-05	1.007592e-01	8.531319e+00	9.000000e+00
10	3.280000e-05	1.058600e-01	8.536410e+00	9.000000e+00
11	4.280000e-05	1.109549e-01	8.541491e+00	9.000000e+00
12	5.280000e-05	1.160440e-01	8.546563e+00	9.000000e+00
13	6.280000e-05	1.211273e-01	8.551627e+00	9.000000e+00
14	7.280000e-05	1.262047e-01	8.556682e+00	9.000000e+00
15	8.280000e-05	1.312764e-01	8.561728e+00	9.000000e+00
16	9.280000e-05	1.363422e-01	8.566765e+00	9.000000e+00
17	1.028000e-04	1.414023e-01	8.571793e+00	9.000000e+00
18	1.128000e-04	1.464566e-01	8.576812e+00	9.000000e+00
19	1.228000e-04	1.515051e-01	8.581823e+00	9.000000e+00
20	1.328000e-04	1.565479e-01	8.586824e+00	9.000000e+00
21	1.428000e-04	1.615849e-01	8.591815e+00	9.000000e+00
22	1.528000e-04	1.666162e-01	8.596796e+00	9.000000e+00
23	1.628000e-04	1.716418e-01	8.601767e+00	9.000000e+00
... (484 more rows) ...

Common mistakes and how to avoid them

  1. Swapping the Resistor and LDR: Placing the LDR on top and R1 on the bottom creates a «Morning Alarm» (turns on when light detected) instead of a twilight switch. Ensure R1 connects to VCC and the LDR connects to 0.
  2. LED Polarity Reversed: The LED will not light up if the anode and cathode are swapped. Ensure the flat side (Cathode) connects to the transistor collector.
  3. Transistor Pinout Confusion: Confusing Collector, Base, and Emitter on the 2N3904 is common. Verify the datasheet for your specific package (usually E-B-C from left to right when flat side faces you).

Troubleshooting

  • LED is always ON:
    • Ambient light might be too low. Use a flashlight to test the sensor.
    • R1 (Pull-up) value is too low, providing too much base current even in light. Increase R1 to 22 kΩ or 47 kΩ.
  • LED is always OFF:
    • Check transistor orientation.
    • R1 might be too high, preventing the base voltage from reaching 0.7 V even in darkness.
    • LDR might be shorted.
  • LED is dim in darkness:
    • The battery voltage (V1) is low.
    • R3 (Current limiting) is too high; try reducing it slightly (do not go below 220 Ω).

Possible improvements and extensions

  1. Sensitivity Adjustment: Replace R1 with a 50 kΩ or 100 kΩ potentiometer to manually tune the exact darkness level required to trigger the LED.
  2. Hysteresis: Add a feedback resistor between the Collector and the Base to create a «Schmitt Trigger» effect, preventing the LED from flickering at the twilight threshold.

More Practical Cases on Prometeo.blog

Find this product and/or books on this topic on Amazon

Go to Amazon

As an Amazon Associate, I earn from qualifying purchases. If you buy through this link, you help keep this project running.

Quick Quiz

Question 1: What is the primary objective of the circuit described in the text?




Question 2: Which component acts as the light sensor in this circuit?




Question 3: How does the circuit behave logically relative to light intensity?




Question 4: What is a common real-world use case for this type of circuit mentioned in the text?




Question 5: What happens to the voltage at the transistor base (V_BASE) as light intensity decreases?




Question 6: Which component functions as the electronic switch in the circuit?




Question 7: What is the function of the resistor R3 (470 Ω) typically found in this circuit?




Question 8: What is the role of the 10 kΩ resistor (R1) in the materials list?




Question 9: What is the expected state of the LED when the LDR is exposed to bright light?




Question 10: Who is the target audience for this circuit project?




Carlos Núñez Zorrilla
Carlos Núñez Zorrilla
Electronics & Computer Engineer

Telecommunications Electronics Engineer and Computer Engineer (official degrees in Spain).

Follow me: