Medium

LDR Dark-Activated Relay Switch

A photoresistor wired straight to a transistor's base drives a real relay — unlike the single-LED version, this build can switch any 230V appliance wired through the relay (a lamp, a fan) when it gets dark.

Circuit Diagram

+12V LDR (photoresistor) Q BC547 B 10K C E RELAY COIL 1N4007 (across coil) relay contact NO → to switched appliance

How to Build It

  1. Place the BC547 transistor on the breadboard.
  2. Build a voltage divider: the photoresistor from the positive rail to the transistor's base, then a fixed resistor from the transistor's base to GND.
  3. Connect the transistor's collector to one relay coil terminal, the other terminal to the positive rail (12V).
  4. Connect the transistor's emitter to GND.
  5. Connect a 1N4007 diode across the relay coil (cathode toward positive) — mandatory, protects the transistor.
  6. Cover the photoresistor with your hand — the relay should click on; uncover it — the relay should release.

Bill of Materials

ProductCodeQty
Diode/bridge rectifier 1N4007-DIO 1
Relay (12/24VDC/auto) 1
Resistor DR47K-8/9 1
Resistor DR100R-418 1
Transistor (incl. IGBT) 1
← All kits  ·  Newsletter