From: "Vasile Surducan" > > To protect the PIC from this I am going to opto isolate the inputs and outputs. > Interesting methode... don't forget, your purpose is not just to > protect a PIC but to have a functional device, protecting all PIC > inputs and outputs with optocouplers could be sometimes a silly. The > silly is so big when you do optoisolation and keep a common ground or > common supply for both sides of the optocoupler. I have seen many like > this on those lists. I have separated the Input's Power and GND from the PIC's and also the Output's Power and GND so it is basically three separate circuits on the same PCB. It can be run from one, two or three powersupplies depending on how sensitive it will prove to be to noise etc. > > My question is where do I put the filter for the inputs, before or after the > > opto-couplers? > where it fit betters with your schematic (as impedance or just RC > values, using non polarized capacitors versul polarized capacitors, > etc)) > > And what should be used to filter, Resistor and a Cap? Values? > > PLC:s have a 5kHz filter according to their datasheet. > Depends what kind of filter it has. Usualy a simple RC network with > t=3RC and t=1/f solve the problem. But not always, restrictions are > large when talking about analog signals and the passband of the filter > and the shape between stop band to passband For now it is only digital in and outputs. And yes I was thinking an RC-filter. F=5kHz t=1/5000 R=3k3 0.0002=3 * 3k3 * C C=0.2nF ? > > I have used a PIC before in this environment and it went 'nuts' due to 50Hz > > noise it picked up by long wires, and I want to avoid that =) > > Probably because you haven't used a methode which could reject 50Hz > from long wires (like driving long wires with analogic signals under > the constant current or using standardized digital communications on > long wires - using microcontrollers on both ends- ). Yes, you are right. Thats why I want to see what can be done about rejecting 50Hz noise from inputs. The simple RC-filter above is for 5kHz. But perhaps it should be for 50 Hz instead? > success, > Vasile Thanxs =) -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist