Connect with us

IR Proximity sensor

Discussion in 'Sensors and Actuators' started by kosmonavt, Oct 21, 2011.

Scroll to continue with content
  1. kosmonavt

    kosmonavt

    7
    0
    Oct 21, 2011
    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?
     

    Attached Files:

    Last edited: Oct 21, 2011
  2. kosmonavt

    kosmonavt

    7
    0
    Oct 21, 2011
    Hey guys, anybody?
     
  3. Resqueline

    Resqueline

    2,848
    2
    Jul 31, 2009
    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?
     

    Attached Files:

    • circ.PNG
      circ.PNG
      File size:
      34.4 KB
      Views:
      253
  4. kosmonavt

    kosmonavt

    7
    0
    Oct 21, 2011
    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: Oct 23, 2011
  5. Resqueline

    Resqueline

    2,848
    2
    Jul 31, 2009
    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?
     
  6. kosmonavt

    kosmonavt

    7
    0
    Oct 21, 2011
    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.
     
  7. Resqueline

    Resqueline

    2,848
    2
    Jul 31, 2009
    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.
     
  8. davenn

    davenn Moderator

    13,676
    1,892
    Sep 5, 2009
    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
     
  9. davenn

    davenn Moderator

    13,676
    1,892
    Sep 5, 2009
    basic cct.....

    [​IMG]


    cheers
    Dave
     

    Attached Files:

    Last edited: Oct 25, 2011
  10. Resqueline

    Resqueline

    2,848
    2
    Jul 31, 2009
    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.
     

    Attached Files:

  11. duke37

    duke37

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

    davenn Moderator

    13,676
    1,892
    Sep 5, 2009
    ok thanks for info :) not something I have played with overly often. circuit modified

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

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

    cheers
    Dave
     
  13. kosmonavt

    kosmonavt

    7
    0
    Oct 21, 2011
    @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.

    :)
     
  14. Resqueline

    Resqueline

    2,848
    2
    Jul 31, 2009
    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.
     
  15. davenn

    davenn Moderator

    13,676
    1,892
    Sep 5, 2009
    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
     
  16. kosmonavt

    kosmonavt

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

    davenn Moderator

    13,676
    1,892
    Sep 5, 2009
    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
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-