??? 05/05/05 12:20 Read: times |
#92983 - Sure, you did! ;-) Responding to: ???'s previous message |
Hi Russel,
Thanks very much for your extended explanation. Much appreciated! I've commented a bit on yours. Look below. Best rgds, --Geert Russell Bull said:
We understand your application a bit better now. I would suggest for inputs that are connected via a length (> 1m) of wire that more precautions are necessary - I gather these wires would be run around your house. I've tried to keep everything as compact as possible. So, there are no long loops running around. For instance, the IO expanders I was talking about, will be located on a PCB very close to the PCB containing the uC. Because of that, I've worked with a 'star' construction. There's indeed UTP cable (Cat5E) used to connect the external light switches with the PCBoards. All cables will be centralised in one box. Those PCBoards will be located in a separate box, away from the normal fuse box (ok, they will be put next to each other, but the wiring will not be mixed, that would anyhow be illegal in Belgium). Russell Bull said:
1/ safety - say you have 5 volts running down your wires for your switches and you wire is something like CAT5 since it is cheap. You need some form of current limiting so that a short circuit won't cause excessive current to flow in the wire and thus cause a fire. Also, even if excessive current can't flow, you don't want to to kill your cpu power. So a fuse and a current limit circuit should cover you. The fuse in case the current limit circuit fails and the current limit circuit so a short circuit won't necessarily blow the fuse. Below, you can find a principle circuit of how the switches will be detected. Mind the fact that the supplies are completely separated (of course...). ![]() I've taken a CNX83 as optocoupler, with the following specs: - Diode: If=10mA / Vf=1,2V => R = ( 5V - 1.2V ) / 10mA = ~ 390ohm. - Transistor: Vcesat = 0.2V / Ic=5mA => R = (5V - 0.2V ) / 5mA = ~ 1kohm. So, with this approach, I think the chance of destruction is rather low. Do you agree? Russell Bull said:
2/ ESD,Lightning and coupling from mains wiring. Keep your wiring away from mains where possible and try not to run parallel - cross at right angles with the mains. Long wires act as a secondary turn in a transformer with lightning - large voltages can be induced from close strikes - transzorbs do a good job of soaking up low level effects of lightning strikes - if you get a direct hit all bets are off! Also, transzorbs do a good job with ESD - people walking across carpets and touching a control panel is ESD city! If your control panels are metallic - earth them. For 5V signals like RS485 and switch inputs, a transzorb like the SA5.0 are economical. They act like a zener diode - above 5.6V they start conducting. Do you think additional protection is still necessary, seen the galvanic separation between the two worlds? Russell Bull said:
3/Opto isolating relays is generally a waste of time. The relay itself galvanically isolates the load from your circuitry, so why add another galvanic isolation? Rather than use 5V relays and power them from your cpu supply, use 12v or 24v relays (most likely cheaper) and use a device like a ULN2003 to drive them. The ULN2003 has built in catch diodes and has plenty of current drive to cope with the usual small relay. Keep in mind your 0V wiring - the average 12V 10A relay draws about 40mA each, turn a number of them on and off at once will cause a current pulse - so don't expect to have your 0V wiring run through your cpu circuitry then onto the relays - have a 0v run for your cpu stuff and another to the relay circuit. Indeed, you're right. For relays, that would be waste of time, money and place on the PCB. But for the other things, I still find it necessary. I will have a look to the ULN2003. Since you say it has sufficient current to drive small relays, it might replace lots of other components (like transistors, resistors, diodes). Might be an interesting option, indeed. Russell Bull said:
I don't know if you want to run I2C around your house, not something I would suggest though. In my professional lighting controls I used RS485 which has proved robust and cheap. You can do quite a lot with a 89C2051 and a RS485 chip! I used these in my control panels that had pushbuttons and leds. A newer choice might be a philips LPC9xx series cpu. The 75176 style RS485 transceivers are quite robust. I run multidrop on the RS485 so you can have little boards with dip switches to set the unique address. Regarding the I2c, definitely not! That's why I concentrate everyting as close as possible around the uC. One exception: seen the large amount of wires, I have to have two boxes for the domotics electronics. One downstairs and one upstairs. I2c will be connected between the two, by means of an I2c buffer, so that I can compete with 'long' distances. Regarding RS485, I would like to use it for the following: I will also have RC detection (infrared) in all the places of the house. However, I want to decode the command locally (by means of a small PIC or something similar) and then transfer the received data in a more 'robust' way to the controller. Therefore, I would like to use RS485, since I will have some 15 individual RC receivers in total, spread all over the different places in the house (some rooms will have two RC receivers). The problem is: I have almost no clue what RS485 really is. Searching the internet gives you way too much info, I can't see the trees through the bushes anymore at the end. Would be nice if I could have a few very good links to this matter. Maybe you have? Russell Bull said:
Have I said enough??? Yes, you certainly have. Yes, indeed! Russell Bull said:
Herlich! Sure, it is! ;-) Best rgds, --Geert |