Fried pin even though there was a 10k Ohm resistor in front of it?

Hi,
I am working in a car, which are notoriously noisey it seems. Project is going well in general, but I recently added an interrupt directly from the starter switch to a 10k/5.1k voltage divider, to pin D2 (arduino Nano). In the ISR I was doing a DigitalRead(2) and it was always returning 0, although the interrupt was working.

On my desk, I just convinced myself using the Nano from the car and a brand new one (and the same sketch and same hardware setup) that I've fried the one from the car.

When I measured the voltage coming from the divider it was around 4.4V, so it shouldn't have fried the pin, but it sure seems to have. So my questions are

-Was it likely a big voltage spike from that starter wire, and my digital MM just read 4.4 after the spike passed?
-Or was it correctly 4.4V, but a big current spike? Is a big current spike even possible with those large (10k / 5.1k Ohm) resistors in place?
-Or maybe when I turned the starter off, the signal to the voltage divider went negative for a second, thus frying pin D2?
-How strange is it that the interrupt was working, but the pin seems to be fried? I'm a software guy, and it seems like when hardware is misbehaving, it's almost like anything is possible... when something gets fried, all bets are off, up can be down and black can be white...

Thanks-

Post a schematic.

but a big current spike? Is a big current spike even possible with those large (10k / 5.1k Ohm) resistors in place?

