Thoughts on uC input protection for automotive/marine enviroment wanted

I have a one off hobby project which involves taking a possibly irregular pulse train from a switch, debouncing it and generating a pulse train at a different frequency so than for any run,

N*count_in-M*count_out tends to zero and F_in/Fout ~ M/N.

(where M and N are integer constants for any run)

The maximum input pulse rate is less than 200 Hz and the duty cycle is between 10% and 50%.

The input(s) are on a PIC microcontroller with a 5 V supply and the output is via an optocoupler so no concerns there.

The fly in the ointment is the sensor generating the pulse train. It is a reed switch potted in a sensing head on the end of about 10 metres of normal two core PVC insulated mains flex IMMERSED IN SEAWATER, so it is absolutely critical that the sensing circuit is fully DC isolated from the vessels other systems to avoid electrolytic corrosion due to long term moisture permeation of the insulation and it would also be desirable to either sense with AC or reverse the polarity regularly for the same reason. Sensor replacement would be extremely difficult and avoiding sensor damage is top priority.

I had considered capacitive isolation of the sensor with the uC generating a sensing pulse on one lead and the return feeding a charge pump driving an uC input, but the resolution I need and the minimum contact closure time seems to require a minimum frequency of the order of 10 KHz and I have concerns about the cable self capacitance and capacitance to the water and interference from and to other equipment.

(Other equipment uses high amplitude pulsed 150 KHz and 200 Khz signals, and 4800 baud data. There is also a marine VHF tranceiver and a normal automotive alternator which may or may not be running while this device is operating. Any significant additional interference to VHF FM or AM (from LW broadcast band up to SW) radio reception is unacceptable.)

I am now considering an isolated DC-DC converter for the uC supply and connection of the sensor to two pins, with one driven low and the other used as the input with a pull-up. On every contact closure, the function of the two pins will swap after the debounce time which should average to no net DC through the sensor.

Obviously, series resistors and clamping diodes would be advisable, but the conflicting requirements of adequate margins on the logic levels, the output drive capabilities of a mid range Microchip PIC16F uC and the need to maintain an adequate current through the reed switch for reliability makes choosing a circuit configuration and component values more difficult than it would otherwise be.

If anyone has any suggested (online) reading for this type of problem or cares to post ASCII circuits or suggestions, their advice would be most welcome. I don't have any prior hands-on experience with CMOS input protection in an automotive environment, my constraints are somewhat non-standard and a quick Google gives over 50K results with little indication of where they stand on the scale from total garbage to overkill for a space rated application, so please be kind!

I cant get any binaries group so you'll need to put any binary files on the web somewhere for me to look at. I'd prefer to keep the discussion here initially rather than going to email as I find the consensus of opinion valuable. I'll be out of touch over the weekend so please don't expect any further input from me much before Monday.

--
Ian Malcolm.   London, ENGLAND.  (NEWSGROUP REPLY PREFERRED)
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk
 Click to see the full signature
Reply to
IanM
Loading thread data ...

  • Firstly, it does not matter what you do, everything corrodes in seawater, even ships that use RP to a sacrificial anode (that does decrease the ship problem dramatically, tho).
  • Reversal idea may help..
  • I use 100K pullup from micro +5V supply; switching threshold appears to be around 1.5V (prolly the min, and 2.5V for a max); input R seems to be in the tens of megs or more. (then again, my cable length is specified to be less than three feet) And i program for low to high with switch NC; that way there is no bounce to consider on that edge; and have logic as a do not care on other edge.

So far, i depend on the micro input diodes for protection and use a

1K resistor in series from sensor (switch) to micro input. But if need, use a dual back-to-back SMT diode array (SOT23-3 is nice and small).
Reply to
Robert Baer

You mention that there are high amplitude pulsed RF signals nearby. I would try a quick test by placing the 10 meter unshielded cable connected directly to the PIC next to one of these transmitting antennas. My concern would be false triggering of the input during the RF pulses.

Your idea of AC coupling the sensor sounds good, but have you considered using something like an audio transformer? These are usable at 10 kHz and they will attenuate 150 kHz and up fairly well. This will also provide your isolation and DC balance. Sending 10 kHz through 10m of plain cable should not be a problem either, speaker systems go up to 20 kHz using cables much longer than that. You can use the CPP feature on the PIC16 to generate the 10kHz signal, feed it through a resistor to the high impedance side of the transformer and connect your sensor to the low impedance side of the transformer. When your reed switch closes, the voltage on both sides of the transformer will drop. You may have to experiment with the choice of transformer and resistor value to get adequate edge response combined with good RF rejection. You can always add more RF filtering on the secondary side if required.

Reply to
Tom

"IanM" schreef in bericht news:h0tbkc$rkr$ snipped-for-privacy@energise.enta.net...

Beware. A lot of plastics are not realy watertight, so you have to look after both cable insulation and potting material to make sure they are at least suitable for outdoor use.

As for powering the sensor I'd go for an well insulated (audio)transformer mentioned by others already. No need to say you'd better twist that 10m cablewires. Keep in mind that 10m cable wil have some resistance so the secondary need to provide high enough a voltage to light the LEDs when the reed switch is closed.

transformer _/ ---------. ,-------------------------------------o/ o--+ )|( 10m cable reed | 10kHz )|( +--------------------------------+ ---------' '---+ | switch | | -----+ | | .--|---------|-----. | | | +---+ | | photo \| | | dual| | transis | V - LED | | tor |

Reply to
petrus bitbyter

petrus bitbyter wrote: UL:

Not a lot of choice about the cable or sensor. Its existing equipment. In my favour is that it *was* originally designed for use in this environment and although immersed in use, it is removed and hung up to dry the rest of the time. It might have to withstand a week of immersion, but more usually it would be immersed for anywhere up to 24 hours or so then dried for anywhere between the same time and several weeks. It does have *some* twist and rapidly acquires a whole lot more if the sensor's rotor jams! :-)

Thanks. Got most of the parts in the junk box so trying it should be cheap and easy

I doubt static is much of an issue in this enviroment, but neon bulbs or

10M resistors are cheap.
--
Ian Malcolm.   London, ENGLAND.  (NEWSGROUP REPLY PREFERRED)
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk
 Click to see the full signature
Reply to
IanM

Good point. I can tolerate occasional false counts, but anything repetitive is undesirable. I am planning on low pass filtering the input *before* any active components.

Speaker cables aren't commonly immersed. I suspect I'll have to take a cap meter, drop the cable in the sea water and measure the capacitance to earth or in this case Sea. :-) It's probably not a problem but I need to get that number before I go much further.

Both CCP modules will be used for the pulse rate conversion. I will have a free timer if I can tolerate the overhead and a little jitter or I can probably implement a simple RC oscillator with the analog comparator but its probably simpler to just stick a CMOS 555 in there which will easily drive the transformer.

Hmm. Same transformer for power and sensing. Looks like its time to make up a test jig including 10M of cable in a can of salt water and get breadboarding.

--
Ian Malcolm.   London, ENGLAND.  (NEWSGROUP REPLY PREFERRED)
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk
 Click to see the full signature
Reply to
IanM

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.