Go Down

Topic: Multiple relays using DIP switches (Read 3501 times) previous topic - next topic

adrumsolo4u

I have a plan which requires me to chain in parallel multiple relays. I need to have a method of addressing a specific relay. My plan is to use DIP switches and resistors to assign each relay an address.

I'm very new to arduino, but I have a good ammount of knowledge in  electronics.

Originally i thought to use PWM to address the relays but I realized that a simpler solution might be to use DIPs and resistors to much more simply assign each relays its' own address.

Does anyone have any experience in this or have any ideas of a better direction to go?

larryd

No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Grumpy_Mike

Using PWM to address a relay just does not make any sense at all. It is something that can't be done, like addressing a letter by using a pie.

Just like the word chaining and parallel mean opposite things.

So your words at the moment do not make any sense, so if you want help you will have to say what you want in a better way.

Paul__B

It makes vaguely more sense (but not much) if you read his other post.

adrumsolo4u

Using PWM to address a relay just does not make any sense at all. It is something that can't be done, like addressing a letter by using a pie.

Just like the word chaining and parallel mean opposite things.

So your words at the moment do not make any sense, so if you want help you will have to say what you want in a better way.
originally i planned to have each relay with its' own arduino unit to receive the pwm signal from the master arduino. however i realized that there might be a much simpler and less expensive method to control relays along a bus, similar to a 1553 data bus.

each relay will have it's own transformer and rectifier for 5v power.

i want to control as many as 512 relays in this way, all from the same bus.

I'm new to the arduino, so sorry if my description is not helpful.

has anyone done this that has any advice?

alternativly could i use a shift register at each relay for the same effect?

Grumpy_Mike

Quote
could i use a shift register at each relay for the same effect?
You can use one shift register to control 8 relays. If you use the TPIC6B595 then you can attach your relays directly, otherwise you will have to use transistors on the shift register output to drive the relay.

Quote
to receive the pwm signal from the master arduino
PWM is not a communication system.
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Quote
i want to control as many as 512 relays in this way, all from the same bus.
You can do that if you construct it correctly. How far apart are these relays going to be?

adrumsolo4u

PWM is not a communication system

You can do that if you construct it correctly. How far apart are these relays going to be?
i was going to create my own data bus system using pwm. the first 10 bits of data would have been addressing and the next 6 bits would have been the data passed to said address. maybe I'm not explaining my system to you in a way you are used to.

there need only be one relay for each location and each relay could be anywhere from two feet to 200 feet apart. although for the most part it will stay around 30 ft.

Grumpy_Mike

i was going to create my own data bus system using pwm. the first 10 bits of data would have been addressing and the next 6 bits would have been the data passed to said address. maybe I'm not explaining my system to you in a way you are used to.
What you describe is not in any way PWM. It sounds like a synchronous data protocol.

adrumsolo4u

What you describe is not in any way PWM. It sounds like a synchronous data protocol.
sounds good to me. I just came up with the idea of how it should work, wasn't sure what exactly to call it, so I chose PWM because it seemed close to it.

Back to the original topic;

How many shift registers can I connect in a string? When i look at this http://arduino.cc/en/tutorial/ShiftOut  I see that if I attach two shift registers together and send 16 bits of data the first 8 will be received by the second register. Does it work in a similar way if I have my 512 (possible) shift registers?

larryd

Does it work in a similar way if I have my 512 (possible) shift registers?
Yes
How many shift registers can I connect in a string?
What power supply are you using?

Keep in mind you may have memory limitations.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Grumpy_Mike

For 512 relays you will 'only' need 64 shift registers.
Scaling up brings a few difficulties like only being able to connect one output to 20 inputs, but the correct of buffers ( 74LS04 ) and good supply decoupling will see it work.
However, that sort of distance is going to be a trouble to you, you will have to design the buffering correctly, it is not something that you just throw together.

adrumsolo4u

For 512 relays you will 'only' need 64 shift registers.
Each relay will have it's own shift register as no two relays will be in the same location. For now this setup is a concept I am working on. 512 is a conceptual max I would need.

Scaling up brings a few difficulties like only being able to connect one output to 20 inputs, but the correct of buffers ( 74LS04 ) and good supply decoupling will see it work.
However, that sort of distance is going to be a trouble to you, you will have to design the buffering correctly, it is not something that you just throw together.
I plan to have each relay on a PCB with it's own regulated 6v power supply in addition to it's dedicated 74HC595 ... I wouldn't imagine the long distances I plan to run wires would work over such distances.


speaking of distances:
My current question is will the clock and latch signals from the arduino be able to travel such massive distances? Correct me if I'm wrong but I would need to amplify this signal, right?

Paul__B

I plan to have each relay on a PCB with it's own regulated 6v power supply in addition to it's dedicated 74HC595 ... I wouldn't imagine the long distances I plan to run wires would work over such distances.
Actually, you would almost always be better off grouping the relays together in eights and running power wires from there.  In fact, your power reticulation would be much more practical that way.  You most certainly would not want to have only one single shift register stage at each point, nor would you want a separate 5V regulated supply for only one relay because the cost of the regulated supply (plus the extra power cable fittings) is almost always going to be worth many metres of power cable.

speaking of distances:
My current question is will the clock and latch signals from the Arduino be able to travel such massive distances? Correct me if I'm wrong but I would need to amplify this signal, right?
That is what people have been telling you.  At the very least, you would need to use buffers (74HC14) at each point in the chain.  A 74HC14 is a hex inverter - you use one inverter feeding another two in parallel so that the result is not inverted; you should only need this for the clock and latch lines which go to all units in the chain.

PaulRB

Hi, have you considered rs485 for transmitting the data? Each node could have an attiny85, an rs485 adaptor and a transistor to drive the relay. This is just an idea for investigation, I have not researched thoroughly, for example can rs485 support 512 nodes.

Paul

Grumpy_Mike

I would use an AM26LS32 and an AM26LS31 to transmit and receive a digital signal over a distance. This is RS422, and uses a twisted pair to send the data. At the receive end you can have your relay and relay driver and you can have the shift register at the send end close to the Arduino.

This is a picture of a 40 way driver I built with a RS422 driver / receiver

Go Up