Shop OBEX P1 Docs P2 Docs Learn Events
State Monitor Circuit Needed — Parallax Forums

State Monitor Circuit Needed

WingnutWingnut Posts: 3
edited 2007-07-24 03:10 in General Discussion
Hello all,

This is my first post and I applogize in advance if posted incorrectly.· I'm an old EE guy whose been away from the design & build stages for many years.· I ran across·"basic stamps" while researching a project I am working on for work.· Basic stamps is brand new to me and I wonder if I can take a few minutes and ask some questions??

I am designing a 32-channel state monitor circuit, aka, S/H circuit.· I have a need to monitor upto 16 spdt w/center rest·switches connected to Vcc.· (Common switch leg tied to Vcc, then the two outputs tied to seperate channels being monitored)· Then transmit the switch states 1000' feet away.· At the receiver end, are 16 spdt, center rest relays that control various 1-Hp chain hoist motors.

My initial design uses 74HC165 parallel to serial shift registers -> RS485 Link - 1000' - RS485 -> 74HC595 serial to parallel shift register tied to the relays.

Each switch operates in this manner:

Switch in the up position, causes the corresponding relay to latch up, hoist motor travels UP.
Switch in the center position.· Hoist at rest.
Switch in down position, cause the corresponding relay to latch down, hoist motor travels DOWN.
I have other safeties design in the overall design.

My question is can this be done with a basic stamp design?· If so, would someone be willing to lend their·abilities to help me get this out of my brain and in the air?· Or is this way overkill??·

