Shop OBEX P1 Docs P2 Docs Learn Events
relay and boe — Parallax Forums

relay and boe

firealarmfreakfirealarmfreak Posts: 105
edited 2008-11-03 00:49 in BASIC Stamp
I have made a circuit for a button and programmed it as follow:

DO
IF (IN10 = 1) THEN GOTO "label".
lOOP

In that case, when the button is pressed, it will go to whatever label i specified.

Is it possible to replace the switch with a relay? So when the relays coils are deenergized, the NC closes and causes IN10 to = 1, and causes it to branch off to that specified label?

In other words, instead of pressing a button, just using a relay to switch on and off.

?

I want this so i can use an LCD display--so it will display a message if the relay is denergized.

Chris.

Comments

  • MikerocontrollerMikerocontroller Posts: 310
    edited 2008-11-02 03:03
    · This will·hold the Stamp pin·LOW while the relay coil is energized.··The Stamp pin goes HIGH when the relay coil·is de-energized·.· What are you driving the coil with?
    640 x 480 - 14K
  • firealarmfreakfirealarmfreak Posts: 105
    edited 2008-11-02 03:37
    12 volts. also how would i wire up a second relay so when the 2nd relay also lost power--it would switch to battery circuit for battery backup for my boe? Normal power is an ac-dc adapter but i also want a 9 volt battery connected so it is ONLY drawing from my main electrical when relay is on, and when relay is off it is ONLY drawing from battery..

    chris.
  • MikerocontrollerMikerocontroller Posts: 310
    edited 2008-11-02 04:57
    · Is this what you need?
    640 x 480 - 15K
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-02 13:58
    Instead of a second relay, why not just use a diode?· When the +12v is on, it supplies the relay, and when the +12v is off, the battery takes over.· First verify that the 9v battery will actuate the relay despite the forward drop of the diode.· Typically it will.

    I see that I left out the pushbutton, but I'm sure you can supply it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
    904 x 713 - 4K
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-02 16:26
    duh.jpg
    There'll be a brief period of no voltage (a "glitch") when the contacts change and the Stamp could reset.

    You have a number of Subjects about "switching between 9V and 12V":
    http://forums.parallax.com/showthread.php?p=760234
    http://forums.parallax.com/showthread.php?p=757367
    http://forums.parallax.com/showthread.php?p=758823
    http://forums.parallax.com/showthread.php?p=755624

    POST EDIT 11/13/08:· I'm sticking·with my "policy" of answering members' questions as stated.··I may decide to answer a question with a question.· Notwithstanding, if somebody's question is about relays then I'll give an answer about relays.

    Post Edited (PJ Allen) : 11/14/2008 12:59:54 AM GMT
  • Carl HayesCarl Hayes Posts: 841
    edited 2008-11-02 17:04
    Oops, I thought you wanted backup for the relay.· You want backup for the Boe.

    In general, you can use diodes to connect redundant power supplies and isolate them from each other.· See the figure.· You could have two power supplies, as shown in this figure, or two thousand power supplies, it doesn't matter.· Whichever one puts out the greatest voltage wil be the one feeding the load at any given time.

    In the case of a wall wart, it almost certainly has a diode inside (that's how it rectifies the current it supplies), so the leftmost diode can be omitted.

    There will be no interruption at all in power to the load when any supply quits.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i
    800 x 548 - 3K
  • MSDTechMSDTech Posts: 342
    edited 2008-11-03 00:49
    I agree with Carl, by using diodes you eliminate the pulse of the relay switching. If you want to monitor the power source to light an LED, just build a voltage divider network and attach and ADC. Your stamp can monitor the voltages and take apporpriate action when the primary power source drops out.

    The attached drawing shows a 4 input power monitor. If you only have two, replace the ADC0834 with an ADC0832.
Sign In or Register to comment.