Shop OBEX P1 Docs P2 Docs Learn Events
Relay board — Parallax Forums

Relay board

chaosgkchaosgk Posts: 322
edited 2010-03-27 03:30 in General Discussion
Does anyone have any good suggestions on which products to use to design a relay board that can handle 400+ independant relays?· I have seen versions of the relay board I want, but they only·run 16 channels. I need something that is either 400 on one board (size of the board doesn't matter) or have a master board with outputs to other boards that handle a smaller·number of relays on each board.··is it possible to·setup some type of daisychain.· I would prefer·to not·have to build 25 16 channel·boards if anyone has any good ideas please let me know.
·
«13456723

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-30 19:58
    The TI TPIC6595 is a combination of a 74HC595 serial to parallel shift register with the MOSFET equivalent of a ULN2803 high current driver. One TPIC6595 (or a 74HC595 plus a ULN2803) can drive 8 relays and they're cascadable indefinitely. Practically speaking, you might put 8 to 16 TPIC6595 in series for a total of 64 to 128 relays in a group. You could then have 4 to 8 groups of relays. A BS2p40 has 32 I/O pins which can easily handle the 4 to 8 series chains of TPIC6595s involved with two clock pins for each chain plus a common data pin. None of the Stamps has enough variable storage to hold the settings for all of the relays, but the BS2p40 has a 128 byte scratchpad RAM which could easily be used for that purpose with room to spare.

    You could easily use the 74HC595 / ULN2803 combination for each set of 8 relays and it would work fine, but take more PCB area than a TPIC6595.
  • chaosgkchaosgk Posts: 322
    edited 2009-01-30 20:34
    I am not concerned about PCB area as this system needs to run a large number of relays anyway. I think anything beyond the stamps is over my head for right now. I have only done limited work with circuits and haven't gotten down exaclty how the logic works to build my own boards. I don't need the system to be functional for another 5 months, but if I need to learn this stuff, it is going to take a while and some help from people who actually know what i am trying to do and how to do it.
    I am looking for the cheapest way to make this system and size isn't an issue, only functionality.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-30 20:41
    There's lots of information on Parallax's website. Start with the Nuts and Volts Columns, particularly #6 (found in this index: www.parallax.com/Resources/NutsVoltsColumns/tabid/272/Default.aspx) and "What's a Microcontroller?" found here:www.parallax.com/tabid/535/Default.aspx.

    The StampWorks Manual (here: www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/txtSearch/stampworks/List/1/ProductID/144/Default.aspx?SortField=ProductName%2cProductName) covers the 74HC595 in experiment #23.
  • chaosgkchaosgk Posts: 322
    edited 2009-01-30 20:59
    Thanks Mike, I appreciate the help.
  • chaosgkchaosgk Posts: 322
    edited 2009-01-30 22:18
    Can I buy just the components that make up the stamp boards and the developement boards so I can practice some board etching and design skills? is there a list of parts that come on each of these boards?
  • kwinnkwinn Posts: 8,697
    edited 2009-01-31 08:24
    400 RELAYS! Thats a lot of relays. If the coil currents are reasonable (say around 0.1A or less) then I agree with Mike, the TPIC6595 is a good choice. 50 of them in series would allow you to control all 400 relays with a maximum of 5 input signals, and as few as 2. Depending on the micro you select you could switch all the relays in a reasonably short period (under 10msec). I am not sure if the stamps can do it that fast, but the prop certainly could.

    If you want some more specific help we could use a bit more information about the relays you are using and how they will be operating.

    1 - the voltage rating of the relay coil
    2 - the current draw of the relay coil
    3 - how quickly do you need to turn a relay on or off
    4 - is it possible all (or a large number of) the relays will turn on or off at once
  • UghaUgha Posts: 543
    edited 2009-01-31 13:25
    I for one am quite curious what your project is.... do you mind telling us?

    Who knows, maybe we'll be able to figure out a way to do it without needing all those relays.
  • skylightskylight Posts: 1,915
    edited 2009-01-31 15:10
    Is it an interface to the BSS (400 I/O)?
  • chaosgkchaosgk Posts: 322
    edited 2009-02-01 00:16
    Right now I would prefer not to say what my project is. You guys are smart, you should be able to figure it out after a little while.

    Anyway, the relays are 6vdc with a max amp draw of 50mah. At any given time, there would be at most 5 relays activated and the delay·between the relays would be·long (at least in·msec anyway).For example, when the program starts,·one relay will·fire·10 seconds in, then·another·5 seconds after that.· After the initial two relays·fire, the time between other relays firing will be variable much like programming christmas lights to music, only each set of christmas lights will only turn on once through the whole song and for only one second then turn off. The program itself will need to run for about 20 minutes total.

    ·· Each relay will only stay on for 1 second and then will not be used again during the program.· The reason for the relay in the system is I need to short 24v across a small piece of wire far away from where I am for safety reasons. In the past, I have used simple push button switches in a board I made up for the projects we have done in the past.· The last site I was on kicked me off for even mentioning what I was using the system for and I would prefer to not say what it is.· Everything is perfectly legal and it is a hobby of mine·and almost everyone in the US enjoys watching it once a year. If you figure it out let me know.

    Anyway, I couldn't find the TPIC6595 anywhere on the site?· Could someone give me a small list of what chips I would need and the quantity I would need for this project and where to find them?

    Is there a possibility of a master slave setup somewhere in here so I can have a main control board that has outputs to slave boards 50-100 feet away to make distribution easier and save on the number of cables I need to run from the relays?· If this is more work or a greater expense for the·chips, it·isn't a big deal.· Each slave board would then have·50-80 relays on it. If you have questions you don't want to ask on the board, my email is chaos@bigcitydj.com

    By the way, I am a network engineer by trade so my experience with this is on the other end of the keyboard [noparse]:)[/noparse] I am starting to understand the logic of it though.

    Am I to understand that each chip has 16 outs on it and 8 of those would go to the next chip and 8 would go to the relays if running in series?· Do the TPICs have enough power to trip the relays at 50mah 6vdc or would i need mosfets in line too before the relays?· If it is a better option, I can use 12v relays instead of·6v.

    Thanks guys.

    Derrick



    ·


    Post Edited (chaosgk) : 2/1/2009 12:31:54 AM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-02-01 03:27
    Derrick,
    I have attached the data sheet for the TPIC, and they are available from DigiKey for one. Splitting the outputs into separate groups is no problem, and may make the job easier and less expensive. I think I know what your application is, and it may be possible to do this without all those relays. I will email you in the next half hour or so.
  • Mike2545Mike2545 Posts: 433
    edited 2009-02-01 03:33
    Pyrotechnics.... jumpin.gif

    Post Edited (Mike2545) : 2/1/2009 3:41:01 AM GMT
  • chaosgkchaosgk Posts: 322
    edited 2009-02-01 05:07
    Good guess. [noparse]:)[/noparse]
  • Mike2545Mike2545 Posts: 433
    edited 2009-02-01 05:13
    You could forgo the electronic and get some fuse cord.

    Some of that stuff has different burn rates form lightning fast to delay times.

    I know it wouldn't be as cool but you have to go through the process of wiring it up any way, why not just fuse it?
  • Cole LoganCole Logan Posts: 196
    edited 2009-02-01 07:58
    THough I would think that fuse cord could be more expensive and it would only be good once. Where as if you wired up the relays you could use the system multiple time with only having to replace the ignition wire. That and you could set the exact time for when things happen long before its time to do it for real.
  • UghaUgha Posts: 543
    edited 2009-02-01 13:57
    The fact that each relay is only going to be on a short duration and only a few on at once is good... less amps being pulled.

    The question is how to wire it up... unfortunately I can't think of anything better than what Mike and the others suggested... but I have a strange feeling there should be a better way.

    Does anyone have any suggestions?

    Too bad you can't charlieplex fireworks.
  • LeonLeon Posts: 7,620
    edited 2009-02-01 14:07
    Why are 400 relays required? An array of 400 igniters could be driven in rows and columns by 20 MOSFETs for each row and column, requiring only 40 outputs! They could be controlled by a single MCU, like a PIC, with enough I/Os.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle

    Post Edited (Leon) : 2/1/2009 2:44:30 PM GMT
  • chaosgkchaosgk Posts: 322
    edited 2009-02-01 15:31
    Ok, all kinds of questions this morning. First of all, when we started the fireworks displays about 6 years ago, we were using timed visco cannon fuse to link everything together. This didn't works so well, as we destroyed about $500 worth of fireworks in under a minute for a show that should have lasted about 15 minutes. The next year we covered all of the fuse with foil and tried it again. This was a better result, but still cannot get the timing down.
    Year 3 we switched to electric ignition and things got better for timing, but more complicated to wire up because we were using a simple nail board to fire things. The next year I built a 90 button firing board complete with contenuity lights to all of the fuses. That was the system I used last year as well, however it is nearly impossible to get them to fire with music and keep track of when everything needs to be pushed as there are delays between when the fuse ignites and when the actual display bursts.

    We also went from having 120 or so cue points last year to over 400 this year. Our display last year consisted of 90 3" shells (all hand made) five 4" shells and three 5" shells, along with 28 mines and an assortment of store bought stuff.

    This year we are planning for 400 3" shells, 10 4" shells 10 5" shells and one 6" for the finale. We are also stepping up to around 100 mines and I'm sure we will also have some store bought firecrackers in there and saturn missles just cause we can't make that stuff.,

    So, we are now at the point with that volume of fireing points that we can get them to play with the music and that is where the computers come in.

    To answer your technical questions, I want to use relays because to ignite the electric fuses (ematch) it is a dead short of at least 24v dc across the line. From the control boards to the actual distribution panels where the ematches plug in, it could be 200'-250' away running across cat5 24awg wire pairs. I figured relays would be better suited to this then mosfets because of the risk of a bad line or bad fuse. If the fuse was bad and didn't blow when it was supposed to and had a high current draw, I figured the relay would isolate the sensitive electronics and keep the rest of it functioning. Whereas with a MOSFET, if they get a dead short and a bunch of power is pumped through them couldn't this take out some other parts as well?

    The other thing we are looking at being able to do is use a master slave setup. The master board would have the main processors on it and the slave boards would be connected by cat5 cable. each of the slave boards would have 50-80 relay packs on it with the outputs to the ematches.
    Whatever way is cheaper to build we will go with. Using Leon's idea with MOSFETs, could the Mosfets run the relays so I can use whatever current on the firing side I need.
    Also, unlike programming christmas lights to music (which is basically what I'm doing) once a relay fires, it will not be used again through the entire show. I considered having 8 relays that activate the power on 8 banks of relays. the banks of relays would consist of 1-50 and all of the relays with the same number would come on at the same time, but only the one with the power on the main relay would send the charge down the line to the ematch. This setup would require only 58 channels to address 400 relays, however that means that everytime a fuse activates, a minimum of 9 relays is turning on at the same time.
    Remember guys budget is everything because we blow a lot of money on the fireworks themselves so the cheaper we can do this the better.

    BTW, the reason I didn't come out and say what I was doing is cause the other site I was on said they didn't want their products to be used for something that could be life threatening and when I asked for suggestions of what to use or how to do things, they kicked me off the forum and banned my IP's that I was using.
    You guys are a hell of a lot cooler than them.


    Derrick
  • LeonLeon Posts: 7,620
    edited 2009-02-01 16:00
    You could use my solution with MOSFETs driving the relays. Even if you go for slave controllers, the matrix idea will still save a lot of parts.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • chaosgkchaosgk Posts: 322
    edited 2009-02-01 18:40
    How will the matrix work if more than one relay needs to fire at the same time, could there be a problem with multiples going off that shouldn't fire?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-01 18:50
    Yes, you will get other elements of the matrix turning on if you try to turn on more than one element at a time. On the other hand, you could activate two elements in rapid succession, certainly within a fraction of a second. You could even alternate between two elements. There's an inherent thermal time lag that you could use to your advantage there making it work as if two elements were activated simultaneously even though electrically they were not.
  • kwinnkwinn Posts: 8,697
    edited 2009-02-01 22:49
    chaosgk, as Mike and Leon state above, it is possible to control multiple ignitions with a multiplexed setup.

    The simplest would be to have a master console with 8 or more control lines going to 8 or more slaves. Your idea of using cat5 cables for control is what I was thinking of as well. That leaves the problem of the 24V supply. Do you want one very large supply feeding all the slaves, or should each slave have it's own 24V supply. My suggestion would be to have a power supply in each slave. Run 120V to each slave and provide power for the logic and igniters from that. Yes, it is a bit more expensive, but it prevents a single failure from stopping the show, and saves on the cabling.

    Each slave module would control up to 64 relays/igniters in an 8x8 array, and could fire up to 8 simultaneously provided they were all in the same row or column, and that the power supply could handle the current. The reason for going with 64 is cost. The chips come with 8 drivers, so 2 chips could control 16 relays and fire 64 igniters.

    It may also be possible to do this without relays. An optoisolator and mosfet may be less expensive than an equivalent relay and provides even more protection for the logic circuits.

    Attached is a simplified block diagram of a slave unit.
  • chaosgkchaosgk Posts: 322
    edited 2009-02-01 23:46
    I've thought about using a matrix, but after seeing it, i'm confused on how they will activate. My understanding from the diagram is when relay A (vertical) turns on, All 8 lines coming out of it will have +24 across their fuses. then when relay 1 (horizontal) turns on, it completes the circuit by providing the negative.
    So each vertical relay would provide Positive to 8 seperate fuses and each horizontal relay would provide negative to 8 fuses and by turning on combinations of relays each fuse would be adressable. Now I'm guessing that each of the relays on the slave boards will be adressable so in the program I can say to turn on relay 1 and a on slave 1 and have the first fuse fire.

    The only problem I see with this is if by some strange fluke when we fire the Ematches, the pair gets shorted, which can happen, the ignition wires are exposed to some very violent forces when they fire because they are exposed to the explosive forces of the shells being fired out the tubes. Also with the matrix system, 8 relays will be activated off one control line from the chip right. How much power can those chips put out on a channel? Those relays are rated at 50mah when on. will 400mah be too much current?

    For the 24v, I was now thinking of having the master control box provide the power to the slave board relays for the firing circuits.· How many volts do the chips need to run 6-9? I saw the tpic6595 chip on digikey for $2/ea for quantity of 25,· can I build this board·system with only 25 of these chips, or do I need to step up the order to 100 and get them for $1.50 each?
    Anyone know anywhere else that would have the chips cheaper if I need to use more than 25?


    Post Edited (chaosgk) : 2/2/2009 12:50:46 AM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-02-02 05:10
    chaosgk,
    To answer your second question first, lets number the rows R1 to R8 from top to bottom and the columns C1 to C8 from left to right. lets assume the fuse on R1-C1 shorts. That would result in any fuse in R1 being unable to fire, and any fuse in C1 also firing when the row it is connected to is activated. The short could also damage the power supply. It would be even worse if the relay contacts were to weld themselves together since that would disable the entire slave module. The choices are:

    Putting a relay at every cross point (64 relays) would avoid that unless the relay contacts weld shut.
    Put a current fuse on both the ground and +24V side of each output (128 fuses per slave).
    There is no simple solution that would work for every case, so you have to choose a solution that you feel fits the cost vs benefit based on how likely a problem is to happen.

    For the addressing of what fuse to fire I am going to assume that we will be able to fire only one row at a time, but up to all eight columns at once.

    The TPIC's are shift registers so the 16 bits that determine what one row and what columns are to be fired. If we wanted to fire columns 3 and 7 in row 2 for instance the data we would shift out would be 01000000 00100010 (where the 1 activates a relay) and the 0 on the right would be the bit for right most column. This would require 16 clock pulses and after that a signal would put the data out to activate the relays and fire the fuse. As to the current I beleive you said the relay coils draw 50mA each so 400mA total if every column is to be activated. That will require a transistor on each row (8 total per slave).

    To build 8 slaves ( can handle 512 fuses ) you need 16 TPIC's so 25 is more than enough. Doesn't hurt to have a few spares though.

    For the +24V you will need a power supply that can handle the firing current for as many fuses as you want to fire at one time. Putting a large capacitor in each slave might reduce the size of the supply needed.

    The TPIC's require +5V, and I think you said your relay coils were 6V so I would suggest about 9-12V unregulated out from the master and regulators on each slave to avoid problems due to long wire runs.
  • kwinnkwinn Posts: 8,697
    edited 2009-02-02 05:24
    I have some questions that need to be answered to proceed further.

    Can you test fire some fuses and determine how much current that draws? Perhaps put some fuses in line (one at a time) to see how large a fuse is needed. Start with a small fuse (say 2A ) and increase it to 5, 10, 15, etc. until it does not blow.

    What was the current rating of the power supply you used last time?

    Do you need to have more than one slave powered up at a time.

    What is the current and voltage rating of the relay coil that you are using (or planning to use) now.

    What is the current and voltage rating of the relay contacts that you are using (or planning to use) now.
  • chaosgkchaosgk Posts: 322
    edited 2009-02-02 06:08
    Ok, I'll answer what I can.
    When you refer to fuse, are you talking about my electric matches that actually ignite?· If so, these are very low amp draw.· They are 40 awg nichrome wires at about 1/4" length.· I will do some testing tomorrow on some that I have made up and see what it takes to blow them.· I would guess probably 500mah at the most, it takes very little power to fry them by design.· The nichrome chips (fuses) are coated with a pyrogen that catches fire from the burning wire and in turn sets off whatever it is connected to destroying itself in the process. Are you saying run a single fuse, check the amp draw, then hook up several in parallel and check again?·
    We have switched fuses from previous years. We were using modified christmas lights (yeah, sounds wierd, but they worked extremely well and were cheap).· In the past we were simply running a 12v 5amp sealed battery for the power supply going to the fuses (christmas lights) Because of problems with connections to the lights we are doing a complete redesign and I have tested the new fuse design and they work better then the lights but a little more work involved too.
    We are planning on staying with the battery for a power supply but run a couple in series for the 24vdc I am looking for.
    See the attached jpeg for how things get laid out, this setup covers about·4 acres of·land and for the visual effects we want, multiple mines and morters will need to be able to fire from different·slaves at the same time.· If we are going through all of the work of building this, I at least want·the option of being able to active at least 2 slaves at the same time.·

    The·voltage rating of the relays is 6vdc at·50mah.
    The contact rating is 24vdc at 1 amp.

    If I need to, I can step up to 12v relays with a·5amp contact rating but I wanted to keep the load on the·coil side of the relay to a minimum to keep from blowing one of the IC's.

    We also need to factor in that we are trying to push this 24v over·100' of 24awg cable so there is some loss there before it even hits the fuse.··Distance wasn't a problem with anything last year. We had a set of 7 large shells that were over·600' away from the firing board and they ran fine.· We have tested·the·12v system to over 1000' and had instant ignition every time.·Some of the larger shells we shoot do require these lengths for safety of the spectators.·
    1099 x 733 - 74K
  • kwinnkwinn Posts: 8,697
    edited 2009-02-02 08:13
    From now on I will call your 40AWG nichrome wires igniters, and "fuse" will refer to the device that blows to protect a circuit from too much current.

    What I meant was to put one igniter and one fuse in series and apply 24 volts to see if the fuse blows when the wire ignites. Start with a high amperage fuse, say 10 amps and if it does not blow put in a smaller one and try again. Repeat until the fuse blows or you get to a 1/2 amp fuse. What I need to know is the size of the smallest fuse that did not blow.

    If as you say it only takes about 1/2 amp to set off an igniter then worst case we need to supply 4 amps to each slave if it is to set off 8 igniters at once. That also means that we may be able to do it without using relays.

    Do you have a microcontroller that you intend to use for the master console, and are you set up to build a small circuit to try out?
  • chaosgkchaosgk Posts: 322
    edited 2009-02-02 14:30
    I don't have any micro controllers yet, I'm waiting to see what everyone here comes up with before I order anything. I will try the fuse setup tonight and see what it takes to blow the igniters. I'm guessing I should connect the igniters to a few hundered feed of cable to test for a real world load on the fuse?
  • LeonLeon Posts: 7,620
    edited 2009-02-02 14:37
    You might have too much resistance in the cable if it's a few hundred feet long.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • chaosgkchaosgk Posts: 322
    edited 2009-02-02 15:50
    Ok, to make a simple board to start testing with, what parts do I need to order? several Tpic chips, what else? I work for a computer·service company so I have access to all kinds of scrap parts for serial ports and that type of stuff and I already have plenty of blank pcb's. Can one of you give me a list of what it will take to get a basic board going for testing?

    I also just found a guy that I can get 500 of the relays i'm planning on using for $100 so if anyone can tell me if the relays are a good choice to go with over MOSFETS, let me know right away so I can order them.

    Just out of curiosity, could I use Mosfets in place of the relays on the matrix and in turn have the matrix activate the relays?·There is a far less chance of the relays causing a short on the circuit then the ignition wires. Could 8 MOSFETs provide the +6v to the relays and the other 8 MOSFETS provide the ground for the relays?

    This should take care of some of the issues,· Doing this the Mosfets would only have a current draw of one of the relays at a time instead of the circuit having to push 8 relays at a time the other way.


    Post Edited (chaosgk) : 2/2/2009 5:29:48 PM GMT
  • Mike2545Mike2545 Posts: 433
    edited 2009-02-03 01:07
    Sorry, when I said fuse cord that must have confused some people. Fuse cord is the stuff that gets lit and burns at different rates.
Sign In or Register to comment.