Many thanks,
Gene
GLangeull@memorialcoliseum.com

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-07-13 19:26
    This post is being moved from the Completed Projects Forum to the Sandbox Forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • kjennejohnkjennejohn Posts: 171
    edited 2007-07-14 01:54
    I don't own a stamp, so can't give you specifics, but I can give a few ideas. No, it's not overkill, as a 1000 feet of multi-conductor cable gets real expensive real quick. It could be DONE, but having a simple duplex (bi-directional) serial interface using RS485 (NOT RS-232!) between two Stamps makes a whole lot more sense, and should be easy to implement. Also, you can introduce simple control logic, like "the user indicates he wants circuit 16 to activate, lowering the hoist, but the hoist's lower-limit switch indicates it's already down, so I'll signal this fact in an audio signal that makes a Bronx Cheer ("RAZ-Z-Z-Z!")." And dual twisted-pair communications cabling is much cheaper!
    Use the LTC1481 IC for this communication. The sheet is here:
    www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1007,C1017,P1023
    and a design note:
    www.linear.com/pc/downloadDocument.do?navId=H0,C1,C1007,C1017,D4301

    All switches will, of course, go to a corresponding pin on a 74xx165 ser>par shifter IC. Each of these pins must have a known logic state at all times. Since your switches don't provide a level at the mid position, you'll have to install pull-down resistors (say 10kOhm, connected to ground) at each '165 pin to produce a low level. Since each switch has two outputs you'll have four switches per IC. This means you'll have four shifter ICs. The stamp must provide a common pin to drive each '165's latch pin (pin 1), another for all four shift-out pins (pin 2), and one for each of the output pins (pin 9). That's six Stamp pins altogether. All the CE pins (pin 15) of the 165's gets grounded. I believe the Stamp has a SHIFTOUT command which can be used to step all the switch levels into the Stamp. The trick is, each reading is just one bit each from four different ICs. You'll have to devise a method to associate all these bits with their intended relays at the other end. You can probably do this with a table. Parallax has a great guide on doing control work with a Stamp, so check it out for ideas. Once all this is wired, you just read these shifter ICs over and over, looking for highs, which indicate turning on a relay. This process is called "polling". Every time the Stamp finds a high, it must then check to see if the relay isn't already ON. This is also done in a table. So, flip a switch, have the Stamp catch this, check a status table to see if it isn't already ON, set a bit in a table high to keep track that it's ON (if you haven't already), then signal the other Stamp which relay to activate. Of course you'll want another table to keep track if that hoist isn't already fully in that direction, then signal the operator to that fact (RAZ-Z-Z-Z!).

    As for communicating, you can use the SEROUT (this thing does have a SEROUT, right?). You must define what the message looks like. "6D" for "hoist 6 down", f'rinstance, or "5U" for 5 up. Also, you'll want a status check, like "?" at power up or reset or every time you start a hoist moving. This gets the hoist controller Stamp to send you the limit-switch levels. That way you can build or update the table mentioned above to keep track of where the hoists are. The Stamp at the hoist end uses SHIFTIN (yes? no?) to get these commands. This is a half duplex situation. The hoist Stamp only talks (SHIFTOUT) if the switch Stamp sends a command or when a hoist reaches its limit, up or down. You should have the hoister repeat the command back to the switch Stamp for confirmation. After a command, the switch Stamp does a continuous SHIFTIN waiting for the hoist Stamp to repeat the message and send fresh limit-switch data. Use a time out here to detect problems. If the hoister doesn't respond for any message in a suitable amount of time signal the operator of a possible problem.

    At the hoist end, the Stamp uses a few pins for the 74xx595 ser>par IC to control relays, a few pins to drive a 74xx165 which passes the limit switch levels to the Stamp, and a few pins to communicate with the switch Stamp. And a few pins to drive an octal latch, like the 74xx573, because if you just use the '595, you'll drive every relay on temporarily as you march an enabling level through all the outputs. And turn off every relay you had on as you march a disabling signal through all outputs. You need to set up the levels for all the relays at the '595s, THEN latch them in place with the '573s. Here's a site for the 74HC573 latch:
    w3.id.tue.nl/fileadmin/id/objects/E-Atelier/doc/Datasheets/74hcXX/74hc573.pdf

    You'll need something to drive the relays as the '573s lack the oomf. This can be a plain transistor, FET, or driver chip like the ULN2803, whose data sheet is:
    www.ozitronics.com/data/uln2803.pdf.
    For those not familiar with this chip, it is an inverting, open-collector high voltage driver with builtin reverse EMF suppression diodes. Basically, you put a TTL high (2V to 5V) into the 2803's input to get a connection to ground. This output goes to one side of the relay's coil. The relay coil's other end goes to its operating voltage, up to 50V! The 2803 can handle 500mA per pin, but NOT all eight at once for a long time, or the chip overheats and destroys itself! So, you latch a high level out of the 573 to the 2803, which connects the relay to ground, thus turning it on. Put a low out of the 573, the 2803 goes open collector (no drive at all), the relay turns off and the 2803's protective diode channels the relay's kickback voltage safely from the output Darlington.

    And that's pretty much it. Sorry if this turned into an article. All you need now is a system to keep track of the hoist's status (full up, full down, or in transit), where the switches are set, and how you communicate all this to the operator and between stamps. You decide if you want the limit switches to turn off the hoist motor after activation, just supply a signal to the Stamp, or both. Once again, read parallax's book on controllers.

    And have fun!
    kenjj
  • kjennejohnkjennejohn Posts: 171
    edited 2007-07-14 03:25
    Nuts! Meant to say the two Stamps use SEROUT and SERIN for communications, if they support these commands. SHIFTOUT and SHIFTIN would be used for getting or sending data in or out of the shifter ICs.

    So much for proof reading.
    kenjj
  • stamptrolstamptrol Posts: 1,731
    edited 2007-07-14 12:16
    Hi Gene,

    There are a number of ways to accomplish what you want.

    Basically, you need to get the switch positions into the Stamp at the local end. This can be easily done with a simple input mux arrangement.

    The link can be any wireless technology that gives you the range reliably. I use data radios in the 900 MHz range for longer range and less interference from the increasing amount of 2.4 Ghz equipment.

    At the remote end, a second stamp decodes things and operates the hoists, again probably through a mux/demux arragement. Obviously, some attention has to paid to safety issues on loss of signal and the like, as you're already aware.

    There are also some relay boards that receive serial data directly from a data radio and operate relays in response to the data sent. They are available in 16-relay versions, but are easy to cascade.

    Can you give us a bit more information, maybe a sketch? Are there people around the hoists when they're operating, for instance?

    Cheers,

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

    http://www.siskconsult.com
    ·
  • WingnutWingnut Posts: 3
    edited 2007-07-17 02:05
    Hey all!

    Wow! I dodn't think I'd get this much help. I need to keep the circuit wired. I have so much wireless stuff in our arena at the moment that I cannot afford a mishap. Also, these hoist motors run, hockey nets, AF2 Football nets and various screens. The last thing I need is for a motor to take off during a game.... So its kind of a life-safety issue here I'm dealing with, hence wired is the way I want to head off towards. I need to fully digest what has been posted here and see if I can get this to work. If I can get this to actually work I can see where other arena's would be happy to have a system install in their building. I'm all about sharing...so I'll report back!!!

    Many thanks.
    Gene

    GLanguell@memorialcolisuem.com
    www.Memorialcoliseum.com
  • WingnutWingnut Posts: 3
    edited 2007-07-24 03:10
    Link to my version of the circuit, parts list and a few emails with folks I have had contact with.

    Thanks,
    Gene

    www.memorialcoliseum.com/gene.asp
Sign In or Register to comment.