+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 27
  1. #1
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Multiple relay with controllers

    In my project,there are 8 relays use.To reduce the usage of I/O pins from PIC controller.I tried to use multiplexer and shift registers.
    If the multiplexer is used means I can't switch ON pair of relay at same time.
    If the shift register is used means,while shifting the data all the relays are switching on.

    How to switch ON pair of relay either by multiplexer or by using shift register(Without switching on other relays while shifting)
    Or is their any other way to solve this issue..?

  2. #2
    Super Moderator
    Points: 80,579, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,205
    Helped
    4410 / 4410
    Points
    80,579
    Level
    69

    Re: Multiple relay with controllers

    You need a latched shift register - one that has independent shift function and latch function. They let you set the bit pattern (any number or combination of bits) then when it has been shifted out of the PIC, presents it to the relay in one operation.

    Look for latched shift registers for examples.

    Your code would shift the required pattern into the shift register then use another control signal to momentarily operate the latch so the pattern appears on the output pins.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  3. #3
    Super Moderator
    Points: 76,299, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,474
    Helped
    3519 / 3519
    Points
    76,299
    Level
    67

    Re: Multiple relay with controllers

    Hi,

    If the shift register is used means,while shifting the data all the relays are switching on.
    Where is this information from?
    What shift register are you talking about?

    One of the cheapest shift registers is a 74HC595 ... it has built in latches to avoid false relay switching
    Then there are SPI port expanders and I2C port expanders, and there are (octal) relay drivers with serial interface.
    Everything you wish to have is available.
    Just go to a distributor's (or semiconductor manufacturer) internet site and use their online selection guides.
    Read datasheets .... and find the best solution for you.

    You also could do an internet search for "8 relay serial interface schematic" to get some ideas how others did it before.
    Be thankful to have internet, we did not have it ... 30 years ago. So use it.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  4. #4
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    Quote Originally Posted by KlausST View Post
    Hi,
    If the shift register is used means,while shifting the data all the relays are switching on.
    Klaus
    I built an circuit by using 74HC164N shift register.While testing the board,got the result like this..



  5. #5
    Super Moderator
    Points: 80,579, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,205
    Helped
    4410 / 4410
    Points
    80,579
    Level
    69

    Re: Multiple relay with controllers

    The 74HC164 is not latched, that is why you found all the relays operated.

    A latched shift register lets you shift the bits to the desired places, THEN transfer them all and hold them at the output pins simultaneously.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  6. #6
    Super Moderator
    Points: 76,299, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,474
    Helped
    3519 / 3519
    Points
    76,299
    Level
    67

    Re: Multiple relay with controllers

    Hi,

    check this:
    * NXP 33879
    * 6B595
    * NCV7240
    * NPIC6C595
    * TPL9201
    * BL310
    ...

    But even a HC164 solution should work with fast enough data transfer .. without false relay switching.
    Data transfer can be in the MHz range..but usual relays need several milliseconds to switch.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  7. #7
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    Click image for larger version. 

Name:	image_001.jpg 
Views:	9 
Size:	48.1 KB 
ID:	153566

    Is this circuit is correct..?
    Shall we leave the 12th pin idle..?



  8. #8
    Super Moderator
    Points: 80,579, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,205
    Helped
    4410 / 4410
    Points
    80,579
    Level
    69

    Re: Multiple relay with controllers

    NEVER leave pins idle, they could adopt any state and change randomly.

    However your schematic isn't quite right, the ~OE pin enables or disables the output pins, you want them enabled all the time so connect ~OE to 0V.
    The latch signal goes to pin 12. Whatever is in the shift register is transferred to the output pins on the rising edge of the pulse on pin 12 so keep it low until the shifting is finished then drive it high then low again. As it goes high, the signals you want will appear on the output pins and they will stay there until the next time you drive pin 12 high again.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisement

        
       

  9. #9
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    Click image for larger version. 