Not without voltage... Current (Amps) = Voltage / Resistance (Ohm's Law).

You can get a high negative voltage spike when you remove power from an inductor (including the inductance from a starter motor, etc.). BUT, there are protection diodes* built into the ATmega chip, and as long as there is a series resistance, the current should be limited and those diodes should "work" and protect the Arduino. (Without resistance you can easily fry the diodes.)

There's probably also a [u]flyback diode[/u] built-into the starter to kill the negative spike.

If you were touching the circuitry, it's also possible that you fried it with a static discharge, or maybe "something else" happened...

Are there other inputs without resistors? Is there something connected to an output that could draw excess current?

  • You have a circuit similar to the 2nd schematic on [u]this page[/u] except you have higher resistance ("better") and lower current diodes ("worse"). I never found a spec for those built-in diodes. I think somebody on the forum said 1mA. The datasheet says "40mA maximum" for an I/O pin and if that actually applies to input pins, the only way to get that much current in is to "activate" the protection diodes.

40mA is the output transistors turning and connecting to VCC (high output) or Gnd (low output).

The IO pins have diodes that will supposedly sink a 1mA (inferred from an application note regarding a zero crossing detector) to VCC if the input goes above VCC + 0.5V, or will connect to Gnd if the input goes below GND - 0.5V. They used an appropriately valued resistor to use the diodes as rectifiers and not blow the chip (from mains supply! Very much not recommended).

That's also why unpowered chips are not to have active signals applied to the IO pins - the diodes can conduct and mak the chip see to be 'phantom powered', until the diodes blow.

For an automotive electrical environment, you need to expect, plan for and construct circuits that tolerate polarity reversals and transients of well over 125 V.

Suppression of Transients in an Automotive Environment (PDF).

Any switch handling inductive loads will have very high voltage spikes across it on switch-off unless a snubber circuit is used. You need a clamp circuit to protect against very nasty electrical situations like this.

When an inductor is switched off it tries to push the same current round the circuit - when your switch opened it simply pushed the load current through the 10k resistor, using whatever voltage it needed to do it.

The starter solenoid current is many amps, it tried to push that current through the 10k resistor (only partially succeeding as the switch will be arcing and limiting the max voltage to 100's or 1000's of volts at the time. Starter solenoids store a large amount of energy.

If you want to detect the starter solenoid operating a DC hall-sensor around the wire is a much safer technique.

Thank you all for your responses. This part of the project is as simple as it could be

starter (wire tap)-----10k-------5.1k-----GND
|
---------------D2

"...flyback diode built-into the starter"

Well this is a 30 year old car so I shouldn't assume anything... but it seems like I could put a diode into my circuit to prevent a negative voltage, true?

starter (wire tap)---->|------10k-------5.1k-----GND
|
---------------D2

If you were touching the circuitry

Ha, this is VERY real possibility. I know I need to try to work cleaner.

"Are there other inputs without resistors? Is there something connected to an output that could draw excess current?"

No, and I do not believe so.

Suppression of Transients

Wow, this stuff makes my head spin, and it's really not for lack of trying. Just trying to read a datasheet is incredibly difficult. I need to watch some videos on how to read this kind of literature. Thanks for that-

When an inductor is switched off it tries to push the same current round the circuit

Jeez, hardware is just not something I grok at all (it makes software seem so easy). I say that because whenever I ask my EE friend about current, he always says something like you don't design current, you design voltage, and then you get resulting currents in different parts of the circuit. I'm sure I botched that, but you probably get my intended meaning.

DVDdoug:
There's probably also a [u]flyback diode[/u] built-into the starter to kill the negative spike.

Why would there be?

Do you know how starter motors work?

In many years of working on cars, motorcycles and about anything with a starter, I have never seen a solenoid with a flyback diode.

One thing to consider is where your circuit is grounded. In a vehicle not all grounds are equal.

I also notice your schematics has no capacitors. Each input should have a 0.1µF from the input line to ground. And the ground for these capacitors should be at one physical point.

You should add a series diode coming into the DC/DC if for no reason than reverse connection protection.

I don't understand the two TIP122's it looks like you are trying to make and AND circuit. Perhaps you can eliminate the upper one (and its connection to the starter) and add some code to perform such a function.

As to why the interrupt works and the DigitalRead does not I can only hazard a guess. Perhaps some of the input circuitry was damaged (in the processor) but not enough to disable the interrupt recognition on that pin.

detown:
In many years of working on cars, motorcycles and about anything with a starter, I have never seen a solenoid with a flyback diode.

Now there were some caveats on my previous comment.

Starter motors do not use "kickback" diodes because on the one hand, there is no need to. The contacts on the relay solenoid are rugged and a tiny spark will not trouble them This is similarly true for most of the relays in a car. And the insulation on automotive cables is essentially equivalent to that on mains cables, so high transient voltages will not breach or damage it.

Note that the starter is controlled by its relay, which also serves to engage the starter pinion in some versions (otherwise a helical track on the starter shaft does this). So it is the starter relay coil rather than the starter motor that you may wish to snub.

Now modern cars that shut down the engine when idle or those with a dashboard "Start/ Stop" button will clearly have some snubbers built into the internal circuits that control that starter relay.

Hi,

Well this is a 30 year old car so I shouldn't assume anything... but it seems like I could put a diode into my circuit to prevent a negative voltage, true?

Definitely, probably like this.


Tom.... :slight_smile:

"ZD1" should in fact, be a 4.7 V. :astonished:

JohnRob:
I also notice your schematics has no capacitors. Each input should have a 0.1µF from the input line to ground. And the ground for these capacitors should be at one physical point.

Ok I need to learn more about capacitors.

JohnRob:
You should add a series diode coming into the DC/DC if for no reason than reverse connection protection.

This makes perfect sense, I will implement it.

JohnRob:
I don't understand the two TIP122's it looks like you are trying to make and AND circuit.

This is exactly right. I only want the relay energized when the Arduino output is on AND someone is cranking the starter. I of course originally had it controlled only by the Arduino, about 150mA at 12V == too much power wasted.

JohnRob:
As to why the interrupt works and the DigitalRead does not I can only hazard a guess. Perhaps some of the input circuitry was damaged (in the processor) but not enough to disable the interrupt recognition on that pin.

Thanks. Something like this is what I was thinking. The "interrupt works, DigitalRead fails" start only lasted a couple days. Now neither work. Board has been thrown in the garbage.

TomGeorge:
probably like this

Cool, that's similar to what I was thinking...