1
\$\begingroup\$

I am trying to develop a circuit that is compatible with a regular switch (push, reed, other) and also a phototransistor. The application is pinball, where there are any number of switches and IR emitter/receiver pairs. I want to be able to connect either (maybe an eddy current switch too, but I know this would need an extra board) right into the same input lines. I ALSO want to keep it optically isolated.

The receiver is a phototransistors, so I can drive to ground similar to the IC opto-isolator. The problem I have is trying to bias the optoisolator at 1.2V and 20mA when off, and the switch-phototransistor at .4V and 2mA when on.

Schematic with photo-transistor and normal switch options:

enter image description here

Is there something special I am missing in order to bias the phototransistor AND drive the opto-isolator LED from the same pull-up?

UPDATE:

I don't think using the same pullup is possible. I'm just not that lucky. So I've come up with a way to do this with the addition of an FET to sink the LED when the switch circuit is closed. Resistors should have things biased/current limited correctly. I think I could swing this with a BJT as well. Does anyone have any thoughts on this?

enter image description here

\$\endgroup\$
  • \$\begingroup\$ A photo transistor at "ball path" would probably be holding its signalling line low until a ball passes. Is that what you want? Otherwise you need to invert the signal. Is your 3.3V logic sensing 3.3V as an interrupt(switch or something) or is it 0V? \$\endgroup\$ – Dejvid_no1 Apr 25 '15 at 19:05
  • \$\begingroup\$ Yes, that's what I want. That is, to treat it as a normally-closed switch. The input sensing will either be tied directly to a micro IO pin, or possibly a schmitt triggered buffer. Either way it would just be polled at regular intervals. \$\endgroup\$ – ptpaterson Apr 27 '15 at 14:07
  • \$\begingroup\$ The V_Logic supply is backwards, but that's probably just a typo. Photo transistor has isolation properties similar to an optocoupler, do you really need a dedicated optocoupler? Other than that, I think that your second schematic might just work. \$\endgroup\$ – Nick Alexeev Apr 28 '15 at 0:42
  • \$\begingroup\$ The FOD817 is backwards too. \$\endgroup\$ – mng Apr 28 '15 at 1:34
  • \$\begingroup\$ Those are indeed backwards, yes (tho didn't see the coupler until now, thanks!). The reason for the dedicated optocoupler is for the case that there is just a switch which connects to ground as in the first circuit. I left that out of the second diagram, but I do still need to account for it. Otherwise, I could just use the 3.3V for the individual phototransistor. \$\endgroup\$ – ptpaterson Apr 28 '15 at 2:27
2
+50
\$\begingroup\$

I think you missed that optically coupled elements are potential free therefore you can place them in any arm of the corresponding series within the circuit (from vcc to gnd in your case) consructing the logic behavior you want. For buttons (switches) the same is actual.

enter image description here

As you can see at the picture above, it is possible to use the same schematic to control both switch or photo transistor.

\$\endgroup\$
  • \$\begingroup\$ This has given me some different, albeit very simple, way to think about it. I kinda got stuck in my ways and couldn't get out, so thank you. \$\endgroup\$ – ptpaterson May 4 '15 at 16:12
1
\$\begingroup\$

Maybe something like this:

schematic

simulate this circuit – Schematic created using CircuitLab

The MCU input will stay high until a switch is closed or a ball breaks the light of the TSAL6100. The exakt value of R2 could probably need a bit of adjustment. If there are lots of reflections in your application you might need to tune the light down a bit. R4 might also need a bit of adjustment, buy a potentiometer and tune it in. I haven't specified the NPN but a BC547b would probably work.

\$\endgroup\$

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.