Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need help adding a on off IR LED/Phototransistor as switch

  1. Feb 23, 2012 #1
    I'm building a small project and would like some assistance from you folks.
    I have this motor 5rpm -12vdc and I'm using a Class 2 plug in transformer (input 12VDC 60Hz 23W - output 12VDC 1000mA) to power it up.

    I would like to add a IR LED/Phototransistor between the two to act as a on off switch.
    when a solid item goes between the LED and phototransistor it will stop or turn the motor off
    and when it's clear it will turn on.
    the distance of the IR LED/Phototransistor will be about two inches.


    thanks in advance.
  2. jcsd
  3. Feb 24, 2012 #2
    for a small application like this motor, you should invest in an arduinio. By doing this all you really have to worry about is a handful of line of code, and the usage of a NPN transistor, a flyback diode (to prevent current surge damaging electronic components when the motor stops)

    if you go this way, this youtube video should help out:
  4. Feb 25, 2012 #3


    User Avatar
    Science Advisor
    Gold Member

    With discrete components, you can do it this way (motor in place of lamp),


    with the switch & resistor replaced by a photo-transistor and operational amplifier.


    For details on how this works see:

    Transistor Switches
    Photodiode Light Detector
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook