Yet another photo-switch question. Have done my homework, and searches but most non-specific circuits are beyond my learning curve, time to learn, and available wet-ram.

Have a 15 LED array being driven by a LM317 regulator set up for current regulation (shown below). Schematic has been breadboarded and works as advertised. Supply voltage 12-15Vdc, Vf of LEDs 3V, current 20mA ea. LM317 output with 12 ohm resistor.. 20.8 mA. enter image description here

Need to add (optional) photo-switch to this circuit (on at dark, off at dawn). Simplest I have found has been posted in these forums already.

enter image description here

Problem is, this circuit, components and values, were designed for a 3V coin cell, and my requirements are based around available 12-15Vdc power. Additional constraints due to space for components (very small) and power consumption (least is best) require a solid state solution. This solution looks good if someone can help specify the proper value for the (now) 1K resistor in a circuit such as below. Spec sheet for the 2N3904 shows a max current of 200mA so (I think) it should suffice.

enter image description here

As I said earlier, my knowledge of EE is extremely limited, and I am putting this together on the fly. I can read a schematic, and do a decent job of soldering but my theoretical knowledge is sadly lacking. I may need to build several hundred of these little suckers, so any input or pointers to a better path, or a solution to my specific questions are appreciated.

  • \$\begingroup\$ You're doing a high-side drive. Use a 2N3906 instead. \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 19 '13 at 0:57
  • \$\begingroup\$ Assuming the change to a 2N3906, the circuit should work? Any input as to the value of the resistor in question? \$\endgroup\$ – cap'couillon Oct 19 '13 at 1:47
  • \$\begingroup\$ Unfortunately you'll also need to switch to a PNP phototransistor, and tie the emitter to 12V and have the resistor pull it down instead. Or you can put an inverter stage in between the photo and the transistor. \$\endgroup\$ – Ignacio Vazquez-Abrams Oct 19 '13 at 1:53
  • \$\begingroup\$ Also you can't use 2N3904 as it is limited to "Absolute Maximum Collector Current" of 200ma collector current depending on the device and manufacturer! \$\endgroup\$ – Chetan Bhargava Oct 19 '13 at 2:25
  • \$\begingroup\$ @Ignacio How about we just move the switch portion of the circuit to the low-side of the leds? \$\endgroup\$ – cap'couillon Oct 19 '13 at 11:21

You already have a power transistor (in the regulator). It seems a bit wasteful to have another power transistor in the circuit when this operation can be handled at the logic level.

Just replace the LM317 with a similar adjustable regulator that has a shutdown pin.


Some 2n3094/2n3096 are 100mA max collector current, some are 200mA. If you can instead, Use a 2n2907, it is a common PNP transistor with a 600mA Collector Current. This avoids driving the transistor at it's max, with enough leeway that you could change the circuit without too much effort.

R2 is listed as a potentimeter. Adjust it until you get the circuit to turn on at the right amount of light/darkness. At that point, you can measure it and replace it with a fixed resistor as needed, if you want to.

The Photoswitch or the LED will sink the PNP's base to ground when light hits it, turning the transistor and the circuit off.


simulate this circuit – Schematic created using CircuitLab


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.