Maker Pro
Maker Pro

Simple Phototransistor switch circuit

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
Hi, i have a matching pair of ir led/phototransistor that i want to use as an light switch. The problem is that the phototransistor's output is proportional to the strength of the ir light that it receives, so the mosfet that it drives has a dimming effect. How can i make it so that it only turns off or fully on?
Best regards.
 

Attachments

  • phototransistor.jpg
    phototransistor.jpg
    40 KB · Views: 1,295

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Hi blink, welcome to the forum.

A comparator will sense the difference between two voltages and then switch quickly when one exceeds the other.

Bob
 

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
Hi blink, welcome to the forum.

A comparator will sense the difference between two voltages and then switch quickly when one exceeds the other.

Bob

Thanks for the welcome

So how do i wire it up then?
I'm a newbie sorry. :)

PS. After a quick search i found that those ic's are relatively big, i was hoping for something small that will not make my circuit much bigger. Is there no other way?
 
Last edited:

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
1. You do not have anything to limit the current through the leds.
2. You do not have anything to distribute the current to each led.
A resistor in series with each led will do the job.
3. The convention is that lines at a cross do NOT connect. Use two Ts.
4. An added transistor could provide some positive feedback to give some hysteresis.
 

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
1. You do not have anything to limit the current through the leds.
2. You do not have anything to distribute the current to each led.
A resistor in series with each led will do the job.
3. The convention is that lines at a cross do NOT connect. Use two Ts.
4. An added transistor could provide some positive feedback to give some hysteresis.

oops sorry, forgot to draw the resistors, i do have a 1k resistor in series with each led sorry.
where should i add the transistor?
 

Attachments

  • phototransistor 2.jpg
    phototransistor 2.jpg
    48.9 KB · Views: 707

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Here is the idea, when the fet turns on it turns on the pnp which provides current to turn on the fet, there is therefore a tendancy to latch. The amount of feedback is controlled by the variable resistance, this will need to be found by experiment without data on the output of the detector.
 

Attachments

  • hysteresis 001.png
    hysteresis 001.png
    4.3 KB · Views: 806

EinarA

Feb 11, 2013
28
Joined
Feb 11, 2013
Messages
28
I created a circuit very similar to Dukes last year that is less likely to latch up. The NPN transistor , Q1, forms a simple current sink that pulls down the gate voltage until the current in the phototransistor exceeds it. Now the gate voltage rises until the MOSFET turns on, which reduces the drive to Q1 ensuring the FET turns on completely. The 1 M pot adjusts the sensitivity; you will probably find it will work without, just connect the 10M resistor to the junction of the 470R and thevLEDs. It helps to select an NPN transistor with low gain.
This circuit is easily adapted to switch on in the dark or to work with different output voltages.
 

Attachments

  • image.jpg
    image.jpg
    43.5 KB · Views: 784

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
EinarA

That looks like a good start, however, I would drive the base from the drain of the fet so it is turned fully on or off.
In order to avoid the problem of npn gain, I would put a resistor in its collector to set the hysteresis.

Duke
 

EinarA

Feb 11, 2013
28
Joined
Feb 11, 2013
Messages
28
The point is to create dueling current sources. This gives the combination very high gain. The NPN should be biased so it is only partly on at all times. I have already tested the circuit and know it works. Using a slightly more complex biasing method will allow switching at very low photo currents. Hysteresis is created by having the NPN switch between two set points.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
The two set points should be the npn fully on of fully off.
The amount of hysteresis sould be set by a resistor in the collector. Too much feedback (too low a resistance) will latch the circuit in one direction permanently.
 

EinarA

Feb 11, 2013
28
Joined
Feb 11, 2013
Messages
28
NO. You do not understand how to create a positive positive feedback circuit. To have the output switch form off to fully on in one instant, positive feedback must exceed any negative feedback at ALL values of the output voltage. This requires it be continous and reasonably linear. None of your circuits achieve this.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
The Op does not want a linear circuit, he wants to switch the output fully on or off.
The positive feedback alters the set point to give a dead band.

Perhaps *steve* or Harald could adjudicate on this.
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
A 555 makes a decent Schmitt trigger

Chris
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Yes, a 555 would do the job with a feedback resistor. It would replace the fet also if he only wants to drive a couple of leds.
 

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
Yes, a 555 would do the job with a feedback resistor. It would replace the fet also if he only wants to drive a couple of leds.

Thanks for the answers.
If it works with a 555 i could get pin 3 to a fet's gate and get the job done right?
The only problem is... I don't know how to make a 555 a schmitt triger.
It would be good if it had some sort of adjustment.
regards
 

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
ok found some small comparators like LM311 or LM393
The questions is, what's better? Schmitt or comp?
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Yes, a 555 would do the job with a feedback resistor. It would replace the fet also if he only wants to drive a couple of leds.

Why would a feedback resistor be needed? The trigger pin needs <=1/3 Vcc to trigger the output high. After that event occures it requires >=2/3VCC to trigger it low again. That's plenty of hysteresis. ;)

Chris.

Edit: I think I have at least two errors in my statement. I'm working it out and will correct any mis-speaks.

Edit2: Yes, I made an error. The Trigger pin doesn't have the >=2/3VCC characteristic. The Threshold pin does. The 555 will operate as a Schmitt Trigger if the Trigger & Threshold pins are tied together.
 
Last edited:

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Here's some curves for you.

Chris
 

Attachments

  • 555SchmittTggr.JPG
    555SchmittTggr.JPG
    32.6 KB · Views: 243

BlinkingLeds

Feb 23, 2013
180
Joined
Feb 23, 2013
Messages
180
Why VF1 splits in 2 and part of it continues to be high and the other part goes low? confused
 

CDRIVE

Hauling 10' pipe on a Trek Shift3
May 8, 2012
4,960
Joined
May 8, 2012
Messages
4,960
Why VF1 splits in 2 and part of it continues to be high and the other part goes low? confused

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
 
Top