Shop OBEX P1 Docs P2 Docs Learn Events
Relay control timer — Parallax Forums

Relay control timer

FklaasFklaas Posts: 15
edited 2005-02-21 14:14 in BASIC Stamp
I need to control some relays with timer A" solinoid runs for 2sec. B" solinoid runs for 1Sec. C" solinoid runs for 2 Sec. Like this

A,on
A,off

B,on---B,off

C,on
c,off

goto main;

would be really coool to add more with fully start and stop points!

Thanks, Frank

Comments

  • FklaasFklaas Posts: 15
    edited 2005-02-18 21:07
    From, Frank oh Yea my stamp is bs2p , ya think maybe I need a 555 ? thanks, Frank
  • David KissickDavid Kissick Posts: 15
    edited 2005-02-21 03:46
    Questions about your project. Is this a sequence that will be repeating over and over? If so, is this the pattern that you're trying to create:

    A initially on two seconds. Off for two seconds
    B initially off for one second. On for one second. Off for two seconds
    C initially off for two seconds. On for two seconds

    Total sequence time 4 seconds.

    Is this basically the pattern you're trying to recreate? (Though B looks like it may be 1.5 seconds off, but it gets the idea). A 555 timer is possible, but you would probably have to use at least two. Since A and C alternate, you could control both of those with the high-low cycle of a 555 timer set at 50% duty for two seconds each. B would need it's own timer. Otherwise, it might be possible to just use the Stamp by using the Pause command and making the corresponding pin High or Low. Don't know if this helps, but hopefully it gives you a starting point.

    David
  • BorisBoris Posts: 81
    edited 2005-02-21 14:14
    How accurate do you need the timing to be. You can just connect a solenoid through a transistor (or transistor-relay combination) to an appropriate pin, and set pins high/low acocrdingly and use the PAUSE command in between.
    Just make a single list of events:
    "
    A,on
    A,off

    B,on---B,off

    C,on
    c,off
    "
    so set pin numbers for all of your solenoids (this is NOT Basic code, just a list of steps)
    Start:
    PIN A-high
    Pause 500
    PIN B-high
    Pause 1000
    Pin B-low
    Pause 500
    Pin A-low
    Pause 500
    Pin C-high
    Pause 2000
    Pin C-low
    Pause 1000
    Goto Start
    And you can always turn this into a loop, if you want the sequence to repeat. I asked about the precision of timing needed for your application because each command execution takes some time, very little time but should be accounted for in order to acheive high precision. If you only have 3 solenoids, and that is the only thing you are using the BS2 for, it might be cheaper to use 555 timers (or 556-2 timers in 1 package).
Sign In or Register to comment.