Previous in Forum: Control Circuit for Star Delta Connection   Next in Forum: Cable Selection
Close
Close
Close
9 comments
Rate Comments: Nested
Associate

Join Date: Jul 2008
Posts: 54
Good Answers: 2

Multiple Relay Control with Microcontroller

06/29/2009 11:42 PM

I have the ambition to control up to 20 switched contacts with a RISC chip in a somewhat affordable way. The circuit needs to be able to activate any selection of the twenty at once (1,7,13 or 2,9,11,12,15 for example).

The simplest design I have so far involves:

RISC Out (9 logic outs and 1 clear) -> 3 Latches (3in-8out-1clear) -> 3 Driver arrays (ULN2003 or similar) -> 20 (to 24) Telcom Relays.

I was curious if there is a simpler way that could reduce the number of output pins required from the RISC chip. I could use a larger chip with more ports, but I would prefer to keep other ports open for future development. Or maybe has a much better idea for what I am trying to do.

I think I could link the latches together in an array to only use four pins, but haven't thought it out yet.

Register to Reply
Pathfinder Tags: microcontroller relay
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
Popular Science - Biology - New Member Hobbies - Musician - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - CNC - New Member Fans of Old Computers - ZX-81 - New Member

Join Date: Jan 2007
Location: Centurion, South Africa
Posts: 3921
Good Answers: 97
#1

Re: Multiple Relay Control with Microcontroller

06/30/2009 3:04 AM

Use at least 3 banks of TTL latches on a 8 bit bus with chip select wired to other ports.

You can multiplex the outputs. In this way you can control 64 switches in any combination with a 8 line (+3) Centronix printer port.

__________________
Never do today what you can put of until tomorrow - Student motto
Register to Reply Score 1 for Good Answer
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#2

Re: Multiple Relay Control with Microcontroller

06/30/2009 8:55 AM

As Hendrik says..you can latch data out.
It's always a trade off...big chip with plenty of I/O gives simplicity, or smaller cheaper chip with more stuff hanging on it to control the IO and thus more complex software & circuitry. Alternative is a 2 chip solution, one handling the user interface and one handling the IO... of course you then have the comms probs of getting the two talking to eachother.
I've designed all 3 option in my time.
Big chip with few peripherals, keeping it simple is my personal preference.
Del
(BTW... GA Hendrik, hows that ol' Lion of yours doing?)

__________________
health warning: These posts may contain traces of nut.
Register to Reply Score 1 for Good Answer
Guru
Hobbies - Musician - Tube Amps Only Please!

Join Date: Apr 2009
Location: Los Angeles, California USA
Posts: 553
Good Answers: 1
#9
In reply to #2

Re: Multiple Relay Control with Microcontroller

07/01/2009 4:42 PM

I agree with this approach. I used to design ASICs and had to keep the transistor count as low as possible to fit on a hybrid.

__________________
Regards, Maveric Manic - 'Knowledge is Power and Wisdom is knowing how to use it'
Register to Reply
Guru

Join Date: Dec 2005
Location: Etats Unis
Posts: 1871
Good Answers: 45
#3

Re: Multiple Relay Control with Microcontroller

06/30/2009 10:40 PM

The ULN series has serial input drivers. You can stream out the parallel data then latch the output of multiple chips simultaneously.

__________________
The hardest thing to overcome, is not knowing that you don't know.
Register to Reply
Associate

Join Date: Jul 2008
Posts: 54
Good Answers: 2
#4
In reply to #3

Re: Multiple Relay Control with Microcontroller

06/30/2009 10:53 PM

I think I will go serial all the way. Parallel data is slightly outdated and involves too much soldering. I will probably build my first design sweet and simple as Del stated. Then if I need more features I will multiplex the latches or find a serial or DAC chip as Hendrik stated. You always hope for that miracle IC you never knew about that does exactly what you want.

Thanks for the input guys.

Register to Reply
Guru
Hobbies - Musician - Tube Amps Only Please!

Join Date: Apr 2009
Location: Los Angeles, California USA
Posts: 553
Good Answers: 1
#5

Re: Multiple Relay Control with Microcontroller

07/01/2009 7:05 AM

Just use a 4 to 16 Decoder chip so you output a Hex (0000-1111) code to the 4 inputs of the 4 to 16 Decoder chip. The 16 output could drive a latch and be used to drive a relay on/off. Be careful to de-glitch your relay latches with a output strobe delayed slightly after outputing the 4-bit code since only one of the 16 lines can be on at a time. Therefore the latches are needed. Say if you want a certain sequence of relays on in S/W you address each relay one at a time through software, pulse the latch strobe after the Decoder is at a steady hold decoded state. The same for turning a relay off. There is very little latency between addressing the relays in this manner as opposed to 16 dedicated RISC lines driving directly.

This sounds like a lot more external circuity as a hardware method or just use more I/O. There is also serial to parallel registers. I would use RISC's that had lots of I/O lines and drive the relays directly.

__________________
Regards, Maveric Manic - 'Knowledge is Power and Wisdom is knowing how to use it'
Register to Reply
Guru
Popular Science - Weaponology - New Member United Kingdom - Member - New Member

Join Date: May 2007
Location: Harlow England
Posts: 16512
Good Answers: 670
#6
In reply to #5

Re: Multiple Relay Control with Microcontroller

07/01/2009 7:20 AM

Just use a 4 to 16 Decoder chip.

That's OK, but of course it means you are only driving relays one at a time.
Del
BTW...relays, ok for mains, but for DC switching FETs are good these days.

__________________
health warning: These posts may contain traces of nut.
Register to Reply
Guru
Hobbies - Musician - Tube Amps Only Please!

Join Date: Apr 2009
Location: Los Angeles, California USA
Posts: 553
Good Answers: 1
#8
In reply to #6

Re: Multiple Relay Control with Microcontroller

07/01/2009 4:36 PM

Yes but if you read carefully I said you must latch the 1 of 16 outputs so now you can have multiple outputs driving the relays. A 4-16 Decoder is not buy itself a latch. If you address another line that output is inactive unless latched by another chip to do this. But I think it is to much hardware and a microcontroller is supposed to reduce the amount of hardware and is designed to do that.

__________________
Regards, Maveric Manic - 'Knowledge is Power and Wisdom is knowing how to use it'
Register to Reply
Power-User

Join Date: Jan 2007
Location: Berlin (Germany)
Posts: 332
Good Answers: 1
#7

Re: Multiple Relay Control with Microcontroller

07/01/2009 10:18 AM

Have a look at TLK9201 from TI, it`s an SPI-controled 8-channel latch with brownout detect, others are available from Maxim with I2C-control.

__________________
The sum of intelligence on earth is a constant. And the population grows and grows and .....
Register to Reply
Register to Reply 9 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Hendrik (1); maveric_manic (3); plancette (1); rcapper (1); user-deleted-1105 (2); uweka (1)

Previous in Forum: Control Circuit for Star Delta Connection   Next in Forum: Cable Selection

Advertisement