Will my input protection work? Connecting arduino to automotive environment.

I need to connect an Arduino to an an automotive system so I can monitor temp, voltage, and rpm.

I know this is a crazy environment so I will be needing input protection for when I interface with the cars electrical system.

I have been reading and learning a lot since I started, but I am not sure if I covered all my bases for preventing the arduino circuit from frying.

Here is what I have thought of so far.


Here are the extreme conditions that I will need to cover.

  1. Voltage divider for the battery monitor circuit will step input voltages of up to 18V to fit within the required 5V envelope.

  2. A steady battery "boost jump-charging" input of 24V would result in 1.525V getting shunted to the 5v rail via D1.
    Why would this work. Wouldn't the 5V rail be lifted to 6.525V instead and wouldn't this kill the arduino ?!?!?

  3. 125V (400ms ~10J) load dump --> shunted to 5V rail.
    Can the rail disappate 10J of energy ??

  4. 300V (1J) transient --> shunted to 5V rail and the 1J of energy shouldn't be enough to raise the rail voltage

  5. -100V alternator decay field. Any negative voltages should be eliminated from entering arduous circuit via D2

The programming part was easy, but I am a little over my head in protecting this circuit from failure. Can someone give any tips???


All help or insight is appreciated~!!!

Current through D1 is limited by R4, spikes clipped by C1, I can't see problems from the primary supply path here.

What's the purpose of measuring the battery voltage? I'd dimension the volitage divider for about 24V, so that also excess input voltage (jump start...) can be detected. The accuracy is limited by D2.

I'd worry most about the reliability of the step-down converter.

BTW the (continuous) buzzer connection looks wrong to me :wink:

Thanks for the insight!!

To clarify, I can feel safe that the 20k resistor will limit current from voltage spikes to such an extent that it won’t be able to lift the 5v rail upwards? (most of the energy present from the voltage spikes will be absorbed by the cars lead acid battery or other electrical systems.)

About the buzzer, it is connect to a digital pin. When I pull the pin high the buzzer is off. When I pull the pin low the buzzer is on.

About the converter. Even if it fails, assuming it doesn’t create a voltage spike before it’s death the circuit should stoll remain in a protected state? These continuously power cell phones and gps in the car, so I think they have built I filtering to produce a cleanish / stable 5v signal.
Here’s an oscilloscope analysis on TomsHardware.

I didn’t want to use a 24v divider since the higher I go, the more accuracy I lose. Even 18v is too high but I was worried about how shunt would perform if the system gets stuck in an 18v state.

You can increase the accuracy (measuring span) by a Z diode in the upper voltage divider branch.

One last question! This is a diesel motor and there is nothing easy to grab onto as to count the RPM.

The only way I figured to calculate RPM is to grab onto the W terminal (unrectified output) from the alternator & count the peaks of the sine wave.

I will be needing a schmitt trigger to filter out the noise.
I already have one in mind that will turn on at 10V and turn off at 4V.

The rails that feed into the op amp, determining the saturation voltage, will be GND and 5V line from the arduino.

How do I need to protect this circuit before connecting Vout into the arduino?? Is the diode in red enough? (Note: R5 will not exist, it was only there so I can grab the voltage response from partsim.com)

--

For the zener diode recommendation, did you mean to use, lets say a 5V zener, to drop the 0-18V input range into a smaller 0-12V range in where any readings under 5V will be unreadable? This will allow to use a smaller voltage divider to yield a greater resolution?

--

As to your other question. This is a diesel generator.

I need to measure voltage since when the batteries drop under a set amount I need to fire the buzzer.
I need to measure temperature to kick the fans off and on, or to kill the fuel pump on overheat.
I need to measure RPMs just for knowledge and maybe to expand functionality in the future.

I may need to measure current leaving with the battery with a hall sensor, since under a large load, it might reach the low voltage threshold without it actually being a low battery. For now, I will simply trigger the buzzer if the battery is in a low voltage state for longer than a minute.

I also introduced a mechanical, bi-metallic sensor to trigger a relay and cut the fuel pump on overheat as a redundancy. Fun project until I needed to learn about op amps & input protection.

For super safe inputs insert an optocoupler between the opamp and the Arduino.

For the voltage divider you are right, the ratio should be adopted to the remaining voltage range.

I cannot thank you enough !!!!!!

Just for reference, without the octocoupler, would I need a current limiting resistor before the overvoltage diode or is the signal output from an op amp inherently current limited?

It depends, I'd say. A current limiting resistor reduces power and heating of the opamp.

Under normal operating conditions shouldn't the output of the opamp only be going to the arduino input pin and to contorol the feedback loop?

-The arduino input has a high impedance, so that is already current limited.
-The feedback loop has resistors on the order of 10k so it is already current limited to ~0.5ma.

The only time the opamp wouldn't be current limited, is when something has failed causing it to shunt excess voltage to 5v rail.

Only under this situation I would think it would be pumping its max current.

(This is all purely my projection and may be completely inaccurate, I am not very familiar in this topic).

--

If you think I need a resistor, can I ask where do you think I place it?

  1. right before the diode

or

  1. before both the diode and the input to the arduino

How big do you think this resistor should be?

I feel bad for asking all these trivial questions but I would like to learn more.

Practical application and concerns have not been the focus of the electronics book I have on hand. This stuff is pretty interesting.

Extra output current should not interfere with proper feedback. Since the opamp output toggles between most positive (HIGH) and most negative (LOW) level, the diode will conduct during HIGH state, almost no current flies in LOW state with R5 removed or quite high (10k-50k). I think that R5 is not part of the trigger circuit, it only represents the input resistance of the next stage, which is quite high with a digital Arduino input. Then R5 can be replaced by the builtin pullup resistor (mode INPUT_PULLUP), so that the only place for the current limiting resistor is between opamp output and Arduino input with clamping diode.

Instead of clamping the output voltage to Vcc the diode could be inlined, so that only in LOW state a small amount of current is drawn from the input pullup resistor, and no current in HIGH state.