Name:	image_002.jpg 
Views:	12 
Size:	72.7 KB 
ID:	153567

    Now it is correct..?
    Does series resistor is required between the PIC and shift register pins..?



    •   AltAdvertisement

        
       

  10. #10
    Super Moderator
    Points: 76,299, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,474
    Helped
    3519 / 3519
    Points
    76,299
    Level
    67

    Re: Multiple relay with controllers

    Hi,

    may I ask why you .. donīt look for internet circuits.
    ... and even donīt look into the datasheet. Ok - I agree - this might be boring - but all professionals need to do this, too.

    Everything is available. No need to re-invent the wheel.
    Even complete projects with code....

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    Quote Originally Posted by KlausST View Post
    Hi,

    may I ask why you .. donīt look for internet circuits.
    ... and even donīt look into the datasheet. Ok - I agree - this might be boring - but all professionals need to do this, too.

    Everything is available. No need to re-invent the wheel.
    Even complete projects with code....

    Klaus
    I'm looking on Internets and searching for my doubts.Lot of results are available in internet..
    From that results I'm building on my own at first,in that i'm making some mistakes and i'm trying to solve the issue by seeking help from experts...I'm willing to learn even an single technical points regarding my work.Solution for some errors are not available in google search.So i'm asking here.



  12. #12
    Super Moderator
    Points: 80,579, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,205
    Helped
    4410 / 4410
    Points
    80,579
    Level
    69

    Re: Multiple relay with controllers

    ... but yes, it is now correct.
    You don't need the resistor on the latch signal if the MCU is actively driving it.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  13. #13
    Advanced Member level 3
    Points: 7,199, Level: 20
    Achievements:
    7 years registered

    Join Date
    Jul 2010
    Location
    Sweden
    Posts
    952
    Helped
    369 / 369
    Points
    7,199
    Level
    20

    Re: Multiple relay with controllers

    74HC4094 is an alternative to the 74HC595.
    The differences are discussed here:
    https://electronics.stackexchange.co...something-else

    The most important difference if used as in post #9 is that the output "memory" in 74HC4094 is a transparent latch. In 74HC595 it is a clocked register.



  14. #14
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    In multiplexer ICs both VEE and GND pin are connected to GND supply...
    In this case what is the difference between VEE and GND pins...?
    Last edited by venkates2218; 3rd July 2019 at 07:46.



  15. #15
    Advanced Member level 3
    Points: 7,199, Level: 20
    Achievements:
    7 years registered

    Join Date
    Jul 2010
    Location
    Sweden
    Posts
    952
    Helped
    369 / 369
    Points
    7,199
    Level
    20

    Re: Multiple relay with controllers

    Quote Originally Posted by venkates2218 View Post
    In multiplexer ICs both VEE and GND pin are connected to GND supply...
    In this case what is the difference between VEE and GND pins...?
    VEE is the negative limit for the switches and it can be connected to a negative voltage if signals going below GND are switched.



  16. #16
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    If VEE is connected with GND means we can switch negative voltages(-1,-2,-3...,) also..?
    If VEE is connected with +5V means only positive signals are switched..?



  17. #17
    Advanced Member level 3
    Points: 7,199, Level: 20
    Achievements:
    7 years registered

    Join Date
    Jul 2010
    Location
    Sweden
    Posts
    952
    Helped
    369 / 369
    Points
    7,199
    Level
    20

    Re: Multiple relay with controllers

    Quote Originally Posted by venkates2218 View Post
    If VEE is connected with GND means we can switch negative voltages(-1,-2,-3...,) also..?
    If VEE is connected with +5V means only positive signals are switched..?
    Please read the data sheet. The signals to be switched must be between VCC and VEE. VEE can be lower than GND.



  18. #18
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    Click image for larger version. 

Name:	Image_0054.jpg 
Views:	7 
Size:	78.8 KB 
ID:	154524

    I tried the above circuit.The output from 74HC595 is always in on condition.So removed R4,R9,R13 and tried.But facing the same issue..
    How to solve this..?



  19. #19
    Super Moderator
    Points: 76,299, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,474
    Helped
    3519 / 3519
    Points
    76,299
    Level
    67

    Re: Multiple relay with controllers

    Hi,

    A standard procedure for debugging circuits:

    * Measure the HIGH and LOW voltage levels at the HC595 inputs...
    * cross check with datasheet whether they comply with the specifications.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  20. #20
    Full Member level 5
    Points: 1,963, Level: 10

    Join Date
    Sep 2016
    Posts
    313
    Helped
    1 / 1
    Points
    1,963
    Level
    10

    Re: Multiple relay with controllers

    Quote Originally Posted by KlausST View Post
    Hi,

    A standard procedure for debugging circuits:

    * Measure the HIGH and LOW voltage levels at the HC595 inputs...
    * cross check with datasheet whether they comply with the specifications.

    Klaus
    Ok I will once again check it.Is this circuit is correct..?



--[[ ]]--