587,760 active members*
2,840 visitors online*
Register for free
Login
IndustryArena Forum > CNC Electronics > CNC Machine Related Electronics > Opto Limit/Home switches from a mouse?
Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2005
    Posts
    302

    Opto Limit/Home switches from a mouse?

    Has anyone every hacked a computer mouse to harvest the two optos in there for limit/home switches? I have no problem interfacing a plain ole switch to my HCNC, but don't know what extra electronics would be required for an opto. Has anyone done this? Got a schematic? Thanks.

    Rance

    PS: I realize that dust can be a problem with opto switches out in the open so I have a solution to that but I don't want to cloud this discussion with that issue.

  2. #2
    Join Date
    Nov 2004
    Posts
    131
    I think you only need two resistors.
    One on the emitting side that limits the current through the led.
    And you'll probably need a pull-down on the receiving side.

    Those resistors can be found in the mouse.
    I believe most mouses use 5V ( If not all ).

    I have the internals of a ball mouse laying around at work.
    I'll look into it tomorrow.
    ____________________________________
    Jeroen

  3. #3
    Join Date
    Oct 2006
    Posts
    29
    I don't have a picture of what I described to Acondit, it was just in my imagination. Perhaps I can explain it another way.

    Take a pie tin, cut out a hefty portion, like you would if it was pie. Bang it flat with a hammer. Hold it between your fingers by the tip with the rounded end down. Let it swing. it only swings one way. You're holding the pivot point between your fingers.

    Use the other hand and a finger to push one side so it swings. If you push the bottom an inch, it moves an inch. If you push it an inch, but half way up to your other hand, it moves the bottom 2 inches, twice as fast. Is this easier to picture?

    Acondit prefers to block the light to switch. So he would just make the bottom end go between the LED and the phototransistor to block it. I prefer to let light cause the switch. So I would first block the light, then let it shine through a tiny hole to switch.

    Which is better? I can't say because I think it's not how or when the sensor switches that counts. It's how fast it does it, and how fast you can detect it that counts.

  4. #4
    Join Date
    Jun 2005
    Posts
    1436
    But I think if you use the presence of light to make the switch it is not "fail safe" ?

    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  5. #5
    Join Date
    Oct 2006
    Posts
    29
    Well, fail-safe is application specific. As far as the optical sensor is concerned, a defective LED or problem with the LED power would pass on a false "switch blocked". If that shuts down some things it's good, but other shut downs are hazardous, even lethal. It's always the action that determines if something is fail-safe, not neccessarily the state of some poor sensor.

    If the phototransistor fails it depends on how it's used. With a pullup resistor to the collector the unblocked output would be around 0 volts, and if it were blocked, say 5 volts. Those conditions can be inverted by using a pull down resistor from the emitter to ground and taking the output from the emitter through a 1K resistor or buffer.

    The most common scenerio's requiring fail-safe protections are power failure, human error, then component failure. Unfortunately, fail-safes also fail, I can think of several examples. It's usually through human error.

    The failure mode of LEDs is an open.
    The failure mode of phototransistors is an open.
    The other failure mode is problably somebody else's fault!
    -

  6. #6
    Join Date
    Jun 2005
    Posts
    1436
    Quote Originally Posted by moonlighttech View Post
    Well, fail-safe is application specific. As far as the optical sensor is concerned, a defective LED or problem with the LED power would pass on a false "switch blocked". If that shuts down some things it's good, but other shut downs are hazardous, even lethal. It's always the action that determines if something is fail-safe, not neccessarily the state of some poor sensor.

    If the phototransistor fails it depends on how it's used. With a pullup resistor to the collector the unblocked output would be around 0 volts, and if it were blocked, say 5 volts. Those conditions can be inverted by using a pull down resistor from the emitter to ground and taking the output from the emitter through a 1K resistor or buffer.

    The most common scenerio's requiring fail-safe protections are power failure, human error, then component failure. Unfortunately, fail-safes also fail, I can think of several examples. It's usually through human error.

    The failure mode of LEDs is an open.
    The failure mode of phototransistors is an open.
    The other failure mode is problably somebody else's fault!
    -
    Sorry, I didn't realise it was so complex. (chair)
    I thought the thread was just about using a mouse led/sensor for a limit switch.
    Regards
    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  7. #7
    Join Date
    Jan 2005
    Posts
    302
    Quote Originally Posted by greybeard View Post
    I thought the thread was just about using a mouse led/sensor for a limit switch.
    Regards
    John
    Actually I don't care if you ACTUALLY got it from a mouse or not, that's just easier for me. Maybe I should have titled it light activated limit/home switches.

    Moonlight, thanks for the clarification(s).

  8. #8
    Join Date
    Jun 2005
    Posts
    1436
    :wee: Irony is dead, long live irony :wee:

    Regards
    John
    It's like doing jigsaw puzzles in the dark.
    Enjoy today's problems, for tomorrow's may be worse.

  9. #9
    Join Date
    Oct 2006
    Posts
    29
    Sorry John, I didn't mean to confuse you.

  10. #10
    Join Date
    Oct 2006
    Posts
    29

    Smile

    I'm glad something worked!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •