Maker Pro
Maker Pro

IR Proximity sensor

kosmonavt

Oct 21, 2011
7
Joined
Oct 21, 2011
Messages
7
I want to make a Proximity sensor circuit which will stop a 12V motor when the object is 25 cm from the sensor. I am using this sensor:

GP2Y0A02YK0F
http://www.pololu.com/catalog/product/1137

The graph suggests that the voltage equivalent for 25cm is around 2.25VDC. This is what I have come up with so far:

A circuit labelled X will have a constant supply of 2.25 V. It is linked with another circuit (of the sensor itself). When the object is more than 25 cm, the voltage in the circuit will be less than 2.25 and there will be a potential difference between the two circuits. This potential difference will drive the transistor Y. This transistor will drive the 12 VDC motor.

When the object approaches the 25cm distance, the PD will become zero and the current through the transistor will stop.

Is this a correct plan?
 

Attachments

  • circuit.PNG
    circuit.PNG
    34.4 KB · Views: 337
Last edited:

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
You'd need a common reference between the sensor and the reference voltage, and separate galvanically isolated power supplies for the sensor and the motor.
A common supply would short the sensor and the supply together. Notice also the need for a 2.9V reference due to the transistor needing 0.55-085V to turn on.
It won't work in practice though, for a number of reasons. You'll need a more proper comparator circuit, driving an extra output transistor. How big is that motor?
 

Attachments

  • circ.PNG
    circ.PNG
    34.4 KB · Views: 253

kosmonavt

Oct 21, 2011
7
Joined
Oct 21, 2011
Messages
7
First off, thanks for the reply,

I don't actually have the motor but I am guessing that I'll be needing a 12V supply for whichever one I plug in there. Right now, my focus is basically the comparator circuit. What's the reason for a common ground by shorting the two -ve terminals together? And yes, I forgot the voltage needed for the transistor to turn on.

As for galvanic isolation between the sensor and the motor, I think I made a mistake. Any clue how to correct it?

Where exactly do I need the extra transistor?
 
Last edited:

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
How can they be compared if they're floating freely? They'll need to have a common connection if it's to make any sense trying to compare their voltages.
Then there's the matter of current gain in transistors. If the motor current divided by the available sensor current exceeds the transistor gain then the motor won't run.
I figure this is a shool assignment/task?
 

kosmonavt

Oct 21, 2011
7
Joined
Oct 21, 2011
Messages
7
No its not a school assignment. I am trying to build a car that stops when it is 25cm from a wall. I haven't started building it in practice yet hence I don't know which motor I am going to use, but it probably will be in 0-15V range.
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
Ok. Try to Google comparator circuit. A comparator can be bought as an IC, or made out of (minimum) two transistors and three resistors. I'd use a MOSFET for the motor.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
the layout you have done is very incomplete, you also havent supplied the sensor with any power its not going to work till then

The sensor output needs to be on the base of the transistor to turn it on
But as Res said ... you need a comparator IC say an LM311 to compare the voltage from the ref voltage source and compare that to the output from the sensor
and depending on your type of 12V motor ( ie. how much current it draws, will determine what sort of transistor you need after the comparator chip.

will draw up a basic layout for you to expand on ....

Dave
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
basic cct.....

attachment.php



cheers
Dave
 

Attachments

  • IR Sensor cct.GIF
    IR Sensor cct.GIF
    3.3 KB · Views: 1,157
Last edited:

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
That's a good one Dave. Only one detail to keep in mind about the LM 311 & 339 type of comparators is that they have an open-collector output.
Thus they either need a pull-up resistor or to drive a PNP transistor. Remember to swap the + & - inputs if driving a P-transistor instead of an N-transistor.
 

Attachments

  • IR Sensor cct.GIF
    IR Sensor cct.GIF
    3.3 KB · Views: 456

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
A 10k pull up resistor would be adequate when driving a fet and 12V is ideal to turn it fully on.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
That's a good one Dave. Only one detail to keep in mind about the LM 311 & 339 type of comparators is that they have an open-collector output.
Thus they either need a pull-up resistor or to drive a PNP transistor. Remember to swap the + & - inputs if driving a P-transistor instead of an N-transistor.

ok thanks for info :) not something I have played with overly often. circuit modified

did you miss something in that 2nd last sentance....

Thus they either need a pull-up resistor or to drive a PNP transistor

so a pull up to drive an NPN, is it a pull down to drive a PNP ? or..... ?

cheers
Dave
 

kosmonavt

Oct 21, 2011
7
Joined
Oct 21, 2011
Messages
7
@Rasqueline,

Thanks for the link. Have to look into it to learn how to build one without a comparator IC.


@davenn,

Thanks for the diagram. It gives me an insight of what I am actually trying to build.

:)
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
so a pull up to drive an NPN, is it a pull down to drive a PNP ? or..... ?
I guess I was kind of brief, as usual. ;)
Yes, a pull-up resistor only to drive an NPN or an N-channel MOSFET.
A series resistor only to drive a high-side PNP, or a pull-up only to drive a high-side P-channel MOSFET (if supply is less than 20V, if more use a series resistor too).
And use both a series resistor and a pull-up to drive a high-side PNP Darlington.
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
@Rasqueline,

Thanks for the link. Have to look into it to learn how to build one without a comparator IC.


@davenn,

Thanks for the diagram. It gives me an insight of what I am actually trying to build.

:)

I suggest you go the IC way for a start asnd get a working system, it will take enough playing around. You can play with multiple transistors at a later date. With only a basic knowledge of electronics, you dont want to make it too complex for a start :)

cheers

Dave
 

kosmonavt

Oct 21, 2011
7
Joined
Oct 21, 2011
Messages
7
Haha yes, my thoughts exactly. One question though, do comparator IC's qualify as discrete components just like logic gate IC's?
 

davenn

Moderator
Sep 5, 2009
14,254
Joined
Sep 5, 2009
Messages
14,254
Haha yes, my thoughts exactly. One question though, do comparator IC's qualify as discrete components just like logic gate IC's?

no they are not, nor are logic gate IC's, as they contain many transistors diodes etc

discrete components = transistor, diode, resistor, capacitor as individual items etc

the next step was hybrid modules --- often seen in older gear ( or modern power amplifier modules) where a number of components were mounted on a ceramic/alumina circuit base and then dipped in ceramic to seal it.

cheers
Dave
 
Top