Shop OBEX P1 Docs P2 Docs Learn Events
How To Hook Up an Optek Slotted Switch to a BASIC Stamp 2 setup — Parallax Forums

How To Hook Up an Optek Slotted Switch to a BASIC Stamp 2 setup

MidnighterMidnighter Posts: 13
edited 2007-09-14 05:44 in BASIC Stamp
A fellow robotics enthusiast recently gifted me with a handful of these Optek slotted switches that I could use for my machine's 'coin-op' activator, letting a nickel fall through a narrow slot with this switch incorporated into it so that it easily reads a reaction to activate the rest of my machine's sequence.

Problem is, I'm at something of a loss on just how to hook this up. I'm okay with LED switches, servos, and basic pushbuttons (I've been teaching myself gradually using the deluxe "What is a Microcontroller" package), but on this thing I fully confess to being a little stumped.

The switch is one of these series: http://www.optekinc.com/products/opto_slotted_N.asp (Part number listed is KB8190). Could one of you folks be good enough to give me a breakdown on how to hook it up and test it with a Basic Stamp 2 arrangement? Thanks.

Comments

  • FranklinFranklin Posts: 4,747
    edited 2007-08-02 04:07
    Don't find that part number, do you have any others? Usually one side is an led and the other is a phototransistor or such and when something breaks the light path the transistor switches from one state to the other.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-08-02 04:33
    Franklin is correct…All the devices listed on that page are essentially optical isolators. Two leads go to an IR LED and two go to a photo-transistor. In order to change states the output of the transistor must also have a pull-up resistor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • JonathanJonathan Posts: 1,023
    edited 2007-08-02 05:17
    If you dont find the spec sheet, it is easy enough to figger out. Using a 220 ohm resistor, take the two leads from one side and connect them to 5V. Measure the voltage across the leads. When you see the LED voltage drop, you have found the LED. Now using a regular LED and a 220 ohm resistor, experiment until you get the transistor connections right. Only takes a fw minutes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • hmlittle59hmlittle59 Posts: 404
    edited 2007-09-14 05:44
    Hello everyone,

    I need a ten(10) min. delay routine while monitoring a pin for High/Low...I will exit the routine when the pin changes state. I tried a nested for/next loop, but want to know the best way with PBASIC.
Sign In or Register to comment.