Shop OBEX P1 Docs P2 Docs Learn Events
Really Stupid Question — Parallax Forums

Really Stupid Question

isaachisaach Posts: 3
edited 2012-10-28 21:50 in BASIC Stamp
If I have an external button that has a constant 4.89 volts on it, and when you press the button it breaks the circuit. How can I emulate this on my board. I can't just use a HIGH command because the external button has its own circuit and power. Any help would be appreciated.

Thanks

Comments

  • NWCCTVNWCCTV Posts: 3,629
    edited 2012-10-28 19:11
    Which board? Prop, Stamp or ???? The more info you provide the better the chances you will get a decisive response.
  • isaachisaach Posts: 3
    edited 2012-10-28 19:14
    Ah sorry, I'm working with the Board Of Education Development Board and a BS2 microcontroller.

    Thanks
  • ercoerco Posts: 20,257
    edited 2012-10-28 20:02
    Not a stupid question at all. You could use a reed relay to provide isolated switching for an external circuit. Radio Shack has a 5V reed relay (20 mA) that a Stamp pin can drive directly.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-10-28 20:14
    If you have a relay that the Stamp can't drive directly you'd use a transistor (it doesn't have to be a 2N3904 transistor, many NPN transistors would work).
    *************************************************
        Relay Schematic
    *************************************************
    
                                               5.0V
                                         ─┴─    
                      Load to switch  ──┘ └────┼───── Load to switch
                                       ┌──────┫     
                                       ┣──────┘     
                                       │                     
                  Stamp Pin ─────── 2N3904  
                                   R1  │
                                       │
                                       
                                      Vss
     
    

    The schematic shows a normally open relay but you'd want a nomally closed relay. Many relays have one pin for normally open and another for normally closed.

    I don't use Stamps much so I'm just guessing a 500 ohm would be an okay value for R1. I hope someone corrects me if I'm wrong.

    You want to use a diode across the relay coils to protect the Stamp from voltage spikes caused by the coil. You want the diode whether or not use use a transistor.
  • ercoerco Posts: 20,257
    edited 2012-10-28 21:50
    10 mA reed relay for $1.29 : http://www.goldmine-elec-products.com/prodinfo.asp?number=G18683

    BEAT THAT, Duane Degn! Low power, no transistor, no resistor! Just yer typical flyback diode.

    While you're ordering from EG, get a few of these adapters on sale for $1.69, they can power a BoE: http://www.goldmine-elec-products.com/prodinfo.asp?number=G17336
Sign In or Register to comment.