Driving 256 Relays???
CassLan
Posts: 586
Hi all,
I'm finding great ideas for the propeller with my work.
I need to drive 256 relays....and listen to 256 inputs....I'm a bit stumped on how to go about this. Luckily I have some budget to work with.
Any ideas would be appreciated.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Forum Search (Via Google)
I'm finding great ideas for the propeller with my work.
I need to drive 256 relays....and listen to 256 inputs....I'm a bit stumped on how to go about this. Luckily I have some budget to work with.
Any ideas would be appreciated.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Forum Search (Via Google)
Comments
Same with the inputs...Will only 1 input be active at a time ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The needy are many, the deserving are few.
·
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Forum Search (Via Google)
For input what about 74xx4067, connect 1 to the prop, connect 16 to each of the 1st inputs and you have 256 inputs. Need 8 pins to drive the multiplex control and 1 pin for reading the input
I've never done something like that before.
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Forum Search (Via Google)
Just for the record...have you ever heard of a 256 bit IO expander?
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Forum Search (Via Google)
Have you thought of using a·FPGA or multiple smaller CPLDs to implement this? I guess it would depend on how much other logic you need to incorporate to make it cost efficient!· It would be much better from a reliability standpoint than large numbers of 595s.
TrapperBob
That almost sounds like ... ModBus!
I'm currently writing a ModBus-interface.
The hardware is quite simple: For the outputs, I'm using 74HC595 + OC + transistors to drive the coils
For input, I have 74HC166 + OC. Each in/out bit has a indicator-LED.
I have split the in/out into 4 "ports". Each port should be able to drive about 10 "cards". Each card has 16 INs or 16 OUTs. To each port, only one kind of cards can be connected (either INs *or* OUTs).
Until now, 4 cards per port are tested (don't have more). That thing was (without the complicated mapping I do) reasonably fast. From the last bit I got over the RS232 to completed execution 64µs (with 64 outputs). Could do that a bit faster.
Currently, I'm implementing a quite complex mapping of coil-numbers, inputs and registers to physical inputs/outputs/RAM/EEPROM. Works, except for the unusual configurations with registers. Registers can be mapped to IO-Memory, to RAM or to EEPROM (EEPROM is missing 2 simple functions).
Responses including error-handling are currently implemented to get the right pattern for the code (CRC-checking, parameter checking, range checking).
I initially wrote it in SPIN and had a response-time of 2ms for 64 bits. In C, I got it about 7 times faster. Don't have the current numbers at hand with all the responses.
Shifting data in or out is written in assembler.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
If only one relay is on at a time, you can save chips by arranging them in a 16x16 array. You would need two 74HCT595s for the column and two for the rows. The columns would need 16 high-side drivers; the rows, 16 lowside drivers. It's just like driving an LED matrix, but with relays instead. If you were to use solid-state relays, you could dispense with the coil drivers and switch them directly from the '595s.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.
If it's not Parallax then don't even bother. :-)
·
Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
Cheap·shipping unless specified!··········150 left!!··
Exactly one. Like with allmost any other µC.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Sounds like an impressive project!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.
If it's not Parallax then don't even bother. :-)
·
Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
Cheap·shipping unless specified!··········150 left!!··
http://forums.parallax.com/forums/?f=15&m=324351&g=366101#m366101
This project is more complicated than what your application requires since any arbitrary number of relays may need to be activated at once. In an application where relays needs to be activated only one at a time one prop, 2 8 bit low side latch/drivers and 2 8 bit high side latch/drivers are needed.
[url=http://www.nxp.com/#/pip/pip=[pip=PCA9685_1]|pp=[t=pip,i=PCA9685_1]http://www.nxp.com/#/pip/pip=[noparse]pp=[noparse][[/noparse]t=pip,i=PCA9685_1[/url|
It has 16 channels and a programmable frequency...
Plus, you'd have an LED indication for each servo...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
[url=http://www.nxp.com/#/pip/pip=[pip=PCA9555_7]|pp=[t=pip,i=PCA9555_7]]www.nxp.com/#/pip/pip=[noparse][[/noparse]pip=PCA9555_7]|pp=[noparse][[/noparse]t=pip,i=PCA9555_7][/url]
Are all these I/Os on one PCB or spread around an installation? If they are spread around an installation, then perhaps you develop a low cost board that speaks RS-485 or Modbus or similar protocol. This low cost board would have x inputs and y outputs. The Propeller would be on the "master" board and process the system I/O and speak to the daughter I/O cards. This solution may be more elegant because of flexibility, but it will be more costly in hardware and development effort.
Can you tell us more about the application?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Timothy D. Swieter, E.I.
www.brilldea.com - Prop Blade, LED Painter, RGB LEDs, 3.0" LCD Composite video display, eProto for SunSPOT
www.tdswieter.com
*Peter*
*Peter*
The outputs could all be connected in parallel to go to an amplifier or whatever circuit you need, although I would put a small resistor between each output and the common signal line.
Total cost of the chips including the prop $20.00 to $40.00 before taxes depending on package used.
*Peter*
Total cost is under $10 at one-off prices.
The application is an intercom controller for a residential apartment building.
The current "controller" is a HUGE brass plate (~33"x20") with 212 buttons, 212 LEDs & 212 Relays, each of these was soldered by hand (not by me)...there is also a pretty big ratsnest as well.
Each apartment has 2 wires going to it, 1 being a common shared by all apartments I'm pretty sure.
Operation:
When the apartment handset lifts off the cradle (The equivalent of shorting the 2 apartment wires), at the Front Desk -> that particular apartments LED lights up, and a buzzer is sounded.
The person on duty at the front desk pushes the button for that apartment (I believe activating that apts relay), then lifts his handset (which is also a switch) and voila! They are speaking.
When the Front desk wants to call an apt, he pushes that apts button, lifts his handset and pushes a spring loaded button to ring the apt. When the apts handset is lifted up..voila! They are speaking.
The kicker is that the original manufacturer does not have a moderized version of this, only the same huge plate as described above.
I figure·I can make something much better, and then I have a solution in the can for future use.
I can't wait to hook them up with an LCD which will display which apartment is calling, allow them to scroll through recent calls, display the time...etc.
I'd like to design for 256 apts·incase I have a need for this in the future (and keep the design to where I could double that # if needed as well).
I want to fit this new product (at least the part that you can see) within an area of 8" x 11"; That including handset, LCD Display and buttons.
I'm thinking as far as connecting all the wires to the system that I would use·66 or 110·punch blocks that are pre-wired to·50 pin connectors, all the apts connect to the blocks and 50 wire cables go to the system board.
You think this will be the first propeller based intercom controller?
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Forum Search (Via Google)
Then the matrix (as described by Peter J.) is the right way to go. With TTL-compatibe relais, you don't even need powerful drivers. But 256 of them might ... oh! you will get a volume discount.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
These chips have been working for over 12 years (original DIP version) and only were killed by a lighting strike last year.
With 32 outputs it does not take a lot of chips to handle large applications like you have.
In my application any number of outputs can be on/off and any number of inputs can be on/off at any given time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki Rocks! - propeller.wikispaces.com
When the Prop is up and running, he first has to clear the registers and then enable them. There is *no* guarante what the latches contain after power up of the 595.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
Rick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Prop Forum Search (Via Google)
One question that will decide much of your choice is exactly how many milliamps each relay will require and what will be the overall power requirements for having a full 256 relays in their ON condition.
At 60millamp/220ohm/12volt relay coils; the 12 volt supply with be roughly 16 amps. I am not very clear what the 5 volt stage would require, but it should be worked out.
Furthermore, there is only so much of this that can be done on a printed circuit board. From the UUNL2803 to the relays will likely be done by wire cable and require a rather ample housing to contain 256 relays. I'd recommend modular socketed relays that mount on an aluminum rail.
Wurlitzer seems to be doing something with a pipe organ.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
Post Edited (Loopy Byteloose) : 7/11/2009 2:37:57 PM GMT