Shop OBEX P1 Docs P2 Docs Learn Events
Making pin 'virtual ground' — Parallax Forums

Making pin 'virtual ground'

SebastianSebastian Posts: 2
edited 2007-04-13 19:24 in BASIC Stamp
Hello,

Is there a way to tie an IO Pin on the STAMP to ground? (through coding, not a physical connection smile.gif )

I am trying to control a device using the basic stamp that requires I short two wires. After some thinking, I realized this is not possible on the stamp without the use of a relay. I investigated the device I am controlling and found one of the wires is the same as ground.

So, this means that if I can ground the other wire, I make the 'connection' that I need, and activate the corresponding function on the device.

So, long story short, is there a way to make one of the STAMP's pins look like ground?

I am not in my lab at the moment, so I apologize about posting this idea without testing it first, but:

If I set a pin on the STAMP as an input, will it look like a virtual ground that flows very little current?

Is there some other way I could do this without the use of a relay?


Thank you in advance,
Sebastian

Comments

  • hitswarehitsware Posts: 156
    edited 2007-04-13 10:09
    LOW,0 'makes pin 0, ground
    HIGH,5 'makes pin 5, 5 Volts
    INPUT,3 'makes pin 3, open
  • stamptrolstamptrol Posts: 1,731
    edited 2007-04-13 11:37
    Keeping in mind you cannot allow too much current to flow. As long as the controlled device draws something in the order of 20 mA everything should be fine.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-04-13 14:32
    Why not use a transistor to ground the signal? An NPN transistor or N-Channel MOSFET could be controlled from the Stamp I/O pin using a HIGH command to “ground” the other signal, depending on its properties.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • SebastianSebastian Posts: 2
    edited 2007-04-13 17:38
    Thank you for the replies.

    It looks like the STAMP can't do it on its own. I tried making a pin low, but it does not activate the device when connected to it - probably not enough current.

    I was hoping not to need any other components, but your suggestion seems to be the easiest Chris. Looks like I have to go scavenging for a transistor array!

    Sebastian
  • skylightskylight Posts: 1,915
    edited 2007-04-13 19:24
    did you tie the other wire to the stamps supply ground? if the device works by touching the two wires together and one wire is ground then using a stamp to ground the active wire would entail making sure that the devices ground(the one you think is ground)·is connected to the stamp ground for it to work.
Sign In or Register to comment.