I'm designing a new product that will have a uC board in a plastic box, powered by a 12V mains adapter. I'm choosing to use a COTS adapter rather than designing a mains device to reduce certification issues.
On the main (uC) PCB, there will be a 5V regulator powering just the uC, and there will be connectors for three types of external devices. The tree devices are; a 5V sensor, a 12V actuator, and a toggle switch.
The 5V sensor will have its own regulator on the main PCB, and connect to 2 digital inputs on the uC, the 12V actuator will be powered from the 12V adapter via a relay or MOSFET on the PCB, and the toggle switch will be connected to ground and a digital input of the uC.
The sensor is likely to be on a cable less than 2m long, the actuator will probably be on a cable between 2m and 8m long, and the toggle switch will be on a cable between 8m and 20m long.
I have not really got any experience of designing system with long cables, and would like to understand how to design and implement this system to minimise the likelihood of incorrect readings of the toggle switch and sensor due to EMI on the cables.
The type of connector that I would ideally like to use would be 3.5mm jack plugs, and I have identified some cable that I think may be suitable. I am trying to keep the cost per meter of cable down to a reasonable price (<£1/m)
My assumption is that with the above type of cable, (for the 5V sensor) I can use one core for the 5V power line, two cores for the digital signals, and the shielding for the 0V reference? Is this correct, and will this help to reduce EMI from affecting the integrity of my signals?
For the toggle switch, I assume I can use a single core shielded cable, and use the shielding as the 0V? Is this correct?
What about the actuator, can I also use single core for 12V and shielding for 0V?
I assume that it would be beneficial to use strong pull-ups for each of the digital inputs I am using (~200Ohm?). And that I should place capacitors between 0V and input signals on the main PCB? What values might these need to be?
For the toggle switch, perhaps I would also need a ferrite bead around the cable? At the PCB end? Would ferrites be useful for the other cables?
An example of the setup that I may have is, 12V 2A mains adapter, powering my uC board in a plastic box. a 4-pin jack cable (2m long) connecting to a rotary encoder with 2 digital lines pulsing < 100Hz, a (2pin jack) 5m cable connecting to a maglock (12V <200mA), and a 2-pin jack, 15m cable connecting to a toggle switch in another room.
The maglock would normally be locked, moving the rotary encoder to a particular position would cause the maglock to be unlocked, or closing the toggle switch would also cause the maglock to unlock.
There may be multiple of these systems in one room. There is no high powered machinery nearby, standard mains equipment may be present in the room, and there may be maglocks deactivating/activating periodically.
So my questions are?
In such an environment, what types of EMI would cables of the lengths I describes be likely to pick up?
Is the use of internal cores of shielded cable for power and signals, and the shielding for 0V (connected at both ends) suitable? Will this reduce EMI and likelihood of incorrect values on signal lines?
What interface should I provide on the uC side? e.g. capators between signal and 0V, strong pull-ups, etc.? Should I use these, is there anything else that I should use?
Are ferrite beads suitable for putting on any or all of my cables in this situation? Do I need them at both ends, one end, or not at all?
If ferrite beads are necessary, how might I choose appropriate spec?
Are there any other sources of interference that may be likely to cause me problems?
Should I be 'seperating' ground planes on the main PCB. If so how?
Is there any other general good-practice advice for designing such a system?