Shop OBEX P1 Docs P2 Docs Learn Events
making a connection — Parallax Forums

making a connection

Jayguy5000Jayguy5000 Posts: 139
edited 2007-08-31 16:46 in BASIC Stamp
My mission is to use the bs2 (preferably 1 I/O pin) to short out 2 pins on another circuit. I dont want to get into what the pins are for. All I need is to make these two pins connect with each, using the bs2 to be say when they connect and whey they arn't. They only need to stay connected for a small moment, such as a button push, ok thats how I can describe it. Instead of connecting these two pins to a push button I am connecting them to a bs2 to do the connecting. how can I make the bs2 connect the two pins together?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.

Comments

  • D FaustD Faust Posts: 608
    edited 2007-08-30 21:20
    If you want them isolated use an optoisolator, if not, use a transistor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-08-30 21:31
    I think we've been through this once before:

    ····http://forums.parallax.com/showthread.php?p=667254

    I take it you've given up on the relay. It would be helpful, though, it you could tell us the following about the pins you want to short:

    ····1. AC or DC?
    ····2. When open, how many volts between them?
    ····3. When closed, how much current?

    -Phil
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2007-08-30 22:19
    oh that was a whole different project, that works great tho! the pins im trying to short are on a keyboard encoder. I tried to refrain from mentioning it becuause usually people argue with me about controlling a keyboard encoder. This one was bought on ebay for the use of arcade machines. it has pins sticking up that would be the same as the pins on a motherboard for the A: drive. when two pins are connected via button press a certain letter is put through the ps2 cable into the computer. I just want to use the bs2 instead of a button. I suppose a transistor would work, I havn't had any luck with it yet tho. how should I hook it up and what do you use for a program?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-08-30 22:57
    The first thing you need to do is figure out what the polarity is. Just put a voltmeter across the two sides of the switch. The keys are probably being scanned, so the voltage reading may be quite low, but at least you should be able to determine the polarity. Next, connect an NPN transistor so the emitter is on the negative side and the collector is on the positive side. The negative side also needs to be connected to your BASIC Stamp ground. (If this is a problem, skip to the next paragraph.) Then connect your Stamp pin to the base through a 4.7K resistor, and you should be in business.

    If the common ground thing is a problem, you will need to use an optoisolator. Emitter and collector are connected the same as with a transistor. The Stamp pin will need to drive the opto's LED through a 220 ohm resistor.

    Good luck!
    -Phil
  • pwillardpwillard Posts: 321
    edited 2007-08-30 23:10
    It seems that's what CD4066's commonly are used·for. Give one of them a try. http://www.alldatasheet.com/datasheet-pdf/pdf/26881/TI/CD4066B.html

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    There's nothing like a new idea and a warm soldering iron.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-08-30 23:16
    At least with a 4066 you don't have to be conerned with polarity. You do have to respect the common-mode range of the switched voltages, though. Tying the BASIC Stamp ground to the keyboard ground will ensure compliance.

    -Phil
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2007-08-30 23:52
    ok, I will go to radio shack and find a few of them, how should hook it up to the pins and I/o pin? what code do I write?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Actually I think Im going to add the whiskers to my tank and let it roam, just need to figure out where.
  • tabbotttabbott Posts: 26
    edited 2007-08-31 16:46
    Phil Pilgrim (PhiPi) said...
    The first thing you need to do is figure out what the polarity is. Just put a voltmeter across the two sides of the switch. The keys are probably being scanned, so the voltage reading may be quite low, but at least you should be able to determine the polarity. Next, connect an NPN transistor so the emitter is on the negative side and the collector is on the positive side. The negative side also needs to be connected to your BASIC Stamp ground. (If this is a problem, skip to the next paragraph.) Then connect your Stamp pin to the base through a 4.7K resistor, and you should be in business.

    If the common ground thing is a problem, you will need to use an optoisolator. Emitter and collector are connected the same as with a transistor. The Stamp pin will need to drive the opto's LED through a 220 ohm resistor.

    Good luck!
    -Phil
    Once you have connected the transistor or opto as Phil stated above you can control it by using the HIGH and LOW command.
    For example, if you have the base to IO pin 6: HIGH 6 will connect (short)·the pins and LOW 6 will disconnect them.
Sign In or Register to comment.