Maker Pro
Maker Pro

Simple Phototransistor switch circuit

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
This is a DC Transfer Characteristic Analysis with Hysteresis included. Hysteresis (if any) is analyzed by the following....

VF2 sweeps from 9V to 0V. VF2 then sweeps from 0V to 9V. So, the VF1 plot you see reflects U1's output going High when the Trigger pin voltage (VF2) falls below 3V. This is the left VF1 transition from 0V to 8.79V. The transition you're questioning occurs when the VF2 sweep reaches 6V on the ramp's up slope the output (VF1) switches back to 0V. This happens because the Threshold pin responds to voltages >= 2/3 VCC. Since the Trigger and Threshold pins are tied together we get the output pin response of both pin's characteristcs. In short it's hysteresis that you see there and that's what's confusing you.

Chris

Ok thanks that clarifies it, i'l hook it up on the breadboard and update.
Thanks again.
regards
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
If they're red LEDs and your VCC >= 6V you can wire the LEDs like this.

Chris


Correction: You can change "can" to "should"! ;)
 

Attachments

  • 555OptoSchmittTggr.JPG
    555OptoSchmittTggr.JPG
    32.8 KB · Views: 1,773
Last edited:

EinarA

Feb 11, 2013
28
Joined
Feb 11, 2013
Messages
28
BlinkingLeds, if you had tried my circuit you would have found it works perfectly. I suppose you have no way to tell good advice from bad, but the circuit is so simple it could have hardly hurt to do so.
 

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
BlinkingLeds, if you had tried my circuit you would have found it works perfectly. I suppose you have no way to tell good advice from bad, but the circuit is so simple it could have hardly hurt to do so.

hey man i'm not rejecting any circuit, i'm going to try any and all circuits posted here to be sure , don't warry :) i'l try your circuit
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
BlinkingLeds, if you had tried my circuit you would have found it works perfectly. I suppose you have no way to tell good advice from bad, but the circuit is so simple it could have hardly hurt to do so.

Have you performed a temperature analysis on your circuit?

Chris
 

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
If they're red LEDs and your VCC >= 6V you can wire the LEDs like this.

Chris


Correction: You can change "can" to "should"! ;)

I can also just use a fet after the 555 which will drive it just OK with the ac signal right?
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
I can also just use a fet after the 555 which will drive it just OK with the ac signal right?

If these are 20mA LEDs you don't need a FET. The LM555 will source and sink 200mA. The FET you're using is way overkill anyway.

Chris
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
hey man i'm not rejecting any circuit, i'm going to try any and all circuits posted here to be sure , don't warry :) i'l try your circuit

If you do and if you know how to test for hysteresis you will find his circuit (as is) very hairy. To find the hysteresis point isn't easy and the hysteresis window is extremely narrow. I modified it similar to what Duke suggested and obtained reasonable results though, Not as good as the 555 though. ;)

Chris
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
CDRIVE, nice work on this thread!

A 555 is a tidy way to implement hysteresis and it's versatile because of its high output capability.

I had drawn up a couple of circuits that used discretes, and forgot to post them. But there's no point, assuming the power supply is clean (555 needs protection in an automotive environment) and quiescent current isn't an issue (the standard 555 draws quite a few milliamps).

To the OP. The resistor between the phototransistor collector and VCC could be replaced by a trimpot with a resistor (4k7) in series with it, to give adjustable sensitivity.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
CDRIVE, nice work on this thread!

A 555 is a tidy way to implement hysteresis and it's versatile because of its high output capability.

Dunka!
Considering that the 555 is a linear chip that can seamlessly integrate into both TTL and MOS logic families, I think it's safe to say that there's never been a more versatile and ubiquitous (none uC) chip ever made. Considering the availability of powerful uC's today it's amazing that the longevity of the 555 seems immortal. For those aviation enthusiasts among us; the 555 is the DC3/C47 of the electronics world. ;)

Chris
 

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
Thanks for helping me out guys. I don't have any problem with hysteresis, i could very well use something that has no hysteresis ie if below 5v switch off if more than 5v switch on. My only problem is the space issue.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Use an SMT 555 (SO-8 package). That plus 2~3 passives should work out about the same size as one or two transistors and five-odd passives.
 

sirch

Dec 6, 2012
109
Joined
Dec 6, 2012
Messages
109
CDRIVE, nice work on this thread!

I had drawn up a couple of circuits that used discretes, and forgot to post them. But there's no point

Kris - it would be great if you could post them, they could be of use...
 

sirch

Dec 6, 2012
109
Joined
Dec 6, 2012
Messages
109
not bothered either way as a light (or more specifically IR) pulse is going to trigger an MCU to do something on an interrupt. It does need to be a fairly sensitive digital switch though.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
The BC548C has a beta of ~ 1.3K, This should be more than enough to amplify your signal. On the other hand the signal from the PT can be sent directly to a uC's Infra or ADC input.

Chris
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
As you asked for it, here's a reasonably clean design, I think.

attachment.php


Regarding hysteresis. If you're working with any quantity that represents a physical variable, i.e. light intensity at a particular location in this case, and you're driving an interrupt-capable input, you want hysteresis. Trust me.

Its operation should be clear enough. The hysteresis is achieved by varying the voltage at the top end of the threshold ("thr") trimpot; this voltage drops by a few volts when the LEDs turn on.
 

Attachments

  • LEDHYST.001.GIF
    LEDHYST.001.GIF
    5.6 KB · Views: 250
Last edited:

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
CDRIVE
Your 555 schmitt trigger works like a charm i think i'm going to use that circuit because i have some smt 555s and it will much smaller that way than the other transistor circuits (i don't have any smt transistors YET :) )
Thanks.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
"I love it when a plan comes together" Quote: Hannibal Smith ;)

You're welcome!
Chris
 
Top