Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Multiple relay with controllers

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
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..?
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,184
Helped
4,685
Reputation
9,385
Reaction score
4,439
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
121,138
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.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,453
Helped
3,941
Reputation
7,880
Reaction score
3,812
Trophy points
113
Activity points
115,718
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
 

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
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..
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,184
Helped
4,685
Reputation
9,385
Reaction score
4,439
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
121,138
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.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,453
Helped
3,941
Reputation
7,880
Reaction score
3,812
Trophy points
113
Activity points
115,718
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
 

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
image_001.jpg

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

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,184
Helped
4,685
Reputation
9,385
Reaction score
4,439
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
121,138
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.
 

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
image_002.jpg

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

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,453
Helped
3,941
Reputation
7,880
Reaction score
3,812
Trophy points
113
Activity points
115,718
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
 

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
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.
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,184
Helped
4,685
Reputation
9,385
Reaction score
4,439
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
121,138
... but yes, it is now correct.
You don't need the resistor on the latch signal if the MCU is actively driving it.

Brian.
 

std_match

Advanced Member level 4
Joined
Jul 9, 2010
Messages
1,083
Helped
409
Reputation
818
Reaction score
404
Trophy points
1,363
Location
Sweden
Activity points
8,276

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
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:

std_match

Advanced Member level 4
Joined
Jul 9, 2010
Messages
1,083
Helped
409
Reputation
818
Reaction score
404
Trophy points
1,363
Location
Sweden
Activity points
8,276
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.
 

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
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..?
 

std_match

Advanced Member level 4
Joined
Jul 9, 2010
Messages
1,083
Helped
409
Reputation
818
Reaction score
404
Trophy points
1,363
Location
Sweden
Activity points
8,276
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.
 

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
Image_0054.jpg

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..?
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,453
Helped
3,941
Reputation
7,880
Reaction score
3,812
Trophy points
113
Activity points
115,718
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
 

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
334
Helped
1
Reputation
2
Reaction score
1
Trophy points
18
Activity points
2,848
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..?
 

Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top