Keeping multiple relays controlled by a demux

Discussion in 'Electronics & Electrics' started by imgod22222, May 23, 2011.

  1. imgod22222

    imgod22222 Member

    Joined:
    Jan 4, 2006
    Messages:
    729
    Location:
    Florida, America
    So I'm thinking about building a small project where I'll be using an arduino to control several 12V relays.

    the loads will either be on or off (switching is undesired)

    So, I know that if I need to run two loads simultaneously on this mux, on the arduino I would be switching back and forth between selecting the two relays, which would switch the load, which is bad.

    To avoid this, would putting a cap at the base of the transistor (switch transistor with demux to switch the relay to switch the larger load) be sufficient to keep the n relays all on if need be? Or is there a toggle-type transistor that I'd be better off using.

    if I didn't describe it well enough, this is the plan:

    Arduino lines > Select lines on demux > output line on demux > [cap] > base of transistor > relay across emitter and ground of transistor > load on relay
     
  2. P.YO

    P.YO Member

    Joined:
    Feb 2, 2004
    Messages:
    443
    Location:
    Brisbane - Southside
    Have you looked at latching demultiplexer?
     
  3. Gecko

    Gecko Member

    Joined:
    Jul 3, 2004
    Messages:
    2,715
    Location:
    Sydney
  4. OP
    OP
    imgod22222

    imgod22222 Member

    Joined:
    Jan 4, 2006
    Messages:
    729
    Location:
    Florida, America
    didn't know they existed... was looking at latching relays (which are way expensive)

    The only ones I found were BCD>7seg latching demuxes... that means I wouldn't be able to have every combination of on/off... I wouldn't even be able to turn one thing on at a time. So that's unfortunately out of the question.

    Additionally, adding a latch to each output of the mux would need too many control lines.

    What I've thought out
    http://imageshack.us/photo/my-images/600/24408820767963221331311.jpg/
    The question mark denotes where a possible "memory" element may go. I thought putting a decently sized cap there would essentially "dram-it" which would keep getting refreshed as long as I want the relay's load on, then would eventually decay to "off" when I stop signaling it.

    Thoughts?
     
  5. Gecko

    Gecko Member

    Joined:
    Jul 3, 2004
    Messages:
    2,715
    Location:
    Sydney
    Read the datasheet for the link I posted above... you only need one signal to latch all of them.
     
  6. teno45

    teno45 Member

    Joined:
    Dec 27, 2009
    Messages:
    219
    Location:
    Wagga Wagga
    what if you used something along the lines of a CD4051 (8:1 mux/demux) with some sort of latching flip flop (havnt got time atm to find one...).

    Idea being that you have one "control" line, and only a couple "addressing" lines.

    ie: to control 2outputs, 2 lines, to control 4outputs,3lines, to control 8outputs, 4lines...

    this will give you direct access to control individual lines whenever needed.

    there may be a better way of doing it, but thats using bits that i know and have used before.
     
  7. paulvk

    paulvk Member

    Joined:
    Mar 10, 2010
    Messages:
    1,066
    How far has the signal to go to the relays? I have already built and programmed some AVRs to turn things on and off via RS232 and extended their ports via serial to parallel shift chips (74HC595) I may be able to save you a lot of work!
     
  8. aXis

    aXis Member

    Joined:
    Jun 27, 2001
    Messages:
    5,548
    Location:
    Kalgoorlie, WA
    Serial to Parallel (even at TTL level) shift sounds like a much better solution.
     
  9. teno45

    teno45 Member

    Joined:
    Dec 27, 2009
    Messages:
    219
    Location:
    Wagga Wagga
    unless I'm misunderstanding the OP, I think he requires direct, (virtually) instant control of each relay. My understanding of a shift register means that this direct access is not possible. With a shift register, you can only directly access the first stage of the register, and when you change the first stage, each other stage changes to the state of the stage previous.

    Whilst doing a little bit of research, I came across an Addressable Latch. never heard of it before. Basically a demux and multibit latch in one. something such as the CD4099. beats my idea of joining the mux such as a cd4051 and an 8bit latch like a HCT573.
     
  10. paulvk

    paulvk Member

    Joined:
    Mar 10, 2010
    Messages:
    1,066
    No it has an output latch you load the register then send it to the latch even with an 8mhz clock on the micro its so fast the relays are slow compared to the speed the micro can load the latch.
    As I said I have already built and programmed this, it works both ways for input and output! Its fly by wire type of idea you turn the information into a data stream then send it to the device which then turns it back into the original single bits of information.
     
    Last edited: May 23, 2011
  11. Gecko

    Gecko Member

    Joined:
    Jul 3, 2004
    Messages:
    2,715
    Location:
    Sydney
    This is correct - I've seen a (very long!) chain of the latching shift registers set up to control ~1000 relays - and it only took a fraction of a second to update the status of EACH AND EVERY relay. The limiting factor was the micro used as the controller :)
     
  12. teno45

    teno45 Member

    Joined:
    Dec 27, 2009
    Messages:
    219
    Location:
    Wagga Wagga
    My applogise then, having only a theoretical knowledge of shift registers, was under the impression the outputs would change imediately, therefore toggling the loads/relays.

    If this is the case then it does sound more appropriate, one set of wires to control almost infinite relays.
     
  13. OP
    OP
    imgod22222

    imgod22222 Member

    Joined:
    Jan 4, 2006
    Messages:
    729
    Location:
    Florida, America
    Sorry I was absent from the thread for so long.
    looked into it--latching shift registers... that's exactly what I needed. Didn't know they existed until now.
    The latching demux I saw earlier had one line that controlled hold/store of all the outputs (which doesn't make sense) and the latching shift register does exactly what I want it to--with a minimum of data lines going out. Brilliant success, everyone.

    We're in the same boat. Agree--never heard of it before, and beats my idea by leagues and bounds.
     
  14. dakiller

    dakiller (Oscillating & Impeding)

    Joined:
    Jun 27, 2001
    Messages:
    8,224
    Location:
    3844
    A really good latching serial shift register to use is the TPIC6C595, it's exactly the same as a 74xx595 but it has open drain outputs that can sink some decent current, so you can drive your relays directly from the chip without any external transistors

    http://focus.ti.com/docs/prod/folders/print/tpic6c595.html
     
  15. klightspeed

    klightspeed Member

    Joined:
    Mar 14, 2003
    Messages:
    698
    Location:
    Brownsville, NQ
    Don't forget the snubber diodes. edit: the TPIC6C595 has built-in voltage clamps specifically for this.

    If you want to control more than 8 relays, you can connect 2 or more of these in series (wiring serout of #1 to serin of #2, and connecting the other control lines in parallel).

    You could use the microcontroller's SPI interface, configured for CPOL=0 and CPHA=0, to shift data out to the shift register:
    - MOSI -> SERIN
    - (NC or MISO) -> SEROUT
    - SCK -> SRCK
    - /SS -> RCK
    - (GND or /ENABLE) -> /G
    - (VCC or /RESET) -> /CLR
     
    Last edited: May 28, 2011
  16. Odje

    Odje Member

    Joined:
    Jun 27, 2001
    Messages:
    2,297
    Location:
    Sydney
    Nice find. Why do they hide it under temperature sensors?
     
  17. klightspeed

    klightspeed Member

    Joined:
    Mar 14, 2003
    Messages:
    698
    Location:
    Brownsville, NQ
    I guess it's under "Temperature Sensors & Control ICs" because its primary purpose is to control stuff like relays.
     
  18. Odje

    Odje Member

    Joined:
    Jun 27, 2001
    Messages:
    2,297
    Location:
    Sydney
    I suppose but to me it sounds like a temperature control IC, not generic control ICs
     

Share This Page

Advertisement: